Skip to content

Commit

Permalink
Remove auto-scrolling in buildNestedLocator
Browse files Browse the repository at this point in the history
  • Loading branch information
DyHex committed Apr 17, 2024
1 parent 67a6846 commit 993b0ad
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .changeset/early-singers-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
"pomwright": patch
---

# Change

buildNestedLocator will no longer attempt to auto-scroll to the final nested locator

Was done previously in an attempt to improve test recordings, but it sometimes causes tearing in screenshots and isn't ideal when using nested locators for visual regression tests.

## Playwright/test compatibility

Tested with the following Playwright/test versions:

- 1.43.1
- 1.43.0
- 1.42.1
- 1.42.0 (not recommended)
- 1.41.2
- 1.41.1
- 1.41.0
- 1.40.1
- 1.40.0
- 1.39.0
1 change: 0 additions & 1 deletion src/helpers/getLocatorBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ export class GetLocatorBase<LocatorSchemaPathType extends string> {
}

if (currentLocator != null) {
currentLocator.scrollIntoViewIfNeeded().catch(() => {});
return currentLocator;
}
})) as Locator;
Expand Down
10 changes: 5 additions & 5 deletions test/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 993b0ad

Please sign in to comment.