I have problem with case where my page opens new window. I have case where I put some text in text creator and I wanna check in it preview if text exists. The preview opening in new tab so I have problem with handle it. URL to this preview is generated dynamically when I open text creator.
I have this link in XHR body. But I have no idea how can I copy from it.
I decided to copy url from XHRs body to .json file and in another test ill go to that link. Don't have any better idea to solve this case.
url of page is : app/6237/content/stories/49557/edit?journalId=2455
I tried
cy.server()
cy.route('GET', '/app').as('getApp')
cy.get('[name="pageselct"]').select('300');
cy.wait('@getApp').then(function(xhr){
const response = xhr.responseBody
expect(response[0]).to.have.property('title', 'Untitled')
})
and received CypressError: Timed out retrying: cy.wait() timed out waiting 5000ms for the 1st request to the route: 'getApp'. No request ever occurred.
I want to copy text from "preview_url". How can I access to this file? 49557 (its generated dynamically when I create new blog post).