From cfaf1ad82c15692d48d0d18ba8c53f8da15901e2 Mon Sep 17 00:00:00 2001 From: Kukhyeon Heo Date: Wed, 16 Dec 2020 15:56:16 +0900 Subject: [PATCH] feat: Add timeout period to retry error message (#9123) --- .../desktop-gui/cypress/fixtures/runs.json | 4 +-- .../commands/actions/trigger_spec.js | 2 +- .../integration/commands/assertions_spec.js | 2 +- .../integration/commands/connectors_spec.js | 36 +++++++++---------- .../integration/commands/files_spec.js | 6 ++-- .../commands/querying_shadow_dom_spec.js | 2 +- packages/driver/src/cy/retries.js | 4 ++- packages/driver/src/cypress/error_messages.js | 4 ++- .../integration/reporter.errors.spec.js | 16 ++++----- .../1_caught_uncaught_hook_errors_spec.js | 2 +- .../server/__snapshots__/3_config_spec.js | 2 +- .../__snapshots__/3_issue_173_spec.ts.js | 2 +- .../__snapshots__/5_spec_isolation_spec.js | 12 +++---- .../server/__snapshots__/5_stdout_spec.js | 4 +-- .../__snapshots__/6_web_security_spec.js | 2 +- packages/server/test/support/helpers/e2e.ts | 6 ++++ 16 files changed, 58 insertions(+), 48 deletions(-) diff --git a/packages/desktop-gui/cypress/fixtures/runs.json b/packages/desktop-gui/cypress/fixtures/runs.json index e1d196d12735..89ef5e449e7e 100644 --- a/packages/desktop-gui/cypress/fixtures/runs.json +++ b/packages/desktop-gui/cypress/fixtures/runs.json @@ -26,7 +26,7 @@ "failedTests": [ { "body": "function () {}", - "error": "Timed out retrying: cy.click() failed because this element is being covered by another element:", + "error": "Timed out retrying after 4000ms: cy.click() failed because this element is being covered by another element:", "id": "175e807c-ce85-5f94-938c-e2e30b090633", "instanceId": "d1609552-31b5-50c1-b307-c27c9553ccb8", "stack": "Error: Uncaught ReferenceError:\n at Object.$Cypress.Utils._.cypressErr (http://localhost:2020/__cypress/static/js/cypress.js:4678:15)\n at Object.$Cypress.Utils._.throwErr (http://localhost:2020/__cypress/static/js/cypress.js:4642:22)\n at Object.$Cypress.Utils._.throwErrByPath (http://localhost:2020/__cypress/static/js/cypress.js:4670:21)", @@ -53,7 +53,7 @@ }, { "body": "function () {}", - "error": "Timed out retrying: cy.click() failed because this element is being covered by another element:", + "error": "Timed out retrying after 4000ms: cy.click() failed because this element is being covered by another element:", "failedFromHookId": "h1", "id": "ef0d934e-a247-5e60-b801-3c5be5aa8796", "instanceId": "d1609552-31b5-50c1-b307-c27c9553ccb8", diff --git a/packages/driver/cypress/integration/commands/actions/trigger_spec.js b/packages/driver/cypress/integration/commands/actions/trigger_spec.js index f59fcf68e9e1..f6023e3cb872 100644 --- a/packages/driver/cypress/integration/commands/actions/trigger_spec.js +++ b/packages/driver/cypress/integration/commands/actions/trigger_spec.js @@ -1054,7 +1054,7 @@ describe('src/cy/commands/actions/trigger', () => { it('throws when provided invalid event type', function (done) { cy.on('fail', (err) => { expect(this.logs.length).to.eq(2) - expect(err.message).to.eq('Timed out retrying: `cy.trigger()` `eventConstructor` option must be a valid event (e.g. \'MouseEvent\', \'KeyboardEvent\'). You passed: `FooEvent`') + expect(err.message).to.eq('Timed out retrying after 100ms: `cy.trigger()` `eventConstructor` option must be a valid event (e.g. \'MouseEvent\', \'KeyboardEvent\'). You passed: `FooEvent`') done() }) diff --git a/packages/driver/cypress/integration/commands/assertions_spec.js b/packages/driver/cypress/integration/commands/assertions_spec.js index 767f681898de..d033082d55ce 100644 --- a/packages/driver/cypress/integration/commands/assertions_spec.js +++ b/packages/driver/cypress/integration/commands/assertions_spec.js @@ -490,7 +490,7 @@ describe('src/cy/commands/assertions', () => { it('throws when eventually times out', (done) => { cy.on('fail', (err) => { - expect(err.message).to.eq('Timed out retrying: expected \'