Chrysoblog/tests/post.spec.ts

20 lines
752 B
TypeScript
Raw Permalink Normal View History

2024-09-29 18:45:35 -07:00
import { expect, test } from '@playwright/test';
test('Navigate to blog post', async ({ page }) => {
await page.goto('/post');
await page.getByText('The Perfect Math Class').click();
await expect(page).toHaveURL("/post/the-perfect-math-class/");
});
2024-10-18 11:16:44 -07:00
test('Navigate to page 2', async ({ page }) => {
await page.goto('/post');
await page.getByRole('link', { name: 'Next Page' }).click();
await expect(page).toHaveURL("/page/2/");
await page.getByRole('link', { name: 'Prev Page' }).click();
await expect(page).toHaveURL("/post/");
await page.getByRole('link', { name: 'Last Page' }).click();
await expect(page).toHaveURL("/page/2/");
await page.getByRole('link', { name: 'First Page' }).click();
await expect(page).toHaveURL("/post/");
});