|
| 1 | +import { test, expect } from "@playwright/test"; |
| 2 | +import { testAssetsPath, disablePlausible } from "../test-commands"; |
| 3 | +test.describe.configure({ mode: "parallel" }); |
| 4 | +test("should do tour", async ({ page }) => { |
| 5 | + await page.goto("/", { waitUntil: "load" }); |
| 6 | + disablePlausible(page); |
| 7 | + await page.getByRole("button", { name: /Editor/ }).click(); |
| 8 | + await expect( |
| 9 | + page.getByRole("button", { name: "Take the tour!" }), |
| 10 | + "Tour button is visible", |
| 11 | + ).toBeVisible(); |
| 12 | + await page.getByRole("button", { name: "Take the tour!" }).click(); |
| 13 | + await page.locator(".shepherd-element").waitFor({ state: "visible" }); |
| 14 | + await expect( |
| 15 | + page.locator(".shepherd-header"), |
| 16 | + "should have title `Editor..`", |
| 17 | + ).toContainText("Editor for"); |
| 18 | + await page.getByRole("button", { name: "Next" }).click(); |
| 19 | + |
| 20 | + await expect( |
| 21 | + page.getByText(/Choose File/), |
| 22 | + "should have title `Choose..`", |
| 23 | + ).toBeVisible(); |
| 24 | + await page.getByRole("button", { name: "Next" }).click(); |
| 25 | + await expect( |
| 26 | + page.getByText(/Tadaa/), |
| 27 | + "should have title `Tadaa!..`", |
| 28 | + ).toBeVisible(); |
| 29 | + await page.getByRole("button", { name: "Next" }).click(); |
| 30 | + await expect( |
| 31 | + page.getByText(/You can add an image/), |
| 32 | + "should have text `You can add an image..`", |
| 33 | + ).toBeVisible(); |
| 34 | + await page.getByRole("button", { name: "Next" }).click(); |
| 35 | + |
| 36 | + await expect( |
| 37 | + page.getByText(/You can add a translation/), |
| 38 | + "should have text `You can add a translation..`", |
| 39 | + ).toBeVisible(); |
| 40 | + await page.getByRole("button", { name: "Next" }).click(); |
| 41 | + await expect( |
| 42 | + page.getByText(/In this section, you can see a visual representation/), |
| 43 | + "should have text `In this section, you can see a visual representation..`", |
| 44 | + ).toBeVisible(); |
| 45 | + await page.getByRole("button", { name: "Next" }).click(); |
| 46 | + await expect( |
| 47 | + page.getByText(/Audio Toolbar Zoom/), |
| 48 | + "should have title `Audio..`", |
| 49 | + ).toBeVisible(); |
| 50 | + await page.getByRole("button", { name: "Next" }).click(); |
| 51 | + await expect( |
| 52 | + page.getByText(/Audio Text/), |
| 53 | + "should have title `Audio Text..`", |
| 54 | + ).toBeVisible(); |
| 55 | + await page.getByRole("button", { name: "Next" }).click(); |
| 56 | + await expect( |
| 57 | + page.getByText(/Fix Spelling/), |
| 58 | + "should have title `Fix Spelling..`", |
| 59 | + ).toBeVisible(); |
| 60 | + await page.getByRole("button", { name: "Next" }).click(); |
| 61 | + await expect( |
| 62 | + page.getByText(/Export your/), |
| 63 | + "should have title `Export..`", |
| 64 | + ).toBeVisible(); |
| 65 | + await page.getByRole("button", { name: "Close", exact: true }).click(); |
| 66 | +}); |
0 commit comments