Skip to content

Commit

Permalink
add tick to some test to wait for menus
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Aug 8, 2024
1 parent 2e79eeb commit 6180bf5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,23 @@ describe('Notification Drawer Basic Demo Test', () => {
// press Enter on toggle button, check whether the dropdown menu exsit and whether it focuses on the first item
// then press Tab on toggle button, check whether the dropdown menu is closed
cy.get('#toggle-id-0').then((toggleButton: JQuery<HTMLButtonElement>) => {
cy.clock();
cy.wrap(toggleButton).type(' ', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-0.pf-v6-c-menu').should('exist');
cy.wrap(toggleButton).type('{esc}', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-0.pf-v6-c-menu').should('not.exist');
});
// Verify the list item header toggle button keyboard interactivity opens/closes dropdown menu
// the method is the same as above
cy.get('#toggle-id-1').then((toggleButton: JQuery<HTMLButtonElement>) => {
cy.clock();
cy.wrap(toggleButton).type(' ', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-1.pf-v6-c-menu').should('exist');
cy.wrap(toggleButton).type('{esc}', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-1.pf-v6-c-menu').should('not.exist');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ describe('Notification Drawer Groups Demo Test', () => {
// press Enter on toggle button, check whether the dropdown menu exsit and whether it focuses on the first item
// then press Tab on toggle button, check whether the dropdown menu is closed
cy.get('#toggle-id-0').then((toggleButton: JQuery<HTMLButtonElement>) => {
cy.clock();
cy.wrap(toggleButton).type('{enter}', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-0.pf-v6-c-menu').should('exist');
cy.wrap(toggleButton).type('{esc}', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-0.pf-v6-c-menu').should('not.exist');
});
// Verify the group header keyboard interactivity opens/closes the whole group
Expand All @@ -69,9 +72,12 @@ describe('Notification Drawer Groups Demo Test', () => {
cy.get('.pf-v6-c-notification-drawer__group').first().should('not.have.class', 'pf-m-expanded');
// Verify the list item header toggle button keyboard interactivity opens/closes dropdown menu
cy.get('#toggle-id-9').then((toggleButton: JQuery<HTMLButtonElement>) => {
cy.clock();
cy.wrap(toggleButton).type('{enter}', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-9.pf-v6-c-menu').should('exist');
cy.wrap(toggleButton).type('{esc}', { waitForAnimations: true });
cy.tick(200);
cy.get('.notification-9.pf-v6-c-menu').should('not.exist');
});
});
Expand Down

0 comments on commit 6180bf5

Please sign in to comment.