In my cypress test I’m trying to store contents of id_px_file_input
-field and then use it a part of cy.contains()
cy.get('[id=id_px_file_input]').then(new_id => {
const tableID = new_id;
cy.wrap(tableID).as('tableID');
});
cy.contains('Hakemisto').click()
cy.wait(10000)
cy.contains(`U ${'@tableID'} -`).click()
cy.wait(10000)
Where the input looks like this:
<input type="text" name="px_file_input" value="13bu" class="form-control" placeholder="" maxlength="400" disabled="" id="id_px_file_input">
and ’13bu’ is the value I want to store in “variable” tableID
.
After clicking “Hakemisto” I want to test that the page contains an element with text U 13bu -
How can I do it ?