I have got a print button, on click on the button display a print layout. How to interact with the 'print' layout using cypress. I would like to check few things here:
cypress version: 3.5.0 (latest)
1) Check the text "Print" available in `h1` inside the header container div, see image
2) Click on the `Cancel` button: please see the html image below
Below is my cypress test, but this failed to identify CypressError: Timed out retrying: Expected to find element: 'print-preview-app', but never found it.
context('Print button tests', () => {
it.only('Print action displays correct data', () => {
cy.get('.timetable-filter-panel-button.btn.btn-primary > span')
.contains("Print current view")
.click();
cy.get('print-preview-app').find('#sidebar').find('#header').find('#headerContainer').find('h1').contains("Print")
})
})