Initial release v1.0.0
This commit is contained in:
54
frontend/tests/e2e/smoke.spec.ts
Normal file
54
frontend/tests/e2e/smoke.spec.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
const username = process.env.LIDIFY_TEST_USERNAME || "predeploy";
|
||||
const password = process.env.LIDIFY_TEST_PASSWORD || "predeploy-password";
|
||||
|
||||
test("core smoke: login → play album → play/pause/next/prev", async ({ page }) => {
|
||||
// Login
|
||||
await page.goto("/login");
|
||||
await page.locator("#username").fill(username);
|
||||
await page.locator("#password").fill(password);
|
||||
await page.getByRole("button", { name: "Sign In" }).click();
|
||||
|
||||
// Login redirects to / (assuming onboarding was already completed by the API smoke test)
|
||||
await page.waitForURL(/\/($|\?)/);
|
||||
|
||||
// Navigate to albums and open the first one
|
||||
await page.goto("/albums");
|
||||
await expect(page.getByRole("heading", { name: "All Albums" })).toBeVisible();
|
||||
|
||||
const firstAlbum = page.locator('a[href^="/album/"]').first();
|
||||
const albumCount = await firstAlbum.count();
|
||||
expect(albumCount).toBeGreaterThan(0);
|
||||
await firstAlbum.click();
|
||||
|
||||
// Start playback
|
||||
await page.getByLabel("Play all").click();
|
||||
|
||||
// Mini player should reflect playing state
|
||||
const playPause = page.locator('button[title="Pause"], button[title="Play"]').first();
|
||||
await expect(playPause).toHaveAttribute("title", "Pause");
|
||||
|
||||
// Toggle pause/play
|
||||
await playPause.click();
|
||||
await expect(playPause).toHaveAttribute("title", "Play");
|
||||
await playPause.click();
|
||||
await expect(playPause).toHaveAttribute("title", "Pause");
|
||||
|
||||
// Next/Previous should be available for tracks (library content)
|
||||
const nextBtn = page.locator('button[title="Next"]');
|
||||
const prevBtn = page.locator('button[title="Previous"]');
|
||||
await expect(nextBtn).toBeVisible();
|
||||
await expect(prevBtn).toBeVisible();
|
||||
|
||||
await nextBtn.click();
|
||||
await prevBtn.click();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user