Unverified 提交 87a0de43 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

fix select component test (#485)

上级 47f3ec46
...@@ -649,8 +649,22 @@ export class PageObject { ...@@ -649,8 +649,22 @@ export class PageObject {
await this.page.getByRole("button", { name: "Open in Chat" }).click(); await this.page.getByRole("button", { name: "Open in Chat" }).click();
} }
locateAppUpgradeButton({ upgradeId }: { upgradeId: string }) {
return this.page.getByTestId(`app-upgrade-${upgradeId}`);
}
async clickAppUpgradeButton({ upgradeId }: { upgradeId: string }) { async clickAppUpgradeButton({ upgradeId }: { upgradeId: string }) {
await this.page.getByTestId(`app-upgrade-${upgradeId}`).click(); await this.locateAppUpgradeButton({ upgradeId }).click();
}
async expectAppUpgradeButtonIsNotVisible({
upgradeId,
}: {
upgradeId: string;
}) {
await expect(this.locateAppUpgradeButton({ upgradeId })).toBeHidden({
timeout: Timeout.MEDIUM,
});
} }
async expectNoAppUpgrades() { async expectNoAppUpgrades() {
......
...@@ -58,7 +58,9 @@ testSkipIfWindows("upgrade app to select component", async ({ po }) => { ...@@ -58,7 +58,9 @@ testSkipIfWindows("upgrade app to select component", async ({ po }) => {
await po.importApp("select-component"); await po.importApp("select-component");
await po.getTitleBarAppNameButton().click(); await po.getTitleBarAppNameButton().click();
await po.clickAppUpgradeButton({ upgradeId: "component-tagger" }); await po.clickAppUpgradeButton({ upgradeId: "component-tagger" });
await po.expectNoAppUpgrades(); await po.expectAppUpgradeButtonIsNotVisible({
upgradeId: "component-tagger",
});
await po.snapshotAppFiles(); await po.snapshotAppFiles();
await po.clickOpenInChatButton(); await po.clickOpenInChatButton();
// There should be another version from the upgrade being committed. // There should be another version from the upgrade being committed.
......
...@@ -3,7 +3,7 @@ import { PlaywrightTestConfig } from "@playwright/test"; ...@@ -3,7 +3,7 @@ import { PlaywrightTestConfig } from "@playwright/test";
const config: PlaywrightTestConfig = { const config: PlaywrightTestConfig = {
testDir: "./e2e-tests", testDir: "./e2e-tests",
workers: 1, workers: 1,
retries: process.env.CI ? 2 : 0, retries: process.env.CI ? 2 : 1,
// maxFailures: 1, // maxFailures: 1,
timeout: process.env.CI ? 180_000 : 30_000, timeout: process.env.CI ? 180_000 : 30_000,
// Use a custom snapshot path template because Playwright's default // Use a custom snapshot path template because Playwright's default
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论