Skip to content

Commit 14357ee

Browse files
bug/UIDS-521 wait for accessibility tests (and navigation) before Percy snapshots (#523)
1 parent d1ca107 commit 14357ee

27 files changed

+40
-51
lines changed

cypress/integration/alert_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Alert', () => {
4444
cy.visit(test.path);
4545
const match = test.match ? test.match : test.name;
4646
cy.get('#storybook-preview-iframe').iframe().find(test.class).should('contain', match);
47-
cy.percySnapshot(test.path);
47+
cy.takePercySnapshot(test.path);
4848
});
4949
});
5050
});

cypress/integration/avatar_spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ describe('Avatar', () => {
2424
it(test.name, () => {
2525
cy.visit(test.path);
2626
cy.get('#storybook-preview-iframe').iframe().find(test.class).should('contain', test.match);
27-
cy.wait(1000);
28-
cy.percySnapshot(test.path);
27+
cy.takePercySnapshot(test.path);
2928
});
3029
});
3130

@@ -34,6 +33,6 @@ describe('Avatar', () => {
3433
cy.get('#storybook-preview-iframe').iframe().find('.Avatar__circle')
3534
.find('img')
3635
.should('be.visible');
37-
cy.percySnapshot('design-system-alert--with-image');
36+
cy.takePercySnapshot('design-system-alert--with-image');
3837
});
3938
});

cypress/integration/button_spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ describe('Button', () => {
2424
it(test.name, () => {
2525
cy.visit(test.path);
2626
cy.get('#storybook-preview-iframe').iframe().find(test.class).should('contain', test.match);
27-
cy.wait(1000);
28-
cy.percySnapshot(test.path);
27+
cy.takePercySnapshot(test.path);
2928
});
3029
});
3130
});

cypress/integration/card_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ describe('Card', () => {
33
cy.visit('design-system-card--default');
44
cy.get('#storybook-preview-iframe').iframe().find('.Card__title')
55
.should('contain', 'Large card with title');
6-
cy.percySnapshot('design-system-card--default');
6+
cy.takePercySnapshot('design-system-card--default');
77
});
88
});

cypress/integration/checkbox_button_spec.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@ describe('CheckboxButton', () => {
22
it('Default', () => {
33
cy.visit('design-system-checkboxbutton--default');
44
cy.get('#storybook-preview-iframe').iframe().find('.checkbox').should('exist');
5-
cy.wait(1000);
6-
cy.percySnapshot('design-system-checkboxbutton--default');
5+
cy.takePercySnapshot('design-system-checkboxbutton--default');
76
});
87

98
it('Indeterminate', () => {
109
cy.visit('design-system-checkboxbutton--indeterminate');
1110
cy.get('#storybook-preview-iframe').iframe().find('#select-all').should('exist');
12-
cy.wait(1000);
13-
cy.percySnapshot('design-system-checkboxbutton--indeterminate');
11+
cy.takePercySnapshot('design-system-checkboxbutton--indeterminate');
1412
});
1513

1614
it('With Description', () => {
1715
cy.visit('design-system-checkboxbutton--with-description');
1816
cy.get('#storybook-preview-iframe').iframe().find('.FormControlLabel__label')
1917
.should('contain', 'Label 2');
20-
cy.wait(1000);
21-
cy.percySnapshot('design-system-checkboxbutton--with-description');
18+
cy.takePercySnapshot('design-system-checkboxbutton--with-description');
2219
});
2320
});

cypress/integration/copy_to_clipboard_button_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ describe('Copy to Clipboard Button', () => {
22
it('Default', () => {
33
cy.visit('design-system-copy-to-clipboard-button--default');
44
cy.get('#storybook-preview-iframe').iframe().find('.CopyToClipboardButton').should('exist');
5-
cy.percySnapshot('design-system-copy-to-clipboard-button--default');
5+
cy.takePercySnapshot('design-system-copy-to-clipboard-button--default');
66
});
77

88
it('Secondary', () => {
99
cy.visit('design-system-copy-to-clipboard-button--secondary');
1010
cy.get('#storybook-preview-iframe').iframe().find('.CopyToClipboardButton').should('exist');
11-
cy.percySnapshot('design-system-copy-to-clipboard-button--secondary');
11+
cy.takePercySnapshot('design-system-copy-to-clipboard-button--secondary');
1212
});
1313
});

cypress/integration/copy_to_clipboard_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ describe('Copy to Clipboard', () => {
22
it('Default', () => {
33
cy.visit('design-system-copy-to-clipboard--default');
44
cy.get('#storybook-preview-iframe').iframe().find('.CopyToClipboard').should('exist');
5-
cy.percySnapshot('design-system-copy-to-clipboard--default');
5+
cy.takePercySnapshot('design-system-copy-to-clipboard--default');
66
});
77
});

cypress/integration/dropdown_spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ describe('Dropdown', () => {
2121
it(test.name, () => {
2222
cy.visit(test.path);
2323
cy.get('#storybook-preview-iframe').iframe().find(test.class).should('exist');
24-
cy.wait(1000);
25-
cy.percySnapshot(test.path);
24+
cy.takePercySnapshot(test.path);
2625
});
2726
});
2827
});

cypress/integration/form_elements/checkbox_button_group_spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ describe('Form Elements -> CheckboxButtonGroup', () => {
3131
it(test.name, () => {
3232
cy.visit(test.path);
3333
cy.get('#storybook-preview-iframe').iframe().find(test.class).should('contain', 'Label');
34-
cy.wait(1000);
35-
cy.percySnapshot(test.path);
34+
cy.takePercySnapshot(test.path);
3635
});
3736
});
3837
});

cypress/integration/form_elements/form_control_label_spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ describe('Form Elements -> Form Control Label', () => {
2626
it(test.name, () => {
2727
cy.visit(test.path);
2828
cy.get('#storybook-preview-iframe').iframe().find(test.class).should('contain', 'Label');
29-
cy.wait(1000);
30-
cy.percySnapshot(test.path);
29+
cy.takePercySnapshot(test.path);
3130
});
3231
});
3332
});

0 commit comments

Comments
 (0)