mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-12 06:50:40 +08:00
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>
22 lines
675 B
TypeScript
22 lines
675 B
TypeScript
import type { Page } from "@playwright/test";
|
|
import { expect } from "@tests/support/fixtures.js";
|
|
|
|
// Reloads the current page and verifies that the URL stays correct
|
|
export const expectUrlPersistsReload = async (page: Page) => {
|
|
const url = page.url();
|
|
await page.reload();
|
|
await expect(page).toHaveURL(url);
|
|
};
|
|
|
|
// Navigates back, checks the URL and navigates forward back to the initial page
|
|
export const expectBackAndForwardNavigationWorks = async (
|
|
beforeURL: string,
|
|
page: Page,
|
|
) => {
|
|
const currentURL = page.url();
|
|
await page.goBack();
|
|
await expect(page).toHaveURL(beforeURL);
|
|
await page.goForward();
|
|
await expect(page).toHaveURL(currentURL);
|
|
};
|