Skip to content

Commit

Permalink
Add failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
doxavore committed Nov 30, 2023
1 parent be729b1 commit 7f848b7
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/example.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,28 @@ test('homepage has title and links to intro page', async ({ page }) => {

// Click the get started link.
await getStarted.click();


// Expects the URL to contain intro.
await expect(page).toHaveURL(/.*intro/);
});

test('failing homepage has title and links to intro page', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);

// create a locator
const getStarted = page.getByRole('link', { name: 'Get started' });

// Expect an attribute "to be strictly equal" to the value.
await expect(getStarted).toHaveAttribute('href', '/docs/intro');

// Click the get started link.
await getStarted.click();

// Expects the URL to contain intro.
await expect(page).toHaveURL(/.*intro/);

await expect(page).toHaveTitle(/not a title/);
});

0 comments on commit 7f848b7

Please sign in to comment.