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',
13 'ceph-node-[01-02].cephlab.com'
15 const addHost = (hostname: string, exist?: boolean, pattern?: boolean) => {
16 cy.get('.btn.btn-accent').first().click({ force: true });
17 createClusterHostPage.add(hostname, exist, false);
19 createClusterHostPage.checkExist(hostname, true);
25 Cypress.Cookies.preserveOnce('token');
26 createCluster.navigateTo();
27 createCluster.createCluster();
30 it('should check if title contains Add Hosts', () => {
31 cy.get('.nav-link').should('contain.text', 'Add Hosts');
33 cy.get('.title').should('contain.text', 'Add Hosts');
36 it('should check existing host and add new hosts', () => {
37 createClusterHostPage.checkExist(hostnames[0], true);
39 addHost(hostnames[1], false);
40 addHost(hostnames[2], false);
41 createClusterHostPage.delete(hostnames[1]);
42 createClusterHostPage.delete(hostnames[2]);
43 addHost(hostnames[3], false, true);
46 it('should delete a host and add it back', () => {
47 createClusterHostPage.delete(hostnames[1]);
48 addHost(hostnames[1], false);
51 it('should verify "_no_schedule" label is added', () => {
52 createClusterHostPage.checkLabelExists(hostnames[1], ['_no_schedule'], true);
53 createClusterHostPage.checkLabelExists(hostnames[2], ['_no_schedule'], true);
56 it('should not add an existing host', () => {
57 cy.get('.btn.btn-accent').first().click({ force: true });
58 createClusterHostPage.add(hostnames[0], true);
61 it('should edit host labels', () => {
62 const labels = ['foo', 'bar'];
63 createClusterHostPage.editLabels(hostnames[0], labels, true);
64 createClusterHostPage.editLabels(hostnames[0], labels, false);