Skip to content

Commit 5ce9e4a

Browse files
Chore/UIDS-536 fullscreen before Percy snapshots (#538)
1 parent 7465f64 commit 5ce9e4a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cypress/support/commands.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe) => {
1919
});
2020

2121
Cypress.Commands.add('takePercySnapshot', (name) => {
22-
// Check for accessibility tests to finish first
2322
cy.get('body').should('contain', 'Tests completed');
23+
cy.get('body').type('f'); // Fullscreen component
2424

25-
// Also wait for the nav to load
26-
cy.get('body').should('contain', 'Components');
25+
// Close the storybook update popup if it is there
26+
cy.get('body').then((body) => {
27+
if (body.find('button[title="Dismiss notification"]').length > 0) {
28+
cy.get('button[title="Dismiss notification"]').click();
29+
}
30+
});
2731

2832
cy.percySnapshot(name);
33+
cy.get('body').type('f'); // Un-fullscreen component
2934
});

0 commit comments

Comments
 (0)