Skip to content

Commit

Permalink
fix: use ubuntu jammy for github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Mason Hu <[email protected]>
  • Loading branch information
MasWho committed Feb 18, 2025
1 parent fe63069 commit a465c55
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/helpers/instancePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const startInstanceFromPanel = async (page: Page, instance: string) => {
});
const startButton = instanceDetailPanel.locator("css=button[title=Start]");
await startButton.click();
await page.waitForSelector(`text=Instance ${instance} started.`);
await checkInstanceStatus(page, instance, "Running");
};

export const stopInstanceFromPanel = async (page: Page, instance: string) => {
Expand All @@ -43,7 +43,7 @@ export const stopInstanceFromPanel = async (page: Page, instance: string) => {
hasText: "Stop",
});
await confirmStopButton.click();
await page.waitForSelector(`text=Instance ${instance} stopped.`);
await checkInstanceStatus(page, instance, "Stopped");
};

export const navigateToInstanceDetails = async (
Expand All @@ -62,3 +62,22 @@ export const navigateToInstanceDetails = async (
});
await expect(instanceDetailTitle).toBeVisible();
};

export const getInstanceRow = async (page: Page, instance: string) => {
await page.waitForLoadState("networkidle");
await gotoURL(page, "/ui/");
const instanceRow = page.getByRole("row", {
name: `Select ${instance} Name Type Description Status Actions`,
});
return instanceRow;
};

export const checkInstanceStatus = async (
page: Page,
instance: string,
status: string,
) => {
const instanceRow = await getInstanceRow(page, instance);
await expect(instanceRow.getByLabel("Status")).toHaveText(status);
await openInstancePanel(page, instance);
};

0 comments on commit a465c55

Please sign in to comment.