mechanical-orchard / playwright-elixir

An Elixir library for Playwright web automation
MIT License
119 stars 23 forks source link

Page.query_selector_all test fails intermittently #19

Closed sax closed 2 years ago

sax commented 2 years ago

@coreyti Erik and I are unable to reproduce this today on my computer. We wondered if there was some specific constraint that we ran into on your computer that might not apply to mine, like RAM.

sax commented 2 years ago

I retract my comment. We can reproduce this—it just happens much more rarely on my computer.

dbrody commented 2 years ago

@sax Not sure if it is related to this, but I also saw intermitted / more frequent failings of the query_selector method too. Adding %{ strict: false } option seemed to help. This seems like a new issue in the last few days.

sax commented 2 years ago

I filed this issue with Playwright, and it seems like this is a known issue unrelated to the Elixir code. We're thinking of implementing locators next, and either adding warnings to the docs or to the compiler for the element handles.

coreyti commented 2 years ago

We've added almost all of the Locator implementation, which is what the official packages suggest one use instead of ElementHandle, query_selector, etc.[^1]

We've also removed, for now, async from the running of the test suite. That seems to resolve all of the flakiness pretty well (which is interesting).

[^1]: funnily enough, Locator actually depends on ElementHandle under the hood.

dbrody commented 2 years ago

@coreyti Awesome!

Just a side note, I'm terrible at this too, but I think as this codebase matures, its best to make all changes (perhaps require) through a PR instead of commits on the main branch. That way it can be linked to issues like this so it is references and so that the changes can be reviewed by people like me who depend on the codebase which is quickly changing and evolving.

Anyway, awesome to see the progress and work put into this library!