From 3e9fafe231f5d78518898e5d9576eb17da4233e8 Mon Sep 17 00:00:00 2001 From: Bartek Date: Thu, 19 Dec 2024 14:41:20 +0100 Subject: [PATCH 1/7] videos --- .../synpress.cctp.config.ts | 3 ++- .../tests/e2e/specfiles.json | 24 +++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/arb-token-bridge-ui/synpress.cctp.config.ts b/packages/arb-token-bridge-ui/synpress.cctp.config.ts index bc6679e52f..3a1ba282b0 100644 --- a/packages/arb-token-bridge-ui/synpress.cctp.config.ts +++ b/packages/arb-token-bridge-ui/synpress.cctp.config.ts @@ -43,7 +43,8 @@ export async function fundUsdc({ await tx.wait() } -const shouldRecordVideo = process.env.CYPRESS_RECORD_VIDEO === 'true' +// const shouldRecordVideo = process.env.CYPRESS_RECORD_VIDEO === 'true' +const shouldRecordVideo = true const tests = process.env.TEST_FILE && diff --git a/packages/arb-token-bridge-ui/tests/e2e/specfiles.json b/packages/arb-token-bridge-ui/tests/e2e/specfiles.json index fd907011e2..3a5b234e94 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specfiles.json +++ b/packages/arb-token-bridge-ui/tests/e2e/specfiles.json @@ -2,61 +2,61 @@ { "name": "Login and balance check", "file": "tests/e2e/specs/**/login.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Deposit native token", "file": "tests/e2e/specs/**/depositNativeToken.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Withdraw native token", "file": "tests/e2e/specs/**/withdrawNativeToken.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Deposit ERC20", "file": "tests/e2e/specs/**/depositERC20.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Withdraw ERC20", "file": "tests/e2e/specs/**/withdrawERC20.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Batch deposit", "file": "tests/e2e/specs/**/batchDeposit.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "TX history", "file": "tests/e2e/specs/**/txHistory.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Approve ERC20", "file": "tests/e2e/specs/**/approveToken.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Import test ERC20", "file": "tests/e2e/specs/**/importToken.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Read classic deposits", "file": "tests/e2e/specs/**/readClassicDeposits.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Redeem Retryable", "file": "tests/e2e/specs/**/redeemRetryable.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" }, { "name": "Switch network", "file": "tests/e2e/specs/**/switchNetworks.cy.{js,jsx,ts,tsx}", - "recordVideo": "false" + "recordVideo": "true" } ] From 822873775046970706164a53e94c833bcd3ff296 Mon Sep 17 00:00:00 2001 From: Bartek Date: Thu, 19 Dec 2024 17:05:57 +0100 Subject: [PATCH 2/7] fixes --- packages/arb-token-bridge-ui/synpress.config.ts | 3 ++- .../arb-token-bridge-ui/tests/e2e/specs/approveToken.cy.ts | 2 +- .../arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts | 4 ++-- .../tests/e2e/specs/withdrawNativeToken.cy.ts | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/arb-token-bridge-ui/synpress.config.ts b/packages/arb-token-bridge-ui/synpress.config.ts index 84a332c1b0..31ae417ba1 100644 --- a/packages/arb-token-bridge-ui/synpress.config.ts +++ b/packages/arb-token-bridge-ui/synpress.config.ts @@ -226,7 +226,8 @@ export default defineConfig({ }, baseUrl: 'http://localhost:3000', specPattern: tests, - supportFile: 'tests/support/index.ts' + supportFile: 'tests/support/index.ts', + defaultCommandTimeout: 20_000 } }) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/approveToken.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/approveToken.cy.ts index c96ceb903c..896ce9c954 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/approveToken.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/approveToken.cy.ts @@ -50,7 +50,7 @@ describe('Approve token for deposit', () => { * If confirm spending fails, test is still considered to be passing by Cypress * We add another check to make sure the test fails if needed */ - cy.wait(10_000) + cy.wait(25_000) cy.rejectMetamaskTransaction() }) }) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts index a1ac1fb75e..e75600cfe4 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts @@ -103,7 +103,7 @@ describe('Withdraw ERC20 Token', () => { }) context('should show clickable withdraw button', () => { - cy.findMoveFundsButton().click() + cy.startTransfer() }) context('should withdraw successfully', () => { @@ -218,7 +218,7 @@ describe('Withdraw ERC20 Token', () => { }) context('should show clickable withdraw button', () => { - cy.findMoveFundsButton().click() + cy.startTransfer() }) context('should initiate withdrawal successfully', () => { diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts index 5de34a32de..5f3693284e 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts @@ -61,7 +61,7 @@ describe('Withdraw native token', () => { ETHToWithdraw = Number((Math.random() * 0.001).toFixed(5)) // generate a new withdrawal amount for each test-run attempt so that findAllByText doesn't stall coz of prev transactions cy.login({ networkType: 'childChain' }) cy.typeAmount(ETHToWithdraw) - cy.findMoveFundsButton().click() + cy.startTransfer() cy.findByText(/Arbitrum’s bridge/i).should('be.visible') // the Continue withdrawal button should be disabled at first @@ -146,7 +146,7 @@ describe('Withdraw native token', () => { cy.typeAmount(ETHToWithdraw) cy.fillCustomDestinationAddress() - cy.findMoveFundsButton().click() + cy.startTransfer() cy.findByText(/Arbitrum’s bridge/i).should('be.visible') // the Continue withdrawal button should be disabled at first From 9bfa84fc5a3b70b0e90d12eb1f908b39a8c7f4fa Mon Sep 17 00:00:00 2001 From: Bartek Date: Thu, 19 Dec 2024 18:10:27 +0100 Subject: [PATCH 3/7] fix --- .../tests/e2e/specs/batchDeposit.cy.ts | 4 ++-- .../tests/e2e/specs/depositERC20.cy.ts | 2 +- .../tests/e2e/specs/withdrawERC20.cy.ts | 4 ++-- .../tests/e2e/specs/withdrawNativeToken.cy.ts | 4 ++-- packages/arb-token-bridge-ui/tests/support/commands.ts | 10 ++++++++-- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts index 6319838063..2848a898e9 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts @@ -143,7 +143,7 @@ describe('Batch Deposit', () => { cy.waitUntil(() => cy.findTransactionInTransactionHistory(txData), { errorMsg: 'Could not find settled ERC20 Batch Deposit transaction', - timeout: 60_000, + timeout: 120_000, interval: 500 }) @@ -253,7 +253,7 @@ describe('Batch Deposit', () => { cy.waitUntil(() => cy.findTransactionInTransactionHistory(txData), { errorMsg: 'Could not find settled ERC20 Batch Deposit transaction', - timeout: 60_000, + timeout: 120_000, interval: 500 }) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts index 8e1a2c6e43..970c934803 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts @@ -160,7 +160,7 @@ describe('Deposit Token', () => { }), { errorMsg: 'Could not find settled ERC20 Deposit transaction', - timeout: 60_000, + timeout: 120_000, interval: 500 } ) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts index e75600cfe4..6eb9929e57 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts @@ -103,7 +103,7 @@ describe('Withdraw ERC20 Token', () => { }) context('should show clickable withdraw button', () => { - cy.startTransfer() + cy.startTransfer({ confirmMetamaskTransaction: false }) }) context('should withdraw successfully', () => { @@ -218,7 +218,7 @@ describe('Withdraw ERC20 Token', () => { }) context('should show clickable withdraw button', () => { - cy.startTransfer() + cy.startTransfer({ confirmMetamaskTransaction: false }) }) context('should initiate withdrawal successfully', () => { diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts index 5f3693284e..c8524f2717 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts @@ -61,7 +61,7 @@ describe('Withdraw native token', () => { ETHToWithdraw = Number((Math.random() * 0.001).toFixed(5)) // generate a new withdrawal amount for each test-run attempt so that findAllByText doesn't stall coz of prev transactions cy.login({ networkType: 'childChain' }) cy.typeAmount(ETHToWithdraw) - cy.startTransfer() + cy.startTransfer({ confirmMetamaskTransaction: false }) cy.findByText(/Arbitrum’s bridge/i).should('be.visible') // the Continue withdrawal button should be disabled at first @@ -146,7 +146,7 @@ describe('Withdraw native token', () => { cy.typeAmount(ETHToWithdraw) cy.fillCustomDestinationAddress() - cy.startTransfer() + cy.startTransfer({ confirmMetamaskTransaction: false }) cy.findByText(/Arbitrum’s bridge/i).should('be.visible') // the Continue withdrawal button should be disabled at first diff --git a/packages/arb-token-bridge-ui/tests/support/commands.ts b/packages/arb-token-bridge-ui/tests/support/commands.ts index f6fe7efa28..b90e414219 100644 --- a/packages/arb-token-bridge-ui/tests/support/commands.ts +++ b/packages/arb-token-bridge-ui/tests/support/commands.ts @@ -222,11 +222,17 @@ export function findMoveFundsButton(): Cypress.Chainable> { .should('be.visible') } -export function startTransfer() { +export function startTransfer({ + confirmMetamaskTransaction = true +}: { + confirmMetamaskTransaction?: boolean +}) { cy.wait(5_000) cy.findMoveFundsButton().click() cy.wait(15_000) - cy.confirmMetamaskTransaction() + if (confirmMetamaskTransaction) { + cy.confirmMetamaskTransaction() + } } export function findSelectTokenButton( From f3b1923ed53fb3907aaf6aa0cfbb8c9536615ea8 Mon Sep 17 00:00:00 2001 From: Bartek Date: Fri, 20 Dec 2024 11:04:52 +0100 Subject: [PATCH 4/7] fixes --- .../arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts | 4 ++-- .../tests/e2e/specs/withdrawNativeToken.cy.ts | 4 ++-- packages/arb-token-bridge-ui/tests/support/commands.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts index 6eb9929e57..418d1d599f 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts @@ -103,7 +103,7 @@ describe('Withdraw ERC20 Token', () => { }) context('should show clickable withdraw button', () => { - cy.startTransfer({ confirmMetamaskTransaction: false }) + cy.startTransfer({ shouldConfirmInMetamask: false }) }) context('should withdraw successfully', () => { @@ -218,7 +218,7 @@ describe('Withdraw ERC20 Token', () => { }) context('should show clickable withdraw button', () => { - cy.startTransfer({ confirmMetamaskTransaction: false }) + cy.startTransfer({ shouldConfirmInMetamask: false }) }) context('should initiate withdrawal successfully', () => { diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts index c8524f2717..75eff3d9f3 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawNativeToken.cy.ts @@ -61,7 +61,7 @@ describe('Withdraw native token', () => { ETHToWithdraw = Number((Math.random() * 0.001).toFixed(5)) // generate a new withdrawal amount for each test-run attempt so that findAllByText doesn't stall coz of prev transactions cy.login({ networkType: 'childChain' }) cy.typeAmount(ETHToWithdraw) - cy.startTransfer({ confirmMetamaskTransaction: false }) + cy.startTransfer({ shouldConfirmInMetamask: false }) cy.findByText(/Arbitrum’s bridge/i).should('be.visible') // the Continue withdrawal button should be disabled at first @@ -146,7 +146,7 @@ describe('Withdraw native token', () => { cy.typeAmount(ETHToWithdraw) cy.fillCustomDestinationAddress() - cy.startTransfer({ confirmMetamaskTransaction: false }) + cy.startTransfer({ shouldConfirmInMetamask: false }) cy.findByText(/Arbitrum’s bridge/i).should('be.visible') // the Continue withdrawal button should be disabled at first diff --git a/packages/arb-token-bridge-ui/tests/support/commands.ts b/packages/arb-token-bridge-ui/tests/support/commands.ts index b90e414219..22c3e32a88 100644 --- a/packages/arb-token-bridge-ui/tests/support/commands.ts +++ b/packages/arb-token-bridge-ui/tests/support/commands.ts @@ -223,14 +223,14 @@ export function findMoveFundsButton(): Cypress.Chainable> { } export function startTransfer({ - confirmMetamaskTransaction = true + shouldConfirmInMetamask = true }: { - confirmMetamaskTransaction?: boolean + shouldConfirmInMetamask?: boolean }) { cy.wait(5_000) cy.findMoveFundsButton().click() cy.wait(15_000) - if (confirmMetamaskTransaction) { + if (shouldConfirmInMetamask) { cy.confirmMetamaskTransaction() } } From 5f2f55359ff61cb35b9e254f4b8c7c6fa9669fb9 Mon Sep 17 00:00:00 2001 From: Bartek Date: Fri, 20 Dec 2024 11:30:54 +0100 Subject: [PATCH 5/7] fix --- packages/arb-token-bridge-ui/tests/support/commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/arb-token-bridge-ui/tests/support/commands.ts b/packages/arb-token-bridge-ui/tests/support/commands.ts index 22c3e32a88..904770b3a4 100644 --- a/packages/arb-token-bridge-ui/tests/support/commands.ts +++ b/packages/arb-token-bridge-ui/tests/support/commands.ts @@ -226,7 +226,7 @@ export function startTransfer({ shouldConfirmInMetamask = true }: { shouldConfirmInMetamask?: boolean -}) { +} = {}) { cy.wait(5_000) cy.findMoveFundsButton().click() cy.wait(15_000) From ea71552d9b4fcaa4b26190825fc98158ad960355 Mon Sep 17 00:00:00 2001 From: Bartek Date: Fri, 20 Dec 2024 12:12:39 +0100 Subject: [PATCH 6/7] fixes --- .../tests/e2e/specs/batchDeposit.cy.ts | 12 ++--------- .../tests/e2e/specs/depositERC20.cy.ts | 20 ++++++------------- .../tests/support/commands.ts | 17 ++++++++++------ 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts index 2848a898e9..d0c665a9b2 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts @@ -141,11 +141,7 @@ describe('Batch Deposit', () => { context('deposit should complete successfully', () => { cy.selectTransactionsPanelTab('settled') - cy.waitUntil(() => cy.findTransactionInTransactionHistory(txData), { - errorMsg: 'Could not find settled ERC20 Batch Deposit transaction', - timeout: 120_000, - interval: 500 - }) + cy.findTransactionInTransactionHistory(txData) cy.findTransactionInTransactionHistory({ duration: 'a few seconds ago', @@ -251,11 +247,7 @@ describe('Batch Deposit', () => { context('deposit should complete successfully', () => { cy.selectTransactionsPanelTab('settled') - cy.waitUntil(() => cy.findTransactionInTransactionHistory(txData), { - errorMsg: 'Could not find settled ERC20 Batch Deposit transaction', - timeout: 120_000, - interval: 500 - }) + cy.findTransactionInTransactionHistory(txData) cy.findTransactionInTransactionHistory({ duration: 'a few seconds ago', diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts index 970c934803..0fa61b6b12 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/depositERC20.cy.ts @@ -150,20 +150,12 @@ describe('Deposit Token', () => { // switch to settled transactions cy.selectTransactionsPanelTab('settled') - //wait for some time for tx to go through and find the new amount in settled transactions - cy.waitUntil( - () => - cy.findTransactionInTransactionHistory({ - duration: 'a few seconds ago', - amount: ERC20AmountToSend, - symbol: testCase.symbol - }), - { - errorMsg: 'Could not find settled ERC20 Deposit transaction', - timeout: 120_000, - interval: 500 - } - ) + cy.findTransactionInTransactionHistory({ + duration: 'a few seconds ago', + amount: ERC20AmountToSend, + symbol: testCase.symbol + }) + // open the tx details popup const txData = { amount: ERC20AmountToSend, diff --git a/packages/arb-token-bridge-ui/tests/support/commands.ts b/packages/arb-token-bridge-ui/tests/support/commands.ts index 904770b3a4..ae5a6c0706 100644 --- a/packages/arb-token-bridge-ui/tests/support/commands.ts +++ b/packages/arb-token-bridge-ui/tests/support/commands.ts @@ -310,6 +310,8 @@ export function findTransactionInTransactionHistory({ amount2?: number duration?: string }) { + const timeout = 120_000 + // Replace . with \. const parsedAmount = amount.toString().replace(/\./g, '\\.') @@ -319,15 +321,18 @@ export function findTransactionInTransactionHistory({ }` ) - cy.findByTestId(rowId).as('row') + cy.findByTestId(rowId, { timeout }).as('row') if (duration) { - cy.get('@row').findAllByText(duration).first().should('be.visible') + cy.get('@row', { timeout }) + .findAllByText(duration, { timeout }) + .first() + .should('be.visible', { timeout }) } - cy.get('@row') - .findByLabelText('Transaction details button') - .should('be.visible') - return cy.get('@row') + cy.get('@row', { timeout }) + .findByLabelText('Transaction details button', { timeout }) + .should('be.visible', { timeout }) + return cy.get('@row', { timeout }) } export function findClaimButton( From de5c44dd4d4f39a24ceb58583dfe2fb8fc9953fe Mon Sep 17 00:00:00 2001 From: Bartek Date: Fri, 20 Dec 2024 12:44:47 +0100 Subject: [PATCH 7/7] fix --- .../tests/e2e/specs/batchDeposit.cy.ts | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts index d0c665a9b2..430e2b5c0f 100644 --- a/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts +++ b/packages/arb-token-bridge-ui/tests/e2e/specs/batchDeposit.cy.ts @@ -152,23 +152,29 @@ describe('Batch Deposit', () => { context('funds should reach destination account successfully', () => { // should have more funds on destination chain - cy.findByLabelText(`${ERC20TokenSymbol} balance amount on childChain`) - .invoke('text') - .then(parseFloat) - .should('be.gt', Number(parentErc20Balance)) - cy.findByLabelText(`${nativeTokenSymbol} balance amount on childChain`) - .invoke('text') - .then(parseFloat) - .should( - 'be.gt', + cy.findByLabelText( + `${ERC20TokenSymbol} balance amount on childChain` + ).should($el => { + const currentBalance = parseFloat($el.text()) + expect(currentBalance).to.be.gt(Number(parentErc20Balance)) + }) + + cy.findByLabelText( + `${nativeTokenSymbol} balance amount on childChain` + ).should($el => { + const currentBalance = parseFloat($el.text()) + expect(currentBalance).to.be.gt( Number(parentNativeTokenBalance) + nativeCurrencyAmountToSend ) + }) // the balance on the source chain should not be the same as before - cy.findByLabelText(`${ERC20TokenSymbol} balance amount on parentChain`) - .invoke('text') - .then(parseFloat) - .should('be.lt', Number(parentErc20Balance)) + cy.findByLabelText( + `${ERC20TokenSymbol} balance amount on parentChain` + ).should($el => { + const currentBalance = parseFloat($el.text()) + expect(currentBalance).to.be.lt(Number(parentErc20Balance)) + }) }) context('transfer panel amount should be reset', () => {