Skip to content

Commit

Permalink
chore(tests) use alpine cloud image for faster tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Edler <[email protected]>
  • Loading branch information
edlerd committed Apr 10, 2024
1 parent e3f5057 commit 74f03ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
22 changes: 4 additions & 18 deletions tests/helpers/instances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ export const createInstance = async (
await page.getByLabel("Instance name").fill(instance);
await page.getByRole("button", { name: "Browse images" }).click();
await page.getByPlaceholder("Search an image").click();
await page.getByPlaceholder("Search an image").fill("jammy");
await page
.getByRole("row")
.filter({
hasText: "Ubuntu Minimal",
})
.getByRole("button", { name: "Select" })
.last()
.click();
await page.getByPlaceholder("Search an image").fill("alpine/3.19/cloud");
await page.getByRole("button", { name: "Select" }).click();
await page
.getByRole("combobox", { name: "Instance type" })
.selectOption(type);
Expand Down Expand Up @@ -108,15 +101,8 @@ export const createAndStartInstance = async (
await page.getByLabel("Instance name").fill(instance);
await page.getByRole("button", { name: "Browse images" }).click();
await page.getByPlaceholder("Search an image").click();
await page.getByPlaceholder("Search an image").fill("jammy");
await page
.getByRole("row")
.filter({
hasText: "Ubuntu Minimal",
})
.getByRole("button", { name: "Select" })
.last()
.click();
await page.getByPlaceholder("Search an image").fill("alpine/3.19/cloud");
await page.getByRole("button", { name: "Select" }).click();
await page
.getByRole("combobox", { name: "Instance type" })
.selectOption(type);
Expand Down
8 changes: 5 additions & 3 deletions tests/instances.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ test.afterAll(async ({ browser }) => {
test("instance terminal operations", async ({ page }) => {
await visitAndStartInstance(page, instance);
await page.getByTestId("tab-link-Terminal").click();
await page.getByRole("button", { name: "Reconnect" }).click();
await page.getByLabel("Command").fill("sh");
await page.getByLabel("submit reconnect").click();
await expect(page.locator(".xterm-screen")).toBeVisible();
await page.keyboard.type("lsb_release -a");
await page.keyboard.type("cat /etc/issue");
await page.keyboard.press("Enter");
await expect(page.locator(".xterm-rows")).toContainText("Ubuntu");
await expect(page.locator(".xterm-rows")).toContainText("Alpine Linux");
let dialogPresent = false;
page.on("dialog", (dialog) => {
expect(dialog.type()).toEqual("confirm");
dialogPresent = true;
void dialog.accept();
});
Expand Down

0 comments on commit 74f03ea

Please sign in to comment.