0

I found this: Access a new window - cypress.io

I think it is a begining of something that might solve my problem. Though, a it doesn't solve my problem entirely.

Summary:

I have to run cypress test on a webapp. This webapp behaves this way:

http://urlofwebsite:1234/blabla/token -> open a new window

New window is at http://urlofwebsite:1234/blabla/page

The thing is, if I do something like cy.visit("http://urlofwebsite:1234/blabla/page") doesn't work. It opens new window the same way it did in the previous case.

That's why, I want to get the instance of this new window to run my test.

I don't know if I've been clear enough. Don't hesitate to question me (except Why is it made that way, because I don't know, I didn't do it).

Thank you all!

Yoann Picquenot
  • 640
  • 10
  • 26

1 Answers1

0

I found a way of doing this using Dr Gleb Bahmutov's "Cypress using child window" blog post.

I've extended his original helper command with some additional utilities: https://github.com/jakedowns/CypressHelpers

These helpers allow you to: open a new window, switch between them & test between them, close your popup windows

jake downs
  • 331
  • 3
  • 9