test(governance): flaky test fixes (#4760)

This commit is contained in:
Joe Tsang 2023-09-13 11:53:22 +01:00 committed by GitHub
parent c6df34fe95
commit 86da521da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -262,10 +262,10 @@ context(
'2'
);
waitForBeginningOfEpoch();
cy.getByTestId(stakeValidatorListStakePercentage).should(
'have.text',
'50.02%'
);
cy.getByTestId(
stakeValidatorListStakePercentage,
epochTimeout
).should('have.text', '50.02%');
navigateTo(navigation.validators);
validateValidatorListTotalStakeAndShare('0', '3,002.00', '50.02%');
}

View File

@ -170,21 +170,20 @@ export function clickOnValidatorFromList(
validatorName = null
) {
cy.contains('Loading...', epochTimeout).should('not.exist');
waitForBeginningOfEpoch();
// below is to ensure validator list is shown
cy.get(stakeValidatorListName, { timeout: 10000 }).should('exist');
cy.get(stakeValidatorListPendingStake, txTimeout).should(
'not.contain',
'2,000,000,000,000,000,000.00' // number due to bug #936
);
waitForBeginningOfEpoch();
if (validatorName) {
cy.contains(validatorName).click();
} else {
cy.get(`[row-id="${validatorNumber}"]`)
.should('be.visible')
.first()
.as('validatorOnList');
cy.get('@validatorOnList').click();
.click();
}
}
@ -196,6 +195,7 @@ export function validateValidatorListTotalStakeAndShare(
cy.contains('Loading...', epochTimeout).should('not.exist');
waitForBeginningOfEpoch();
cy.get(`[row-id="${positionOnList}"]`)
.should('have.length', 2)
.eq(1)
.within(() => {
cy.getByTestId(stakeValidatorListTotalStake, epochTimeout).should(