/ opencodehub / tests / e2e / dashboard.spec.ts
Swadhin Biswas test(qa): add e2e, integration, unit, and load coverage · 3/6/2026
1c29e63
36 lines · 1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { expect, test } from "@playwright/test";

test.describe("Dashboard", () => {
  test("homepage loads and shows branding", async ({ page }) => {
    await page.goto("/");
    await expect(page).toHaveTitle(/OpenCodeHub/i);
  });

  test("explore page loads", async ({ page }) => {
    await page.goto("/explore");
    await expect(page.locator("body")).toBeVisible();
    // Should show repositories or search
    await expect(
      page
        .locator("text=Explore")
        .or(page.locator("text=Repositories"))
        .or(page.locator("text=explore"))
        .first(),
    ).toBeVisible({ timeout: 5000 });
  });

  test("navigation bar is present", async ({ page }) => {
    await page.goto("/");
    const nav = page.locator("nav, header");
    await expect(nav.first()).toBeVisible();
  });

  test("footer is present", async ({ page }) => {
    await page.goto("/");
    const footer = page.locator("footer");
    if (await footer.isVisible()) {
      await expect(footer).toBeVisible();
    }
  });
});