regenbogenkarte/tests/start.spec.ts
nachtjasmin e98c3de747
chore: initial fork of the closed-source project
This commit includes all data from the current map, excluding:

- the actual data
- the deployment script to the server

We've added a comprehensive README for newcomers, so that they can
understand what's going on.

Co-authored-by: xenia <xhartmann@posteo.de>
2022-09-04 10:28:56 +02:00

23 lines
934 B
TypeScript

import { test, expect } from "@playwright/test";
test.describe("exit button", () => {
test.beforeEach(async ({ page, baseURL }) => {
test.fail(baseURL === undefined, "baseURL should be set");
await page.goto(baseURL!);
});
test("should open new tab with wikipedia", async ({ page }) => {
const [wikipedia] = await Promise.all([
page.waitForEvent("popup"),
page.locator("text=Notausgang").click(),
]);
await expect(wikipedia).toHaveURL("https://de.wikipedia.org/wiki/Wikipedia:Hauptseite");
});
test("should navigate to google", async ({ page }) => {
await Promise.all([page.waitForEvent("popup"), page.locator("text=Notausgang").click()]);
await expect(page).toHaveURL(/google\.com/);
});
test("should open two tabs in total", async ({ page }) => {
await Promise.all([page.waitForEvent("popup"), page.locator("text=Notausgang").click()]);
await expect(page.context().pages()).toHaveLength(2);
});
});