use locator abstraction in tests folder#10833
Conversation
|
This has conflicts, and will conflict will #10820 as well. cc @NiranjanaBinoy, maybe we can coordinate this to avoid further conflicts? e.g. merge #10820, then this, then the rest of the fixture migrations after that (or something along those lines). |
|
I can also break this out into smaller pieces, prioritizing those files that are either a few steps away from being refactored or have already been refactored. |
|
That could work! Though I expect that I'd be able to review this fairly quickly, since the changes are all pretty easy to follow. If we're quick to review and merge this, the all-at-once approach might result in the least conflicts. |
c9a4c0d to
a6b2629
Compare
|
#10820 has been merged now as well, and I've just heard from @NiranjanaBinoy that there aren't any further big changes in draft yet, so now would be a good time to get this updated and reviewed/merged |
a6b2629 to
e1c8b06
Compare
|
@Gudahtt updated the branch with latest from develop |
| await driver.clickElement( | ||
| By.xpath(`//button/div/div[contains(text(), "Fast")]`), | ||
| ); | ||
| await driver.clickElement({ text: 'Fast', tag: 'button/div/div' }); |
There was a problem hiding this comment.
I guess this means the tag property is only compatible with xpath 🤔
It might be worth using the xpath locator here explicitly if we want to make the text and tag-based locators implementable without using xpath.
There was a problem hiding this comment.
How would you make text locators implementable without xpath with Selenium? For what its worth this can be expressed very easily with Playwright button > div > div:has-text("fast")
There was a problem hiding this comment.
Oh I meant in Playwright - I think we need to use xpath for this in Selenium.
if this slash syntax is easily parsed/handled by Playwright that works too! Just wasn't sure it was portable. That approach you just gave an example of seems fine to me.
| await driver.clickElement({ text: 'Settings', tag: 'div' }); | ||
|
|
||
| // await driver.findElement(By.css('.tab-bar')) | ||
| // await driver.findElement('.tab-bar') |
There was a problem hiding this comment.
😂 Whoops! I wonder how that got there.
Builds ready [e1c8b06]
Page Load Metrics (562 ± 47 ms)
|
Implements the abstraction for the 'by' method from selenium implemented in #10802