Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to the "@qavajs/steps-playwright" will be documented in this

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.0.24]
- :rocket: added _I open new tab_
-
## [0.0.23]
- :rocket: added types to global members
- :rocket: added _I switch to 'IFrame' frame_
Expand Down
7 changes: 7 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,10 @@ When('I drag and drop {string} to {string}', async function (elementAlias, targe
await element.dragTo(target);
});

/**
* Open new browser tab
* @example I open new tab
*/
When('I open new tab', async function () {
await page.evaluate(() => { window.open('about:blank', '_blank') });
});
9 changes: 9 additions & 0 deletions test-e2e/features/actions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,12 @@ Feature: actions
Scenario: expect text of alert
When I click "Prompt Button"
Then I expect text of alert to be equal 'Are you robot?'

Scenario: open new tab
When I open new tab
And I switch to 2 window
And I open '$valuesPage' url
Then I expect current url to contain 'values.html'
When I switch to 1 window
Then I expect current url to contain 'actions.html'