Skip to content

Commit

Permalink
test(react): updating visual regression thresholds following baseline…
Browse files Browse the repository at this point in the history
… image regeneration

updating visual regression thresholds following baseline image regeneration
  • Loading branch information
MI6-286 committed Jan 31, 2025
1 parent f0e10c9 commit dd39936
Show file tree
Hide file tree
Showing 43 changed files with 688 additions and 692 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...react/cypress-image-diff-screenshots/baseline/IcSearchBar.cy.tsx-theme-dark.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from "react";
import { AGGridLight, AGGridDark } from "./AgGridWrapperTestData";
import { setThresholdBasedOnEnv } from "../../../cypress/utils/helpers";

const DEFAULT_TEST_THRESHOLD = 0;
const DEFAULT_TEST_THRESHOLD = 0.033;

describe("Visual regression and a11y tests", () => {
beforeEach(() => {
Expand All @@ -26,7 +26,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "ag-grid-light",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.003),
});
});

Expand Down
42 changes: 21 additions & 21 deletions packages/react/src/component-tests/IcAccordion/IcAccordion.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const IC_ACCORDION_GROUP = "ic-accordion-group";
const getAccordionSelector = (index: number) =>
`ic-accordion[heading="Accordion ${index}"]`;

const DEFAULT_TEST_THRESHOLD = 0.02;
const DEFAULT_TEST_THRESHOLD = 0.017;

describe("End-to-end tests", () => {
describe("IcAccordion", () => {
Expand Down Expand Up @@ -251,7 +251,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "heading-body",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.004),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
});
});

Expand All @@ -263,7 +263,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "expanded",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.007),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.004),
});
});

Expand All @@ -275,7 +275,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "icon",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.004),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
});
});

Expand All @@ -287,7 +287,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "disabled",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.02),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.009),
});
});

Expand All @@ -306,7 +306,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "focused",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.007),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.004),
});
});

Expand All @@ -318,7 +318,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "children",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.035),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.021),
});
});

Expand All @@ -330,7 +330,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "individual-sizes",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.017),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.012),
});
});

Expand Down Expand Up @@ -360,7 +360,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "group-title",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.026),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.018),
});
});

Expand All @@ -376,7 +376,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "single-expansion",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.023),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.016),
});
});

Expand All @@ -388,7 +388,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "group-sizes",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.051),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.036),
});
});

Expand All @@ -400,7 +400,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "slotted-heading",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.016),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.011),
});
});

Expand All @@ -412,7 +412,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "group-dark-theme",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.029),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.021),
});
});

Expand All @@ -424,7 +424,7 @@ describe("Visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "group-dark-theme-slotted",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.039),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.034),
});
});
});
Expand All @@ -451,7 +451,7 @@ describe("Visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "heading-body-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.005),
});
});

Expand All @@ -462,7 +462,7 @@ describe("Visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "expanded-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.002),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.007),
});
});

Expand All @@ -473,7 +473,7 @@ describe("Visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "disabled-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.014),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.02),
});
});

Expand All @@ -484,7 +484,7 @@ describe("Visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "children-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.026),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.033),
});
});

Expand All @@ -503,7 +503,7 @@ describe("Visual regression tests in high contrast mode", () => {
cy.wait(200);
cy.compareSnapshot({
name: "focused-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.007),
});
});
});
Expand All @@ -520,7 +520,7 @@ describe("Visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "single-expansion-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.018),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.022),
});
});

Expand All @@ -531,7 +531,7 @@ describe("Visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "group-sizes-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.047),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.054),
});
});
});
Expand Down
26 changes: 13 additions & 13 deletions packages/react/src/component-tests/IcAlert/IcAlert.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { IcAlert } from "../../components";

const ALERT_SELECTOR = "ic-alert";
const TYPOGRAPHY_SELECTOR = "ic-typography";
const DEFAULT_TEST_THRESHOLD = 0.026;
const DEFAULT_TEST_THRESHOLD = 0.018;

describe("IcAlert end-to-end tests", () => {
beforeEach(() => {
Expand Down Expand Up @@ -182,7 +182,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "variants",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.054),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.042),
});
});

Expand All @@ -195,7 +195,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "dismissible",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.001),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
});
});

Expand All @@ -208,7 +208,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "responsive",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.025),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.021),
});
});

Expand All @@ -221,7 +221,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "title-above-set",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.017),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.014),
});
});

Expand All @@ -234,7 +234,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "custom-message",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.012),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.01),
});
});

Expand Down Expand Up @@ -274,7 +274,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "no-icon",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.002),
});
});

Expand All @@ -300,7 +300,7 @@ describe("IcAlert visual regression and a11y tests", () => {
cy.checkA11yWithWait();
cy.compareSnapshot({
name: "theme-dark",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.005),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.04),
});
});
});
Expand Down Expand Up @@ -330,7 +330,7 @@ describe("IcAlert visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "variants-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.052),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.064),
});
});

Expand All @@ -342,7 +342,7 @@ describe("IcAlert visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "with-action-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.001),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.01),
});
});

Expand All @@ -354,7 +354,7 @@ describe("IcAlert visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "custom-message-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.012),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.023),
});
});

Expand All @@ -366,7 +366,7 @@ describe("IcAlert visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "dismissible-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.008),
});
});

Expand All @@ -378,7 +378,7 @@ describe("IcAlert visual regression tests in high contrast mode", () => {

cy.compareSnapshot({
name: "slotted-icon-high-contrast",
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.007),
testThreshold: setThresholdBasedOnEnv(DEFAULT_TEST_THRESHOLD + 0.016),
});
});
});
Loading

0 comments on commit dd39936

Please sign in to comment.