2022-04-19 02:43:54 +00:00
|
|
|
import { expect, test } from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
test('about page has expected h1', async ({ page }) => {
|
2022-07-07 19:32:55 +00:00
|
|
|
await page.goto('/about');
|
2022-12-07 07:00:48 +00:00
|
|
|
expect(await page.textContent('h1')).toBe('About Bored Game');
|
2022-04-19 02:43:54 +00:00
|
|
|
});
|
2022-12-07 07:00:48 +00:00
|
|
|
|
|
|
|
|
test('base page has title and header links', async ({ page }) => {
|
|
|
|
|
await page.goto('/');
|
|
|
|
|
|
|
|
|
|
// Expect a title "to contain" a substring
|
|
|
|
|
await expect(page).toHaveTitle(/Bored Game \|/);
|
|
|
|
|
|
|
|
|
|
// create a locator collection
|
|
|
|
|
const collectionLink = page.getByRole('link', { name: 'COLLECTION' });
|
|
|
|
|
|
|
|
|
|
// Expect an attribute "to be strictly equal" to the value.
|
|
|
|
|
await expect(collectionLink).toHaveAttribute('href', '/collection');
|
|
|
|
|
|
|
|
|
|
// create a locator collection
|
|
|
|
|
const wishlistLink = page.getByRole('link', { name: 'WISHLIST' });
|
|
|
|
|
|
|
|
|
|
// Expect an attribute "to be strictly equal" to the value.
|
|
|
|
|
await expect(wishlistLink).toHaveAttribute('href', '/wishlist');
|
|
|
|
|
|
|
|
|
|
// // Click the get started link.
|
|
|
|
|
// await getStarted.click();
|
|
|
|
|
|
|
|
|
|
// // Expects the URL to contain intro.
|
|
|
|
|
// await expect(page).toHaveURL(/.*intro/);
|
|
|
|
|
})
|