]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | import { $ } from 'protractor'; |
2 | import { ConfigurationPageHelper } from './configuration.po'; | |
11fdf7f2 TL |
3 | |
4 | describe('Configuration page', () => { | |
9f95a23c | 5 | let configuration: ConfigurationPageHelper; |
11fdf7f2 TL |
6 | |
7 | beforeAll(() => { | |
9f95a23c | 8 | configuration = new ConfigurationPageHelper(); |
11fdf7f2 TL |
9 | }); |
10 | ||
9f95a23c TL |
11 | afterEach(async () => { |
12 | await ConfigurationPageHelper.checkConsole(); | |
11fdf7f2 TL |
13 | }); |
14 | ||
9f95a23c TL |
15 | describe('breadcrumb test', () => { |
16 | beforeAll(async () => { | |
17 | await configuration.navigateTo(); | |
18 | }); | |
19 | ||
20 | it('should open and show breadcrumb', async () => { | |
21 | await configuration.waitTextToBePresent(configuration.getBreadcrumb(), 'Configuration'); | |
22 | }); | |
23 | }); | |
24 | ||
25 | describe('fields check', () => { | |
26 | beforeAll(async () => { | |
27 | await configuration.navigateTo(); | |
28 | }); | |
29 | ||
30 | it('should verify that selected footer increases when an entry is clicked', async () => { | |
31 | await configuration.getFirstCell().click(); | |
32 | const selectedCount = await configuration.getTableSelectedCount(); | |
33 | await expect(selectedCount).toBe(1); | |
34 | }); | |
35 | ||
36 | it('should check that details table opens and tab is correct', async () => { | |
37 | await configuration.getFirstCell().click(); | |
38 | await expect($('.table.table-striped.table-bordered').isDisplayed()); | |
39 | await expect(configuration.getTabsCount()).toEqual(1); | |
40 | await expect(configuration.getTabText(0)).toEqual('Details'); | |
41 | }); | |
42 | }); | |
43 | ||
44 | describe('edit configuration test', () => { | |
45 | const configName = 'client_cache_size'; | |
46 | ||
47 | beforeAll(async () => { | |
48 | await configuration.navigateTo(); | |
49 | }); | |
50 | ||
51 | beforeEach(async () => { | |
52 | await configuration.clearTableSearchInput(); | |
53 | }); | |
54 | ||
55 | afterAll(async () => { | |
56 | await configuration.configClear(configName); | |
57 | }); | |
58 | ||
59 | it('should click and edit a configuration and results should appear in the table', async () => { | |
60 | await configuration.edit( | |
61 | configName, | |
62 | ['global', '1'], | |
63 | ['mon', '2'], | |
64 | ['mgr', '3'], | |
65 | ['osd', '4'], | |
66 | ['mds', '5'], | |
67 | ['client', '6'] | |
68 | ); | |
69 | }); | |
70 | ||
71 | it('should show only modified configurations', async () => { | |
72 | await configuration.filterTable('Modified', 'yes'); | |
73 | expect(await configuration.getTableFoundCount()).toBe(1); | |
74 | }); | |
75 | ||
76 | it('should hide all modified configurations', async () => { | |
77 | await configuration.filterTable('Modified', 'no'); | |
78 | expect(await configuration.getTableFoundCount()).toBeGreaterThan(1); | |
79 | }); | |
11fdf7f2 TL |
80 | }); |
81 | }); |