2 CreateClusterHostPageHelper,
3 CreateClusterWizardHelper
4 } from 'cypress/integration/cluster/create-cluster.po';
6 describe('Create cluster add host page', () => {
7 const createCluster = new CreateClusterWizardHelper();
8 const createClusterHostPage = new CreateClusterHostPageHelper();
10 'ceph-node-00.cephlab.com',
11 'ceph-node-01.cephlab.com',
12 'ceph-node-02.cephlab.com'
14 const addHost = (hostname: string, exist?: boolean) => {
15 cy.get('.btn.btn-accent').first().click({ force: true });
16 createClusterHostPage.add(hostname, exist, false);
17 createClusterHostPage.checkExist(hostname, true);
22 Cypress.Cookies.preserveOnce('token');
23 createCluster.navigateTo();
24 createCluster.createCluster();
27 it('should check if title contains Add Hosts', () => {
28 cy.get('.nav-link').should('contain.text', 'Add Hosts');
30 cy.get('.title').should('contain.text', 'Add Hosts');
33 it('should check existing host and add new hosts', () => {
34 createClusterHostPage.checkExist(hostnames[0], true);
36 addHost(hostnames[1], false);
37 addHost(hostnames[2], false);
40 it('should delete a host and add it back', () => {
41 createClusterHostPage.delete(hostnames[1]);
42 addHost(hostnames[1], false);
45 it('should verify "_no_schedule" label is added', () => {
46 createClusterHostPage.checkLabelExists(hostnames[1], ['_no_schedule'], true);
47 createClusterHostPage.checkLabelExists(hostnames[2], ['_no_schedule'], true);
50 it('should not add an existing host', () => {
51 cy.get('.btn.btn-accent').first().click({ force: true });
52 createClusterHostPage.add(hostnames[0], true);
55 it('should edit host labels', () => {
56 const labels = ['foo', 'bar'];
57 createClusterHostPage.editLabels(hostnames[0], labels, true);
58 createClusterHostPage.editLabels(hostnames[0], labels, false);