fix(webdriverio): don't throw if tree to attach element couldn't be found, as it causes issues for component tests

This commit is contained in:
Christian Bromann 2025-07-17 10:10:07 -07:00
parent a515cdf9ce
commit b63166ae24
No known key found for this signature in database
GPG key ID: 51F2964F9E866100

View file

@ -308,7 +308,7 @@ export class ShadowRootTree {
if (typeof scope === 'string' && treeArg instanceof ShadowRootTree) {
const tree = this.find(scope) || this.findByShadowId(scope)
if (!tree) {
throw new Error(`Couldn't find element with id ${scope}`)
return
}
tree.addShadowElement(treeArg)