Skip to content

Commit

Permalink
Add basic health check to make sure build works
Browse files Browse the repository at this point in the history
Signed-off-by: Mirjam Aulbach <[email protected]>
  • Loading branch information
programmiri committed Jan 12, 2024
1 parent ac9d3bd commit b08c393
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Empty file removed e2e/test-results/test.ts
Empty file.
53 changes: 53 additions & 0 deletions e2e/tests/basic-health-check.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { test, expect } from "@playwright/test";

const superAdminUserName = "superadmin";
const superAdminPassword = "kwsuperadmin123$$";
test("has title", async ({ page }) => {
await page.goto("/");

await expect(page).toHaveTitle(
"Klaw | Kafka Self-service Topic Management Portal",
);
});

test("user can login with default superadmin user", async ({ page }) => {
await page.goto("/");
const loader = page.locator(".preloader");
await expect(loader).not.toBeVisible();

await page.getByPlaceholder("Username").fill(superAdminUserName);
await page.getByPlaceholder("Password").fill(superAdminPassword);
await page.getByRole("button", { name: "LOG IN" }).click();

const profileForSuperAdmin = await page.getByRole("button", {
name: "superadmin",
exact: true,
});

await expect(profileForSuperAdmin).toBeVisible();
});

test("coral is build", async ({ page }) => {
await page.goto("/");
const loader = page.locator(".preloader");
await expect(loader).not.toBeVisible();

await page.getByPlaceholder("Username").fill(superAdminUserName);
await page.getByPlaceholder("Password").fill(superAdminPassword);
await page.getByRole("button", { name: "LOG IN" }).click();

const profileForSuperAdmin = await page.getByRole("button", {
name: "superadmin",
exact: true,
});

await expect(profileForSuperAdmin).toBeVisible();

await page.goto("/coral/topics");

const coralSuperAdminDialog = await page.getByRole("dialog", {
name: /you're currently logged in as superadmin\./i,
});

await expect(coralSuperAdminDialog).toBeVisible();
});

0 comments on commit b08c393

Please sign in to comment.