add abstraction for waitForSelector#10844
Conversation
test/e2e/webdriver/driver.js
Outdated
There was a problem hiding this comment.
A majority of our usage of until.elementMatchesText was using a css selector then waiting until the returned element had matching text. Building an xpath combining CSS selection and text selection more closely mimics Playwright's API (page.waitForSelector('.hello >> text="hi"'). XPath IS slower than CSS selectors, BUT in the case of searching for text, it is not possible without XPath. Combining them into XPath is likely faster than issuing two statements looking for both a CSS selector AND then waiting for text to match.
In the end, though, this entire method (buildLocator) will go away and we will use the much more powerful and expressive playwright selector API.
Builds ready [a3c1468]
Page Load Metrics (645 ± 34 ms)
|
Gudahtt
left a comment
There was a problem hiding this comment.
This looks fantastic! This seems like a very good way of abstracting this functionality. I just had a couple of questions about the metamask-ui.spec.js changes.
a3c1468 to
71870f4
Compare
Builds ready [71870f4]
Page Load Metrics (586 ± 43 ms)
|
Adds an abstraction for waitForSelector, a method that exists in the playwright API. This abstraction aims to eventually become a paper-thin abstraction over the playwright version. In the meantime
untilis used behind the scenes to mimick the behavior.Included is a refactor of
metamask-ui.spec.jswhich served as a robustness check for the utility.