Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix dashboard add app issue #12752

Merged
merged 1 commit into from
Nov 20, 2024
Merged
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
39 changes: 30 additions & 9 deletions packages/tests/src/utils/playwrightOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ export async function initTeamsPage(
page.waitForNavigation(),
]);
await page.waitForTimeout(Timeout.longTimeWait);
console.log("click add button");

try {
console.log("dismiss message");
Expand All @@ -415,13 +414,22 @@ export async function initTeamsPage(

// default
console.log("click add button");
let addInBtn;
let addBtn;
try {
addInBtn = await page?.waitForSelector("button>span:has-text('Add')");
addBtn = await page?.waitForSelector("button>span:has-text('Add')");
} catch {
throw "error to add app";
try {
addBtn = await page?.waitForSelector("button>span:has-text('Open')");
} catch {
await page.screenshot({
path: getPlaywrightScreenshotPath("add_page"),
fullPage: true,
});
throw "error to add app";
}
}
await addInBtn?.click();
await addBtn?.click();

if (options?.type === "meeting") {
// select meeting tab in dialog box
const dialog = await page.waitForSelector("div[role='dialog']");
Expand Down Expand Up @@ -567,11 +575,24 @@ export async function reopenTeamsPage(
}
if (addApp) {
await page.waitForTimeout(Timeout.longTimeWait);
console.log("click add button");
// default
const addBtn = await page?.waitForSelector(
"button>span:has-text('Add')"
);
console.log("click add button");
let addBtn;
try {
addBtn = await page?.waitForSelector("button>span:has-text('Add')");
} catch {
try {
addBtn = await page?.waitForSelector(
"button>span:has-text('Open')"
);
} catch {
await page.screenshot({
path: getPlaywrightScreenshotPath("add_page"),
fullPage: true,
});
throw "error to add app";
}
}
await addBtn?.click();
}
await page.waitForTimeout(Timeout.shortTimeLoading);
Expand Down
Loading