Skip to content

Commit ac9f5b9

Browse files
author
DavertMik
committed
fix: use >> instead of >>> for Playwright shadow DOM chaining
1 parent 705202e commit ac9f5b9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/helper/Playwright.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4097,9 +4097,10 @@ function buildLocatorString(locator) {
40974097
return `xpath=${locator.value}`
40984098
}
40994099
if (locator.isShadow()) {
4100-
// Convert shadow locator to CSS with >>> deep descendant combinator
4101-
// { shadow: ['my-app', 'recipe-hello', 'button'] } => 'my-app >>> recipe-hello >>> button'
4102-
return locator.value.join(' >>> ')
4100+
// Convert shadow locator to CSS with >> chaining operator
4101+
// Playwright pierces shadow DOM by default, >> chains selectors
4102+
// { shadow: ['my-app', 'my-form', 'button'] } => 'my-app >> my-form >> button'
4103+
return locator.value.join(' >> ')
41034104
}
41044105
return locator.simplify()
41054106
}

0 commit comments

Comments
 (0)