Skip to content

Commit

Permalink
Merge pull request #42132 from rhcs-dashboard/review-page-e2e
Browse files Browse the repository at this point in the history
mgr/dashboard: "Create Cluster" workflow (review page e2e)
  • Loading branch information
alfonsomthd committed Jul 7, 2021
2 parents 0d36108 + b2efd90 commit 913ba09
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ export class CreateClusterWelcomePageHelper extends PageHelper {
createCluster() {
cy.get('cd-create-cluster').should('contain.text', 'Welcome to Ceph');
cy.get('[name=create-cluster]').click();

cy.get('cd-dashboard').should('exist');
const notification = new NotificationSidebarPageHelper();
notification.open();
notification.getNotifications().should('contain', 'Cluster creation feature not implemented');
}

doSkip() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { PageHelper } from '../page-helper.po';

export class CreateClusterReviewPageHelper extends PageHelper {
pages = {
index: { url: '#/create-cluster', id: 'cd-create-cluster-review' }
};

checkDefaultHostName() {
this.getTableCell(1, 'ceph-node-00.cephlab.com').should('exist');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { CreateClusterWelcomePageHelper } from 'cypress/integration/cluster/cluster-welcome-page.po';
import { CreateClusterReviewPageHelper } from 'cypress/integration/cluster/create-cluster-review.po';

describe('Create Cluster Review page', () => {
const reviewPage = new CreateClusterReviewPageHelper();
const createCluster = new CreateClusterWelcomePageHelper();

beforeEach(() => {
cy.login();
Cypress.Cookies.preserveOnce('token');
createCluster.navigateTo();
createCluster.createCluster();

cy.get('button[aria-label="Next"]').click();
});

describe('navigation link and title test', () => {
it('should check if nav-link and title contains Review', () => {
cy.get('.nav-link').should('contain.text', 'Review');

cy.get('.title').should('contain.text', 'Review');
});
});

describe('fields check', () => {
it('should check cluster resources table is present', () => {
// check for table header 'Status'
reviewPage.getLegends().its(0).should('have.text', 'Cluster Resources');

// check for fields in table
reviewPage.getStatusTables().should('contain.text', 'Hosts');
});

it('should check Hosts Per Label and Host Details tables are present', () => {
// check for there to be two tables
reviewPage.getDataTables().should('have.length', 2);

// check for table header 'Hosts Per Label'
reviewPage.getLegends().its(1).should('have.text', 'Hosts Per Label');

// check for table header 'Host Details'
reviewPage.getLegends().its(2).should('have.text', 'Host Details');

// verify correct columns on Hosts Per Label table
reviewPage.getDataTableHeaders(0).contains('Label');

reviewPage.getDataTableHeaders(0).contains('Number of Hosts');

// verify correct columns on Host Details table
reviewPage.getDataTableHeaders(1).contains('Host Name');

reviewPage.getDataTableHeaders(1).contains('Labels');
});

it('should check hosts count and default host name are present', () => {
reviewPage.getStatusTables().should('contain.text', '1');

reviewPage.checkDefaultHostName();
});
});
});

0 comments on commit 913ba09

Please sign in to comment.