From f5b752390e8e840b22f28beeb4f9ff46659dd8c8 Mon Sep 17 00:00:00 2001 From: Mike Woudenberg Date: Fri, 17 Nov 2017 15:54:35 +0100 Subject: [PATCH] Adds optional timeout config to 'then' method --- types/cypress/cypress-tests.ts | 3 ++- types/cypress/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/cypress/cypress-tests.ts b/types/cypress/cypress-tests.ts index ac987e757a..806443474a 100644 --- a/types/cypress/cypress-tests.ts +++ b/types/cypress/cypress-tests.ts @@ -15,7 +15,8 @@ cy cy .get('form') .find('input') - .then($input => $input.click()); + .then($input => $input.click()) + .then($input => $input.click(), {timeout: 12}); cy .wrap({ sum: (a: number, b: number, c: number) => a + b + c }) diff --git a/types/cypress/index.d.ts b/types/cypress/index.d.ts index e7f2a59447..808c765e24 100644 --- a/types/cypress/index.d.ts +++ b/types/cypress/index.d.ts @@ -369,7 +369,7 @@ declare namespace Cypress { /** * @see https://on.cypress.io/api/then */ - then(fn: (currentSubject: any) => any): Chainable; + then(fn: (currentSubject: any) => any, options?: Timeoutable): Chainable; /** * @see https://on.cypress.io/api/title