Files
radicle-explorer/tests/e2e/seed.spec.ts
T
Rūdolfs OšiņšandSebastian Martinez 9cb9332e88 Replace Cypress with Playwright
Playwright is more flexible and has better developer experience than Cypress.
We add end to end tests covering:

  - project source browsing
    - tree view
    - commit list view
    - commit view
  - routing
    - hash based
    - history API based
  - clipboard copy paste functionality
  - seed view
  - project search
  - landing page view
  - settings

Co-authored-by: Sebastian Martinez <me@sebastinez.dev>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2022-12-01 15:54:56 +01:00

47 lines
1.5 KiB
TypeScript

import { test, expect } from "@tests/support/fixtures.js";
test("seed metadata", async ({ page }) => {
await page.goto("/seeds/radicle.local");
await expect(page.locator("header").getByText("radicle.local")).toBeVisible();
await expect(
page.locator(".title >> text=radicle.local").getByRole("img"),
).toHaveAttribute("alt", "🚀");
await expect(page.getByRole("link", { name: "radicle.local" })).toBeVisible();
await expect(page.locator(".seed-address").getByRole("img")).toHaveAttribute(
"alt",
"🚀",
);
await expect(page.locator("text=hyb6i8…sg6nn4")).toBeVisible();
await expect(page.locator("text=8777")).toBeVisible();
await expect(page.locator("text=0.2.0")).toBeVisible();
});
test("seed projects", async ({ page }) => {
await page.goto("/seeds/radicle.local");
const project = page.locator(".project");
// Project metadata.
{
await expect(project.locator("text=source-browsing")).toBeVisible();
await expect(
project.locator("text=Git repository for source browsing tests"),
).toBeVisible();
await expect(
project.locator("text=530aabdcc80397af254bc488b767169b92496e81"),
).toBeVisible();
}
// Show project URN on hover.
{
await expect(
project.locator("text=rad:git:hnrkgd7sjt79k4j59ddh11ooxg18rk7soej8o"),
).not.toBeVisible();
await project.hover();
await expect(
project.locator("text=rad:git:hnrkgd7sjt79k4j59ddh11ooxg18rk7soej8o"),
).toBeVisible();
}
});