Merge pull request #1031 from pikasTech/fix/1020-switch-away-selector
fix: split web probe session switch selectors
This commit is contained in:
@@ -1542,7 +1542,8 @@ async function clickSession(sessionId) {
|
||||
if (!sessionId) throw new Error("clickSession requires --session-id or --value");
|
||||
const beforeUrl = currentPageUrl();
|
||||
const escaped = cssEscape(sessionId);
|
||||
const candidate = page.locator("[data-session-id=\"" + escaped + "\"], [href*=\"" + escaped + "\"], text=" + sessionId).first();
|
||||
const cssCandidate = page.locator("[data-session-id=\"" + escaped + "\"], [href*=\"" + escaped + "\"]").first();
|
||||
const candidate = await visibleLocator(cssCandidate) ? cssCandidate : page.getByText(sessionId, { exact: true }).first();
|
||||
await candidate.waitFor({ state: "visible", timeout: 15000 });
|
||||
await candidate.click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
Reference in New Issue
Block a user