Skip to content

Setting defaultCommandTimeout in cypress.json is not appliedΒ #19

Closed
@adrians5j

Description

@adrians5j
  • cypress-testing-library version: 2.3.1
  • node version: 9.0.0
  • npm (or yarn) version: 1.10.1

Relevant code or config

        cy.visit("/")
            .getByTestId("signUpButton", {timeout: 6000})

What you did:
I wanted to select a few elements, with a longer timeout. After a few selects, I figured it would be just easier to set the default command timeout in cypress.json, so I don't have to set this every time I call getBy... methods. So I went to cypress.json and put "defaultCommandTimeout": 6000.

What happened:
The default 6000ms command timeout wasn't applied.

Suggested solution:
I guess we should modify the defaults object (https://github.com/kentcdodds/cypress-testing-library/blob/master/src/index.js#L5):

var defaults = {
  timeout: Cypress.config().defaultCommandTimeout
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions