From a989f4f6e097d9f5a71c86a4baa903556aa95a27 Mon Sep 17 00:00:00 2001 From: rwood-moz Date: Fri, 6 Dec 2024 16:15:25 -0500 Subject: [PATCH] Add test for splashscreen --- test/e2e/const/constants.ts | 5 +++++ test/e2e/playwright.config.ts | 2 +- test/e2e/tests/example.spec.ts | 18 ------------------ test/e2e/tests/splashscreen.spec.ts | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 test/e2e/const/constants.ts delete mode 100644 test/e2e/tests/example.spec.ts create mode 100644 test/e2e/tests/splashscreen.spec.ts diff --git a/test/e2e/const/constants.ts b/test/e2e/const/constants.ts new file mode 100644 index 000000000..10e17924d --- /dev/null +++ b/test/e2e/const/constants.ts @@ -0,0 +1,5 @@ +// appointment urls +export const APPT_PROD_URL = 'https://appointment.day/'; + +// page titles +export const APPT_PAGE_TITLE = 'Thunderbird Appointment'; diff --git a/test/e2e/playwright.config.ts b/test/e2e/playwright.config.ts index a05d8b5a1..2f87197cd 100644 --- a/test/e2e/playwright.config.ts +++ b/test/e2e/playwright.config.ts @@ -22,7 +22,7 @@ export default defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + reporter: [['html'], ['list']], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ diff --git a/test/e2e/tests/example.spec.ts b/test/e2e/tests/example.spec.ts deleted file mode 100644 index 54a906a4e..000000000 --- a/test/e2e/tests/example.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -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(); -}); diff --git a/test/e2e/tests/splashscreen.spec.ts b/test/e2e/tests/splashscreen.spec.ts new file mode 100644 index 000000000..6d7be789c --- /dev/null +++ b/test/e2e/tests/splashscreen.spec.ts @@ -0,0 +1,14 @@ +import { test, expect } from '@playwright/test'; +import { APPT_PROD_URL, APPT_PAGE_TITLE } from '../const/constants'; + +// verify main appointment splash screen appears +test.describe('splash screen', { + tag: '@prod-sanity' +}, () => { + test('has title', async ({ page }) => { + await page.goto(APPT_PROD_URL); + await expect(page).toHaveTitle(APPT_PAGE_TITLE); + }); + + // todo: more checks on splash screen appearance +});