]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/osds.e2e-spec.ts
e68d03bd542b0a6708b2c474f1965a0bf227e261
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / cluster / osds.e2e-spec.ts
1 import { OSDsPageHelper } from './osds.po';
2
3 describe('OSDs page', () => {
4 const osds = new OSDsPageHelper();
5
6 beforeEach(() => {
7 cy.login();
8 Cypress.Cookies.preserveOnce('token');
9 osds.navigateTo();
10 });
11
12 describe('breadcrumb and tab tests', () => {
13 it('should open and show breadcrumb', () => {
14 osds.expectBreadcrumbText('OSDs');
15 });
16
17 it('should show two tabs', () => {
18 osds.getTabsCount().should('eq', 2);
19 osds.getTabText(0).should('eq', 'OSDs List');
20 osds.getTabText(1).should('eq', 'Overall Performance');
21 });
22 });
23
24 describe('check existence of fields on OSD page', () => {
25 it('should check that number of rows and count in footer match', () => {
26 osds.getTableCount('total').then((text) => {
27 osds.getTableRows().its('length').should('equal', text);
28 });
29 });
30
31 it('should verify that buttons exist', () => {
32 cy.contains('button', 'Create');
33 cy.contains('button', 'Cluster-wide configuration');
34 });
35
36 describe('by selecting one row in OSDs List', () => {
37 beforeEach(() => {
38 osds.getExpandCollapseElement().click();
39 });
40
41 it('should show the correct text for the tab labels', () => {
42 cy.get('#tabset-osd-details > li > a').then(($tabs) => {
43 const tabHeadings = $tabs.map((_i, e) => e.textContent).get();
44
45 expect(tabHeadings).to.eql([
46 'Devices',
47 'Attributes (OSD map)',
48 'Metadata',
49 'Device health',
50 'Performance counter',
51 'Performance Details'
52 ]);
53 });
54 });
55 });
56 });
57 });