diff --git a/cypress/e2e/explorer_latest_transaction_list_Xchain.cy.ts b/cypress/e2e/explorer_latest_transaction_list_Xchain.cy.ts index 41745a1d..8e68ae2f 100644 --- a/cypress/e2e/explorer_latest_transaction_list_Xchain.cy.ts +++ b/cypress/e2e/explorer_latest_transaction_list_Xchain.cy.ts @@ -1,5 +1,3 @@ -import { expect } from 'chai' - let transactionsBody = { transactions: [ { @@ -279,7 +277,7 @@ describe('latest transaction list Xchainet', { tags: ['@explorer', '@suite'] }, }) }) cy.wait('@transactions').then(() => { - cy.get('.css-1voxykv-MuiPaper-root').should('be.visible') + cy.get('[aria-label="transaction-list"]').should('be.visible') cy.get( ':nth-child(1) > .MuiGrid-grid-md-4 > .MuiGrid-container > .MuiGrid-grid-xs-8 > a > .MuiTypography-root', ) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 9a350fdd..cef68612 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -82,12 +82,24 @@ Cypress.Commands.add('changeNetwork', (network: string = 'Kopernikus') => { cy.get('@txtSelectedNetwork') .invoke('text') .then(currentNetwork => { - cy.get('@btnNetworkSwitcher').click({ force: true }) // Network Switcher - cy.get(`[data-value="${network}"]`).click() // Select Network - - // Waiting 'info.networkID', and 'info.getTxFee' - cy.wait('@getNetworkID').then(interceptNetworkInfo) - cy.wait('@getTxFee').then(interceptNetworkInfo) + if (currentNetwork !== network) { + // Only perform the switch if the current network is different + cy.get('@btnNetworkSwitcher').click({ force: true }) + cy.get(`[data-value="${network}"]`).click() + + // After switching, wait for the network requests + cy.wait('@getNetworkID').then(interceptNetworkInfo) + cy.wait('@getTxFee').then(interceptNetworkInfo) + } else { + cy.get('body').then($body => { + if ($body.find(`[data-value="${network}"]`).length > 0) { + cy.get(`[data-value="${network}"]`).click() + } else { + cy.log(`Network option '${network}' not found.`) + } + }) + cy.log(`Already on the '${network}' network, no switch needed.`) + } // increasing timeout to make sure the network is selected, especially on slowly local dev env cy.get('@txtSelectedNetwork', { timeout: 15000 }).should('have.text', network) diff --git a/public/index.html b/public/index.html index ea5bfd7b..b0dca7a1 100644 --- a/public/index.html +++ b/public/index.html @@ -1,8 +1,8 @@ - + - + @@ -38,12 +38,12 @@