Open franknoirot opened 4 months ago
Additional note: this is not actually the behavior that was leading to the duplicate clicks; making this replacement still resulted in the same behavior. The fix for that issue was to call page.mouse.move(0,0)
before the next call to any kind of click. So this is more of a best practice following guardrail than fixing the main issue we run into with Playwright clicks.
If we're adding playwright eslint rules, I think we should error for page.waitForTimeout
It would a pain to add because it would have to be disable in currently working tests, of which there are 370ish uses
It has caused errant clicks for us in our test suite because we also use
page.mouse.move()
andpage.mouse.click()
to click in specific places in the stream. If you have moved the mouse to a location and then callpage.click()
, even if the selector isn't under the mouse's position, two clicks will register simultaneously with Playwright: one where the mouse was left, one on the target ofpage.click()
. Playwright's docs say thatpage.click()
is "discouraged" in favor ofpage.locator().click()
, so we should have an ESLint rule for it.