diff options
author | Erich Eckner <git@eckner.net> | 2023-12-04 20:04:28 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2023-12-04 20:04:28 +0100 |
commit | b343c263d3a436f8a9a1cf0dd11797e8430b1531 (patch) | |
tree | b9ebf35136e2a17b70610aad30a37816d5498cc0 /tests | |
parent | 31aee5597fa047e315499d1b0e956e330098e129 (diff) | |
download | Milchtankstelle-b343c263d3a436f8a9a1cf0dd11797e8430b1531.tar.xz |
sinnvoller Test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/example.spec.ts | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/tests/example.spec.ts b/tests/example.spec.ts index 54a906a..fe87980 100644 --- a/tests/example.spec.ts +++ b/tests/example.spec.ts @@ -1,18 +1,11 @@ import { test, expect } from '@playwright/test'; -test('has title', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Expect a title "to contain" a substring. - await expect(page).toHaveTitle(/Playwright/); -}); - -test('get started link', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Click the get started link. - await page.getByRole('link', { name: 'Get started' }).click(); - - // Expects page to have a heading with the name of Installation. - await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); +test('Milchtankstelle', async ({ page }) => { + await page.goto('https://www.facebook.com/people/Milchtankstelle-in-Oberwellenborn/100057319515068/'); + + await page.getByRole('button', {name: 'Decline optional cookies'}).click(); + await page.getByRole('button', {name: 'Close'}).click(); + let first = await page.$('xpath=//div[@role="article" and @aria-posinset="1"]'); + let firstText = await first.innerHTML(); + expect(firstText.includes('Unsere Milchtankstelle ist defekt!')).toBeTruthy(); }); |