Skip to content

Allow to change query timeout. #6

Closed
@npeterkamps

Description

@npeterkamps
  • cypress-testing-library version: 2.0.0
  • node version: 8.4.0
  • npm version: 5.3.0

Problem description:

Currently, the timeout for queries is hard-coded to 3000:
https://github.com/kentcdodds/cypress-testing-library/blob/master/src/index.js#L11

When I visit my app, it shows a loading indicator, which takes more than 3 seconds. I can add a cy.wait to make things work, but if the website gets faster, that wait just slows everything down. So I'd like to be able to configure the timeout as an option to the query functions.

Suggested solution:

Destructure the last option in the command function {timeout, ...args} and use it in waitForElement, like timeout: timeout || 3000.

I'll create a PR this weekend.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions