-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42132 from rhcs-dashboard/review-page-e2e
mgr/dashboard: "Create Cluster" workflow (review page e2e)
- Loading branch information
Showing
3 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/create-cluster-review.po.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
...d/frontend/cypress/integration/orchestrator/workflow/08-create-cluster-review.e2e-spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); | ||
}); |