]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/create-cluster.po.ts
import ceph 16.2.7
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / cluster / create-cluster.po.ts
1 import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
2 import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
3 import { PageHelper } from 'cypress/integration/page-helper.po';
4 import { NotificationSidebarPageHelper } from 'cypress/integration/ui/notification.po';
5
6 const pages = {
7 index: { url: '#/expand-cluster', id: 'cd-create-cluster' }
8 };
9 export class CreateClusterWizardHelper extends PageHelper {
10 pages = pages;
11
12 createCluster() {
13 cy.get('cd-create-cluster').should('contain.text', 'Please expand your cluster first');
14 cy.get('[name=expand-cluster]').click();
15 cy.get('cd-wizard').should('exist');
16 }
17
18 doSkip() {
19 cy.get('[name=skip-cluster-creation]').click();
20 cy.contains('cd-modal button', 'Continue').click();
21
22 cy.get('cd-dashboard').should('exist');
23 const notification = new NotificationSidebarPageHelper();
24 notification.open();
25 notification.getNotifications().should('contain', 'Cluster expansion skipped by user');
26 }
27
28 createOSD(deviceType: 'hdd' | 'ssd') {
29 // Click Primary devices Add button
30 cy.get('cd-osd-devices-selection-groups[name="Primary"]').as('primaryGroups');
31 cy.get('@primaryGroups').find('button').click();
32
33 // Select all devices with `deviceType`
34 cy.get('cd-osd-devices-selection-modal').within(() => {
35 cy.get('.modal-footer .tc_submitButton').as('addButton').should('be.disabled');
36 this.filterTable('Type', deviceType);
37 this.getTableCount('total').should('be.gte', 1);
38 cy.get('@addButton').click();
39 });
40 }
41 }
42
43 export class CreateClusterHostPageHelper extends HostsPageHelper {
44 pages = {
45 index: { url: '#/expand-cluster', id: 'cd-wizard' },
46 add: { url: '', id: 'cd-host-form' }
47 };
48
49 columnIndex = {
50 hostname: 1,
51 labels: 2,
52 status: 3,
53 services: 0
54 };
55 }
56
57 export class CreateClusterServicePageHelper extends ServicesPageHelper {
58 pages = {
59 index: { url: '#/expand-cluster', id: 'cd-wizard' },
60 create: { url: '', id: 'cd-service-form' }
61 };
62
63 columnIndex = {
64 service_name: 1,
65 placement: 2,
66 running: 0,
67 size: 0,
68 last_refresh: 0
69 };
70 }