Reputation: 11
Is it possible to make a list of opened tabs? The case is:
In case that Cypress does not support multi-tabs. It would be good to have a list of the opened tabs. So I can navigate to them.
Upvotes: 1
Views: 904
Reputation: 6312
According to the official documentation, Cypress'll never have multi-tabs support. What you could do, however, for your test case is:
Check the links open in new tabs like so: cy.get('a[href="/index"]').should('have.attr', 'target', '_blank')
.
Visit the href
like so: cy.visit('/index.html')
.
Assert the visited page's content.
If you need inspiration, you could use this recipe for handling tabs & links.
Upvotes: 1