From: Nizamudeen A Date: Fri, 24 Dec 2021 05:39:37 +0000 (+0530) Subject: mgr/dashboard: dashboard cephadm e2e improvement X-Git-Tag: v17.1.0~162^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44398%2Fhead;p=ceph.git mgr/dashboard: dashboard cephadm e2e improvement Fixes: https://tracker.ceph.com/issues/53742 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts index aec174a99cdb..266983df155b 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts @@ -7,6 +7,12 @@ describe('Create cluster create services page', () => { const createCluster = new CreateClusterWizardHelper(); const createClusterServicePage = new CreateClusterServicePageHelper(); + const createService = (serviceType: string, serviceName: string, count?: string) => { + cy.get('.btn.btn-accent').first().click({ force: true }); + createClusterServicePage.addService(serviceType, false, count); + createClusterServicePage.checkExist(serviceName, true); + }; + beforeEach(() => { cy.login(); Cypress.Cookies.preserveOnce('token'); @@ -23,10 +29,13 @@ describe('Create cluster create services page', () => { const serviceName = 'rgw.foo'; it('should create an rgw service', () => { - cy.get('.btn.btn-accent').first().click({ force: true }); + createService('rgw', serviceName, '2'); + }); - createClusterServicePage.addService('rgw', false, '2'); - createClusterServicePage.checkExist(serviceName, true); + it('should delete the service and add it back', () => { + createClusterServicePage.deleteService(serviceName); + + createService('rgw', serviceName, '2'); }); it('should edit a service', () => { @@ -35,12 +44,8 @@ describe('Create cluster create services page', () => { createClusterServicePage.expectPlacementCount(serviceName, count); }); - it('should create and delete an ingress service', () => { - cy.get('.btn.btn-accent').first().click({ force: true }); - - createClusterServicePage.addService('ingress'); - createClusterServicePage.checkExist('ingress.rgw.foo', true); - createClusterServicePage.deleteService('ingress.rgw.foo'); + it('should create an ingress service', () => { + createService('ingress', 'ingress.rgw.foo', '2'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts index 46cd5fa19c9f..633d9733c99b 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts @@ -6,7 +6,15 @@ import { ServicesPageHelper } from 'cypress/integration/cluster/services.po'; describe('when cluster creation is completed', () => { const createCluster = new CreateClusterWizardHelper(); const services = new ServicesPageHelper(); + const hosts = new HostsPageHelper(); + const serviceName = 'rgw.foo'; + const hostnames = [ + 'ceph-node-00.cephlab.com', + 'ceph-node-01.cephlab.com', + 'ceph-node-02.cephlab.com', + 'ceph-node-03.cephlab.com' + ]; beforeEach(() => { cy.login(); @@ -23,14 +31,6 @@ describe('when cluster creation is completed', () => { }); describe('Hosts page', () => { - const hosts = new HostsPageHelper(); - const hostnames = [ - 'ceph-node-00.cephlab.com', - 'ceph-node-01.cephlab.com', - 'ceph-node-02.cephlab.com', - 'ceph-node-03.cephlab.com' - ]; - beforeEach(() => { hosts.navigateTo(); }); @@ -61,18 +61,6 @@ describe('when cluster creation is completed', () => { services.checkServiceStatus('rgw'); }); }); - - it('should drain, remove and add the host back', () => { - hosts.drain(hostnames[1]); - hosts.remove(hostnames[1]); - hosts.navigateTo('add'); - hosts.add(hostnames[1]); - hosts.checkExist(hostnames[1], true); - }); - - it('should force maintenance and exit', { retries: 1 }, () => { - hosts.maintenance(hostnames[3], true, true); - }); }); describe('OSDs page', () => { @@ -96,4 +84,22 @@ describe('when cluster creation is completed', () => { services.checkExist(serviceName, true); }); }); + + describe('Host actions', () => { + beforeEach(() => { + hosts.navigateTo(); + }); + + it('should force maintenance and exit', { retries: 1 }, () => { + hosts.maintenance(hostnames[3], true, true); + }); + + it('should drain, remove and add the host back', () => { + hosts.drain(hostnames[1]); + hosts.remove(hostnames[1]); + hosts.navigateTo('add'); + hosts.add(hostnames[1]); + hosts.checkExist(hostnames[1], true); + }); + }); });