mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00

Repro: `cd tests/components/ct-svelte && rm -rf node_modules package-lock.json && npm i && npx playwright test --project=chromium` Follow-up based on https://github.com/microsoft/playwright/pull/28624#issuecomment-1858608101. Svelte has no router by default, only SvelteKit - so lets remove the package which is not maintained anymore and not recommended.
12 lines
502 B
TypeScript
12 lines
502 B
TypeScript
import { test, expect } from '@playwright/experimental-ct-svelte';
|
|
import App from '@/App.svelte';
|
|
|
|
test('navigate to a page by clicking a link', async ({ page, mount }) => {
|
|
const component = await mount(App);
|
|
await expect(component.getByRole('main')).toHaveText('Login');
|
|
await expect(page).toHaveURL('/');
|
|
await component.getByRole('link', { name: 'Dashboard' }).click();
|
|
await expect(component.getByRole('main')).toHaveText('Dashboard');
|
|
await expect(page).toHaveURL('/dashboard');
|
|
});
|