Skip to content

Commit

Permalink
fix(percy): fix for percy false positives (#200)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

No related issue

### Description

This is another attempt to fix the false positives in percy snapshots.

### Changelog

**Changed**

- Add `cy.wait` before every percy snapshot
- Updated translation fixture to be the pre-transformed output
  • Loading branch information
jeffchew authored Feb 22, 2022
1 parent 3f0dd8f commit 2214d7f
Show file tree
Hide file tree
Showing 6 changed files with 1,585 additions and 1 deletion.
1,568 changes: 1,567 additions & 1 deletion tests/e2e/cypress/fixtures/translation.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tests/e2e/cypress/integration/example-page-a/example-page-a.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,17 @@ describe("Example page A page", () => {
});

it("should load the default example-page-a page", () => {
cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page a | default");
});

it("should load the masthead and megamenu", () => {
cy.get(".bx--header__menu-item").eq(0).click({ force: true });

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page a | megamenu opens");
});
Expand All @@ -141,6 +145,8 @@ describe("Example page A page", () => {

cy.get(".react-autosuggest__suggestions-list li").should("have.length", 10);

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page a | masthead search opens");
});
Expand All @@ -151,6 +157,8 @@ describe("Example page A page", () => {
});
cy.get(".bx--masthead__profile-item").should("have.length", 2);

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page a | profile options loading");
});
Expand Down Expand Up @@ -311,6 +319,8 @@ describe("Example page A page", () => {
expect(e.text()).to.equal("Mexico");
});

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page a | locale modale opened");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ describe("Example page B page", () => {
cy.waitUntil(() => cy.wrap($img).should("be.visible"));
});

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page b | default");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ describe("Example page C page", () => {
cy.waitUntil(() => cy.wrap($img).should("be.visible"));
});

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("example page c | default");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ describe("g100 theme example page", () => {
cy.waitUntil(() => cy.wrap($img).should("be.visible"));
});

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("g100-theme-example page | default");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe("White theme example page", () => {
.should("not.be.empty")
);

cy.wait(1000);

// Take a snapshot for visual diffing
cy.percySnapshot("white theme example | default");
});
Expand Down

0 comments on commit 2214d7f

Please sign in to comment.