You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to have some nicer, more "human-like" ways to select elements, similar to playwright's locators.
Here is an idea of expressing something like that with a builder pattern:
importchrobot/locator/// Specify a button locator, then issue a command to itpubfnwibble()->Result(Wibble,Wobble){locator.new()|>locator.role_button()|>locator.text("Submit")|>locator.click()}
importchrobot/locatorimportgleeunit/should/// Use a locator to select an element and assert against an attributepubfnwibble(){locator.new()|>locator.role_button()|>locator.text("Submit")|>locator.timeout(1000)|>locator.get_attribute("data-lustre-on-click")|>should.be_ok|>should.equal("0-0-1")}
importchrobot/locator/// Use a locator to select an input and fill in text (focus+type)pubfnwibble(){locator.new()|>locator.label("First Name")|>locator.fill("Lucy")}
Locators would have built-in polling with a default timeout that can be specified as part of the builder with locator.timeout and will be set to a reasonable default otherwise.
In the example above, locator.click(), locator.get_attribute() and locator.fill() take in a locator and run a query against the browser with it, all functions before it are part of the locator builder.
The text was updated successfully, but these errors were encountered:
I want to have some nicer, more "human-like" ways to select elements, similar to playwright's locators.
Here is an idea of expressing something like that with a builder pattern:
Locators would have built-in polling with a default timeout that can be specified as part of the builder with
locator.timeout
and will be set to a reasonable default otherwise.In the example above,
locator.click()
,locator.get_attribute()
andlocator.fill()
take in a locator and run a query against the browser with it, all functions before it are part of the locator builder.The text was updated successfully, but these errors were encountered: