Skip to main content

Tab or Window asserts

I should have 1 open <tab|window>

Checks that only one tab or window is currently open. Reports an assertion error if not.

With custom assertion error message:

I should have 1 open <tab|window>  @Message("my custom assert fail message")

Example

  When I navigate to "https://todomvc.com/examples/react/dist"
Then I should have 1 open window
I should have <count> open <tab|window>s

Checks that a given number of tabs or windows are currently open. Reports an assertion error if not.

With custom assertion error message:

I should have <count> open <tab|window>s  @Message("my custom assert fail message")

Where

  • count the expected number of open tabs or windows

Example

  When I navigate to "https://todomvc.com/examples/react/dist"
And I start a browser for Vue
And I navigate to "https://todomvc.com/examples/vue"
Then I should have 2 open browsers