-
Notifications
You must be signed in to change notification settings - Fork 339
/
validators.spec.ts
55 lines (48 loc) · 1.85 KB
/
validators.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { test } from '@playwright/test';
import { interceptRoutes, waitForMenuItemClick, waitForReady } from './common';
const validatorAddress = 'desmosvaloper17lca9smrdlwkznr92hypzrgsjkelnxeaacgrwq';
test('validators list page', async ({ page, isMobile }) => {
await interceptRoutes(page);
await page.goto(`.`);
await waitForReady(page);
await waitForMenuItemClick(
'ul > a.active[href="/validators"]',
page.getByRole('link', { name: 'Validators' }),
isMobile
);
// Test change validators tabs
await page.getByRole('tab', { name: 'Inactive' }).first().click();
await page.getByRole('tab', { name: 'All Validators' }).first().click();
await page.getByRole('tab', { name: 'Active' }).first().click();
if (!isMobile) {
// Test change validators order
await page.getByRole('button', { name: 'Validator' }).first().click();
await page.getByRole('button', { name: 'Voting Power' }).first().click();
await page.getByRole('button', { name: 'Commission' }).first().click();
}
// Test search for validator in the list
if (isMobile) {
await page
.locator(
`[placeholder="Search for validator / tx hash / block height / address / @dtag"]:visible`
)
.first()
.click();
await page
.locator(
`[placeholder="Search for validator / tx hash / block height / address / @dtag"]:visible`
)
.first()
.fill('Apollo');
await page
.locator(
`[placeholder="Search for validator / tx hash / block height / address / @dtag"]:visible`
)
.first()
.press('Enter');
} else {
await page.locator(`[placeholder="Search Validator"]:visible`).first().click();
await page.locator(`[placeholder="Search Validator"]:visible`).first().fill('Apollo');
await page.locator(`[placeholder="Search Validator"]:visible`).first().press('Enter');
}
});