forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.spec.ts
More file actions
32 lines (31 loc) · 1.55 KB
/
page.spec.ts
File metadata and controls
32 lines (31 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
describe('Page Demo Test', () => {
it('Navigate to page section', () => {
cy.visit('http://localhost:3000/page-demo-nav-link');
});
it('Test Page elements', () => {
cy.get('#page-demo').within(() => {
cy.get('#nav-toggle').then((hamburgerIcon: JQuery<HTMLDivElement>) => {
cy.get('.pf-c-page__sidebar.pf-m-expanded').should('exist');
cy.get('.pf-c-page__sidebar.pf-m-collapsed').should('not.exist');
cy.wrap(hamburgerIcon).click();
cy.get('.pf-c-page__sidebar.pf-m-collapsed').should('exist');
cy.get('.pf-c-page__sidebar.pf-m-expanded').should('not.exist');
});
cy.get('#page-demo-header').should('not.have.attr', 'role');
cy.get('#page-demo-page-id').should('not.have.attr', 'role');
cy.get('div[class="pf-c-page__header-brand-link"]')
.invoke('text')
.should('eq', "Logo that's a <div>");
cy.get('.pf-c-page__main-section.pf-m-dark-100').should('exist');
cy.get('.pf-c-page__main-section.pf-m-dark-200').should('exist');
cy.get('.pf-c-page__main-section.pf-m-light').should('exist');
cy.get('.pf-c-page__main-section.pf-m-no-padding').should('exist');
cy.get('.pf-c-page__main-section.pf-m-no-padding-on-md').should('exist');
cy.get('.pf-c-page__header-tools-item[id="kebab-dropdown"]').should('have.class', 'pf-m-hidden-on-lg');
cy.get('.pf-c-page__header-tools-item[id="user-dropdown"]').should(
'have.class',
'pf-m-hidden pf-m-visible-on-md pf-m-visible-on-lg pf-m-visible-on-xl pf-m-visible-on-2xl'
);
});
});
});