From 2e62bbb25f2de976fcabbf6d80bd352bf03ef182 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Fri, 4 Mar 2022 13:20:50 -0600 Subject: [PATCH] test: update screenshot system-tests flake so that it no longer compares images for uniqueness that represent the same state (#20463) --- .../driver/cypress/integration/commands/net_stubbing_spec.ts | 2 ++ system-tests/test/screenshots_spec.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/driver/cypress/integration/commands/net_stubbing_spec.ts b/packages/driver/cypress/integration/commands/net_stubbing_spec.ts index 27bc07da5802..60245c2bb6ee 100644 --- a/packages/driver/cypress/integration/commands/net_stubbing_spec.ts +++ b/packages/driver/cypress/integration/commands/net_stubbing_spec.ts @@ -11,6 +11,8 @@ const testFail = (cb, expectedDocsUrl = 'https://on.cypress.io/intercept') => { }) } +// Due to an issue with requests leaking between tests, we need to ensure that routes are unique from test to test +// See https://github.com/cypress-io/cypress/issues/20397 let routeCount = 0 const uniqueRoute = (route) => { routeCount += 1 diff --git a/system-tests/test/screenshots_spec.js b/system-tests/test/screenshots_spec.js index 8ba33b90a606..0d7e7751ed66 100644 --- a/system-tests/test/screenshots_spec.js +++ b/system-tests/test/screenshots_spec.js @@ -90,7 +90,9 @@ describe('e2e screenshots', () => { fs.statAsync(screenshot4).get('size'), fs.statAsync(screenshot5).get('size'), fs.statAsync(screenshot6).get('size'), - fs.statAsync(screenshot7).get('size'), + // Ignore comparing 6 and 7 since they can sometimes be the same since we take the screenshot as close to the failure as possible and + // the test run error may not have displayed yet. Leaving this commented in case we want to change this behavior in the future + // fs.statAsync(screenshot7).get('size'), fs.statAsync(screenshot8).get('size'), fs.statAsync(screenshot9).get('size'), ])