Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): chainable
PageElements
(#1864)
This change enables `PageElements` to offer more advanced chaining patterns and DOES NOT require any modifications to the existing client code. `PageElements` now allows for defining the container element at runtime, **separately** from defining the filtering chain. For example: ```typescript const shoppingList = () => PageElement.located(By.id('shopping-list')) .describedAs('shopping list'); await actor.attemptsTo( Ensure.that( Text.of( green(items()) .first() .of(shoppingList()) ), equals('lettuce'), ) ) ``` `PageElements` now also allows for using pre-composed filter chains, like the one above, in `.where` clauses: ```typescript const shoppingLists = () => PageElement.located(By.css('.shopping-list')) .describedAs('shopping list'); // find the last of container items that contain a specific first child item shoppingLists() .where(Text.of(green(items()).first(), equals('lettuce')) .last() ``` Thanks to @viper3400 for the code review and suggestions
- Loading branch information
Showing
23 changed files
with
1,122 additions
and
1,346 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
Oops, something went wrong.