]>
Commit | Line | Data |
---|---|---|
9f95a23c | 1 | import { MonitorsPageHelper } from './monitors.po'; |
11fdf7f2 TL |
2 | |
3 | describe('Monitors page', () => { | |
9f95a23c | 4 | let monitors: MonitorsPageHelper; |
11fdf7f2 TL |
5 | |
6 | beforeAll(() => { | |
9f95a23c | 7 | monitors = new MonitorsPageHelper(); |
11fdf7f2 TL |
8 | }); |
9 | ||
9f95a23c TL |
10 | afterEach(async () => { |
11 | await MonitorsPageHelper.checkConsole(); | |
11fdf7f2 TL |
12 | }); |
13 | ||
9f95a23c TL |
14 | describe('breadcrumb test', () => { |
15 | beforeAll(async () => { | |
16 | await monitors.navigateTo(); | |
17 | }); | |
18 | ||
19 | it('should open and show breadcrumb', async () => { | |
20 | await monitors.waitTextToBePresent(monitors.getBreadcrumb(), 'Monitors'); | |
21 | }); | |
22 | }); | |
23 | ||
24 | describe('fields check', () => { | |
25 | beforeAll(async () => { | |
26 | await monitors.navigateTo(); | |
27 | }); | |
28 | ||
29 | it('should check status table is present', async () => { | |
30 | // check for table header 'Status' | |
31 | await expect( | |
32 | monitors | |
33 | .getLegends() | |
34 | .get(0) | |
35 | .getText() | |
36 | ).toMatch('Status'); | |
37 | ||
38 | // check for fields in table | |
39 | await expect(monitors.getStatusTables().getText()).toMatch('Cluster ID'); | |
40 | await expect(monitors.getStatusTables().getText()).toMatch('monmap modified'); | |
41 | await expect(monitors.getStatusTables().getText()).toMatch('monmap epoch'); | |
42 | await expect(monitors.getStatusTables().getText()).toMatch('quorum con'); | |
43 | await expect(monitors.getStatusTables().getText()).toMatch('quorum mon'); | |
44 | await expect(monitors.getStatusTables().getText()).toMatch('required con'); | |
45 | await expect(monitors.getStatusTables().getText()).toMatch('required mon'); | |
46 | }); | |
47 | ||
48 | it('should check In Quorum and Not In Quorum tables are present', async () => { | |
49 | // check for there to be two tables | |
50 | await expect(monitors.getDataTables().count()).toEqual(2); | |
51 | ||
52 | // check for table header 'In Quorum' | |
53 | await expect( | |
54 | monitors | |
55 | .getLegends() | |
56 | .get(1) | |
57 | .getText() | |
58 | ).toMatch('In Quorum'); | |
59 | ||
60 | // check for table header 'Not In Quorum' | |
61 | await expect( | |
62 | monitors | |
63 | .getLegends() | |
64 | .get(2) | |
65 | .getText() | |
66 | ).toMatch('Not In Quorum'); | |
67 | ||
68 | // verify correct columns on In Quorum table | |
69 | await expect( | |
70 | monitors | |
71 | .getDataTableHeaders() | |
72 | .get(0) | |
73 | .getText() | |
74 | ).toMatch('Name'); | |
75 | await expect( | |
76 | monitors | |
77 | .getDataTableHeaders() | |
78 | .get(0) | |
79 | .getText() | |
80 | ).toMatch('Rank'); | |
81 | await expect( | |
82 | monitors | |
83 | .getDataTableHeaders() | |
84 | .get(0) | |
85 | .getText() | |
86 | ).toMatch('Public Address'); | |
87 | await expect( | |
88 | monitors | |
89 | .getDataTableHeaders() | |
90 | .get(0) | |
91 | .getText() | |
92 | ).toMatch('Open Sessions'); | |
93 | ||
94 | // verify correct columns on Not In Quorum table | |
95 | await expect( | |
96 | monitors | |
97 | .getDataTableHeaders() | |
98 | .get(1) | |
99 | .getText() | |
100 | ).toMatch('Name'); | |
101 | await expect( | |
102 | monitors | |
103 | .getDataTableHeaders() | |
104 | .get(1) | |
105 | .getText() | |
106 | ).toMatch('Rank'); | |
107 | await expect( | |
108 | monitors | |
109 | .getDataTableHeaders() | |
110 | .get(1) | |
111 | .getText() | |
112 | ).toMatch('Public Address'); | |
113 | }); | |
11fdf7f2 TL |
114 | }); |
115 | }); |