]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | import { OSDsPageHelper } from '../cluster/osds.po'; |
2 | import { DashboardPageHelper } from '../ui/dashboard.po'; | |
3 | ||
4 | describe('OSDs page', () => { | |
5 | const osds = new OSDsPageHelper(); | |
6 | const dashboard = new DashboardPageHelper(); | |
7 | ||
8 | beforeEach(() => { | |
9 | cy.login(); | |
10 | Cypress.Cookies.preserveOnce('token'); | |
11 | osds.navigateTo(); | |
12 | }); | |
13 | ||
14 | describe('when Orchestrator is available', () => { | |
15 | it('should create and delete OSDs', () => { | |
16 | osds.getTableCount('total').as('initOSDCount'); | |
17 | osds.navigateTo('create'); | |
18 | osds.create('hdd'); | |
19 | ||
20 | cy.get('@newOSDCount').then((newCount) => { | |
21 | cy.get('@initOSDCount').then((oldCount) => { | |
22 | const expectedCount = Number(oldCount) + Number(newCount); | |
23 | ||
24 | // check total rows | |
25 | osds.expectTableCount('total', expectedCount); | |
26 | ||
27 | // landing page is easier to check OSD status | |
28 | dashboard.navigateTo(); | |
29 | dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} total`); | |
30 | dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} up`); | |
31 | dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} in`); | |
32 | ||
33 | cy.wait(30000); | |
34 | expect(Number(newCount)).to.be.gte(2); | |
35 | // Delete the first OSD we created | |
36 | osds.navigateTo(); | |
37 | const deleteOsdId = Number(oldCount); | |
38 | osds.deleteByIDs([deleteOsdId], false); | |
39 | osds.ensureNoOsd(deleteOsdId); | |
40 | ||
41 | cy.wait(30000); | |
42 | // Replace the second OSD we created | |
43 | const replaceID = Number(oldCount) + 1; | |
44 | osds.deleteByIDs([replaceID], true); | |
45 | osds.checkStatus(replaceID, ['destroyed']); | |
46 | }); | |
47 | }); | |
48 | }); | |
49 | }); | |
50 | }); |