Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/client-side-js/injectUI5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ async function clientSide_injectUI5(waitForUI5Timeout: number, browserInstance:
const [sTarget, sRegEx, sFlags] = oSelector.id.match(/\/(.*)\/(.*)/)
oSelector.id = new RegExp(sRegEx, sFlags)
}

// also check if ancestor uses regex
if (oSelector.ancestor && typeof oSelector.ancestor.id === "string" && (oSelector.ancestor.id as string).startsWith("/", 0)) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [sTarget, sRegEx, sFlags] = (oSelector.ancestor.id as string).match(/\/(.*)\/(.*)/)
oSelector.ancestor.id = new RegExp(sRegEx, sFlags)
}

// match a regular regex as (partial) matcher
// properties: {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/wdi5-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ export class WDI5Control {
controlSelector.selector.id = controlSelector.selector.id.toString()
}

// also allow regex for ancestors
if (controlSelector.selector.ancestor && typeof controlSelector.selector.ancestor.id === "object") {
controlSelector.selector.ancestor.id = controlSelector.selector.ancestor.id.toString();
}
// check whether we have a (partial) text matcher
// that should match:
// properties: {
Expand Down
Loading