Check for 2dp on total staked (#308)

* Check for 2dp on total staked

* Update apps/explorer-e2e/src/support/pages/home-page.ts

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
This commit is contained in:
Joe Tsang 2022-04-28 15:36:42 +01:00 committed by GitHub
parent 8ebb2ee81c
commit de4c5499b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,8 +45,13 @@ export default class HomePage extends BasePage {
verifyStatsValuesdisplayed() {
cy.getByTestId(this.statsValue)
.each(($value) => {
.each(($value, index) => {
cy.wrap($value).should('not.be.empty');
if (index == 6) {
// Total staked value
const totalStakedRegex = /^[0-9]+(\.[0-9]{0,2})?$/;
cy.wrap($value).invoke('text').should('match', totalStakedRegex); // Check that value is number with 2dp
}
})
.then(($list) => {
cy.wrap($list).should('have.length', 18);