test(governance): add timeout and fix withdrawal test (#4554)

This commit is contained in:
Joe Tsang 2023-08-16 16:53:24 +01:00 committed by GitHub
parent c937a9df0c
commit 6616aceebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 17 deletions

View File

@ -20,7 +20,7 @@ jobs:
project: ${{ fromJSON(inputs.projects) }} project: ${{ fromJSON(inputs.projects) }}
name: ${{ matrix.project }} name: ${{ matrix.project }}
runs-on: self-hosted-runner runs-on: self-hosted-runner
timeout-minutes: 100 timeout-minutes: 120
steps: steps:
# Checks if skip cache was requested # Checks if skip cache was requested
- name: Set skip-nx-cache flag - name: Set skip-nx-cache flag

View File

@ -29,6 +29,7 @@ const toastPanel = 'toast-panel';
const toastClose = 'toast-close'; const toastClose = 'toast-close';
const withdrawalDialogContent = 'dialog-content'; const withdrawalDialogContent = 'dialog-content';
const toastCompleteWithdrawal = 'toast-complete-withdrawal'; const toastCompleteWithdrawal = 'toast-complete-withdrawal';
const scrollBar = '.ag-body-horizontal-scroll-viewport';
const usdtName = 'USDC (local)'; const usdtName = 'USDC (local)';
const usdcEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0'; const usdcEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0';
const usdcSymbol = 'tUSDC'; const usdcSymbol = 'tUSDC';
@ -199,11 +200,7 @@ context(
); );
cy.getByTestId(toastClose).click(); cy.getByTestId(toastClose).click();
}); });
cy.get(tableTxHash) cy.get("[row-id='0']").within(() => {
.eq(1)
.should('have.text', 'Complete withdrawal')
.parent()
.within(() => {
cy.get(tableAssetSymbol).should('have.text', usdcSymbol); cy.get(tableAssetSymbol).should('have.text', usdcSymbol);
cy.get(tableAmount).should('have.text', '110.00'); cy.get(tableAmount).should('have.text', '110.00');
cy.get(tableReceiverAddress) cy.get(tableReceiverAddress)
@ -213,6 +210,7 @@ context(
cy.get(tableCreatedTimeStamp).should('not.be.empty'); cy.get(tableCreatedTimeStamp).should('not.be.empty');
}); });
ethereumWalletConnect(); ethereumWalletConnect();
cy.get(scrollBar).scrollTo('right');
cy.getByTestId(completeWithdrawalButton).first().click(); cy.getByTestId(completeWithdrawalButton).first().click();
cy.getByTestId(toast) cy.getByTestId(toast)
.last(txTimeout) .last(txTimeout)

View File

@ -84,9 +84,10 @@ export function stakingPageAssociateTokens(
.length .length
) { ) {
cy.get(tokenInputApprove, txTimeout).should('be.enabled').click(); cy.get(tokenInputApprove, txTimeout).should('be.enabled').click();
cy.contains('Approve $VEGA Tokens for staking on Vega').should( cy.contains(
'be.visible' 'Approve $VEGA Tokens for staking on Vega',
); txTimeout
).should('be.visible');
cy.contains( cy.contains(
'Approve $VEGA Tokens for staking on Vega', 'Approve $VEGA Tokens for staking on Vega',
txTimeout txTimeout