cypress-testing-library | 🐅 Simple and complete custom Cypress commands | Frontend Framework library
kandi X-RAY | cypress-testing-library Summary
kandi X-RAY | cypress-testing-library Summary
Simple and complete custom Cypress commands and utilities that encourage good testing practices. Read the docs | Edit the docs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a command .
- Filter input values .
- Query argument
- Gets the first element within the container .
- Gets the first jquery element .
- Configures and default TTL .
cypress-testing-library Key Features
cypress-testing-library Examples and Code Snippets
Community Discussions
Trending Discussions on cypress-testing-library
QUESTION
I'm using Cypress with Cypress Testing Library to test my React application.
I have an input with a name ('Steve') as its value and I'm trying to find it with cypress like this:
...ANSWER
Answered 2019-Mar-13 at 08:32I found the answer. getByText()
does not find values of .
getByDisplayValue()
does. I don't like that, because that makes it a little dependent on implementation details, but at least this fixes the tests.
QUESTION
Does Material-UI's Select component use a timeout or other time function then closing? I have been trying to find the implementation of the code and also tried debugging but I can't find an answer to this.
I need to know this due to an issue I ran in to when writing GUI-tests using the Cypress testing framework and its clock()-method on the Select component.
The clock method is used to override time-functions like date, setTimeout and clearTimeout (https://docs.cypress.io/api/commands/clock.html#Syntax).
When using this without specifying that I only want to override Date the Select component doesn't close as it should. The actual dropdown closes but the invisible backdrop div (#menu-.presentation) stays put thus hiding all the other components when cypress want to continue the test run.
Without the clock the test works fine apart from the date related errors that is expected. This lead me to think that the Select somehow uses a timeout, even though I have been unable to find any proof. I would really like to understand this behavior.
I'm not using the Native select.
The dependencies related have the following versions:
"@material-ui/core": "4.3.2"
"cypress": "3.2.0"
"cypress-testing-library": "2.4.0"
...ANSWER
Answered 2019-Nov-04 at 15:57Looking through the code is complicated by the number of different components involved, but if you dig through all of them, you will eventually find setTimeout
.
Select
uses SelectInputSelectInput
uses MenuMenu
uses PopoverPopover
uses Grow as its defaultTransitionComponent
.Grow
uses setTimeoutGrow
also usesTransition
fromreact-transition-group
which also uses setTimeout.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cypress-testing-library
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page