From c8d55c6293422e4b009432a760980f53ba4c7a3b Mon Sep 17 00:00:00 2001 From: Joe Tsang <30622993+jtsang586@users.noreply.github.com> Date: Thu, 15 Jun 2023 09:15:52 +0100 Subject: [PATCH] chore(governance): fix for withdrawal tests (#4047) --- .../src/integration/flow/staking-flow.cy.ts | 2 ++ .../integration/flow/withdrawal-flow.cy.ts | 25 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/governance-e2e/src/integration/flow/staking-flow.cy.ts b/apps/governance-e2e/src/integration/flow/staking-flow.cy.ts index 21e757e69..a243b343b 100644 --- a/apps/governance-e2e/src/integration/flow/staking-flow.cy.ts +++ b/apps/governance-e2e/src/integration/flow/staking-flow.cy.ts @@ -381,6 +381,8 @@ context( it('Disassociating some tokens - prioritizes unstaked tokens', function () { vegaWalletSetSpecifiedApprovalAmount('1000'); + cy.reload(); + ethereumWalletConnect(); stakingPageAssociateTokens('3'); verifyUnstakedBalance(3.0); cy.get('button').contains('Select a validator to nominate').click(); diff --git a/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts b/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts index 588c7e463..493772a3a 100644 --- a/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts +++ b/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts @@ -69,7 +69,10 @@ context( it('Unable to submit withdrawal with invalid fields', function () { cy.getByTestId(withdraw).should('be.visible').click(); cy.getByTestId(withdrawalForm, txTimeout).within(() => { - cy.get('select').select(usdtSelectValue, { force: true }); + cy.getByTestId('select-asset').click(); + cy.get('select') + .select(usdtSelectValue, { force: true }) + .should('have.value', usdtSelectValue); cy.getByTestId(balanceAvailable, txTimeout).should('exist'); cy.getByTestId(submitWithdrawalButton).click(); cy.getByTestId(formValidationError).should('have.length', 1); @@ -93,7 +96,10 @@ context( // fill in withdrawal form cy.getByTestId(withdraw).should('be.visible').click(); cy.getByTestId(withdrawalForm, txTimeout).within(() => { - cy.get('select').select(usdtSelectValue, { force: true }); + cy.getByTestId('select-asset').click(); + cy.get('select') + .select(usdtSelectValue, { force: true }) + .should('have.value', usdtSelectValue); cy.getByTestId(balanceAvailable, txTimeout).should('exist'); cy.getByTestId(withdrawalThreshold).should( 'have.text', @@ -159,7 +165,10 @@ context( // fill in withdrawal form cy.getByTestId(withdraw).should('be.visible').click(); cy.getByTestId(withdrawalForm, txTimeout).within(() => { - cy.get('select').select(usdtSelectValue, { force: true }); + cy.getByTestId('select-asset').click(); + cy.get('select') + .select(usdtSelectValue, { force: true }) + .should('have.value', usdtSelectValue); cy.getByTestId(ethAddressInput).should('be.empty'); cy.getByTestId(amountInput).click().type('110'); cy.getByTestId(submitWithdrawalButton).click(); @@ -219,7 +228,10 @@ context( it('Should be able to see withdrawal details from toast', function () { cy.getByTestId(withdraw).click(); cy.getByTestId(withdrawalForm, txTimeout).within(() => { - cy.get('select').select(usdtSelectValue, { force: true }); + cy.getByTestId('select-asset').click(); + cy.get('select') + .select(usdtSelectValue, { force: true }) + .should('have.value', usdtSelectValue); cy.getByTestId(balanceAvailable, txTimeout).should('exist'); cy.getByTestId(withdrawalThreshold).should( 'have.text', @@ -274,7 +286,10 @@ context( cy.connectPublicKey(vegaWalletPubKey); cy.getByTestId(withdraw).should('be.visible').click(); cy.getByTestId(withdrawalForm, txTimeout).within(() => { - cy.get('select').select(usdtSelectValue, { force: true }); + cy.getByTestId('select-asset').click(); + cy.get('select') + .select(usdtSelectValue, { force: true }) + .should('have.value', usdtSelectValue); cy.getByTestId(balanceAvailable, txTimeout).should('exist'); cy.getByTestId(amountInput).click().type('100'); cy.pause();