I use Cypress and typescript. I ran into a problem.
The page has a form with a button and input fields.
Expected result: When you click the button, the input fields become available for editing.
Actual result: When you press the button with Cypress, nothing happens. There is also no expected result if I manually click on this button in the browser that opened Cypress. In a regular browser everything is ok.
Cypress does not see the input fields, I think this is expected, because if you click “Inspect” on an element, the <form></form>
element will be displayed in devtools. But at the same time, Cypress sees the button that is located in the same <form></form>
element (although nothing happens after clicking)
Tried searching for elements in the context of the form:
cy.get('#formID').find(PageSelectors.EditButton).click();
Also tried the option
{force: true}
UPD:Maybe the button is visible to cypress because it is in another div
<form id="formID" class="formClass" autocomplete="off" role="form" method="post" action="/endpoint/endpoint/endpoint">
<div class = 'divClass'
<button id="buttonID" type="button" class="btn btn-primary btn-sm">Text</button>
</div>
<div id="divID" class="form-fields readonly-input-space readonly-input-space-address" style="pointer-events:none">
</div>
</form>
1