-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{feature} add isOpen variant to screen types
This makes it easier to write tests that span multiple pages, for example ```ts class ScreenOne extends ComponentHarness { static path = '/one'; #next = this.locatorFor('#next'); async goToNext() { await (await this.next()).click(); } } class ScreenTwo extends ComponentHarness { static async isOpen(page) { return page.url().endsWith('/two'); } } test('navigation', ({open}) => { const screenOne = await open(ScreenOne); await screenOne.goToNext(); const screenTwo = await open(ScreenTwo); // ... }); ``` Screens with a path or open function can also define an isOpen function. If that function is present and it yields a truthy result, then the open function will not be called or no navigation will be triggered to the path.
- Loading branch information
Showing
3 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
releases: | ||
"@ngx-playwright/test": patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters