Skip to content

Commit

Permalink
fix(browser): use documentElement as the root for selector
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 7, 2024
1 parent f41dda4 commit d807767
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/browser/src/client/tester/locators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export abstract class Locator {
return this._forceElement
}
const parsedSelector = this._parsedSelector || (this._parsedSelector = selectorEngine.parseSelector(this._pwSelector || this.selector))
return selectorEngine.querySelector(parsedSelector, document.body, true)
return selectorEngine.querySelector(parsedSelector, document.documentElement, true)
}

public element(): Element {
Expand All @@ -163,7 +163,7 @@ export abstract class Locator {
return [this._forceElement]
}
const parsedSelector = this._parsedSelector || (this._parsedSelector = selectorEngine.parseSelector(this._pwSelector || this.selector))
return selectorEngine.querySelectorAll(parsedSelector, document.body)
return selectorEngine.querySelectorAll(parsedSelector, document.documentElement)
}

public all(): Locator[] {
Expand Down

0 comments on commit d807767

Please sign in to comment.