Closed nemonemi closed 2 years ago
@testing-library/cypress
node
yarn
Relevant code or config
cy.findByText(/^certificate type$/i).should('be.visible');
What you did: Trying to assert that the element is visible.
Problem description: I have a form in which there is only one Material-UI textfield.
This is the output from the test:
Timed out retrying after 5000ms: Found multiple elements with the text of: /^certificate name$/i Here are the matching elements: Ignored nodes: comments, <script />, <style /> <input aria-describedby="name-helper-text" aria-invalid="false" class="MuiInputBase-input-hieRCO MuiFilledInput-input-gnEWXF gVXmpM gqxwhg MuiFilledInput-input MuiInputBase-input Mui-disabled MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedEnd" disabled="" id="name" name="name" type="text" value="Certificate name 6" /> Ignored nodes: comments, <script />, <style /> <span aria-label="Certificate name" class="" data-mui-internal-clone-element="true" > Certificate name </span>
Suggested solution: Only one element should be detected.
It basically detects and returns both the input and the span element that contains the label. This behavior is wrong.
input
span
@testing-library/cypress
version: "8.0.2",node
version: v16.14.0yarn
version: 3.0.2Relevant code or config
What you did: Trying to assert that the element is visible.
Problem description: I have a form in which there is only one Material-UI textfield.
This is the output from the test:
Suggested solution: Only one element should be detected.