|
| 1 | +// @ts-check |
| 2 | +import { test, expect } from "./fixtures.js"; |
| 3 | + |
| 4 | +test("frontpage has popup with survey question", async ({ page, config }) => { |
| 5 | + await page.goto(config.baseURL); |
| 6 | + |
| 7 | + // Check for the poll/popup with the survey question |
| 8 | + await expect( |
| 9 | + page.getByText("How did you find out about QOwnNotes?"), |
| 10 | + ).toBeVisible(); |
| 11 | + |
| 12 | + // Check for the textbox |
| 13 | + await expect( |
| 14 | + page.getByRole("textbox", { |
| 15 | + name: "How did you find out about QOwnNotes?", |
| 16 | + }), |
| 17 | + ).toBeVisible(); |
| 18 | + |
| 19 | + // Check for the character counter |
| 20 | + await expect(page.getByText("0 / 200")).toBeVisible(); |
| 21 | + |
| 22 | + // Check for the Submit button |
| 23 | + await expect(page.getByRole("button", { name: "Submit" })).toBeVisible(); |
| 24 | + |
| 25 | + // Check for the Close poll button |
| 26 | + await expect(page.getByRole("button", { name: "Close poll" })).toBeVisible(); |
| 27 | +}); |
| 28 | + |
| 29 | +test("overview page has popup with survey question", async ({ |
| 30 | + page, |
| 31 | + config, |
| 32 | +}) => { |
| 33 | + await page.goto(config.baseURL + "/getting-started/overview.html"); |
| 34 | + |
| 35 | + // Check the survey popup is also on other pages |
| 36 | + await expect( |
| 37 | + page.getByText("How did you find out about QOwnNotes?"), |
| 38 | + ).toBeVisible(); |
| 39 | + await expect(page.getByRole("button", { name: "Submit" })).toBeVisible(); |
| 40 | + await expect(page.getByRole("button", { name: "Close poll" })).toBeVisible(); |
| 41 | +}); |
| 42 | + |
| 43 | +test("blog page has popup with survey question", async ({ page, config }) => { |
| 44 | + await page.goto(config.baseURL + "/blog/"); |
| 45 | + |
| 46 | + // Check the survey popup is on blog page |
| 47 | + await expect( |
| 48 | + page.getByText("How did you find out about QOwnNotes?"), |
| 49 | + ).toBeVisible(); |
| 50 | + await expect(page.getByRole("button", { name: "Submit" })).toBeVisible(); |
| 51 | +}); |
0 commit comments