-
Notifications
You must be signed in to change notification settings - Fork 355
/
selectvalidated.spec.ts
23 lines (22 loc) · 1.18 KB
/
selectvalidated.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
describe('Select Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/select-validated-demo-nav-link');
});
it('Verify Validated Select', () => {
cy.get('#select-validated-demo .pf-c-select').should('not.have.class', 'pf-m-invalid');
cy.get('#select-validated-demo .pf-c-select').should('not.have.class', 'pf-m-success');
cy.get('#select-validated-demo .pf-c-select').should('not.have.class', 'pf-m-warning');
cy.get('#validated-select').click();
cy.get('#Miss > .pf-c-select__menu-item').click();
cy.get('#select-validated-demo .pf-c-select').should('have.class', 'pf-m-success');
cy.get('#validated-helper').contains('success');
cy.get('#validated-select').click();
cy.get('#Choose\\.\\.\\. > .pf-c-select__menu-item').click();
cy.get('#select-validated-demo .pf-c-select:first').should('have.class', 'pf-m-invalid');
cy.get('#validated-helper').contains('error');
cy.get('#validated-select').click();
cy.get('#Other > .pf-c-select__menu-item').click();
cy.get('#select-validated-demo .pf-c-select:first').should('have.class', 'pf-m-warning');
cy.get('#validated-helper').contains('warning');
});
});