diff --git a/README.md b/README.md index 00100586..8d7aae08 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ You can add the `--no-cache` flag to build from scratch. To run the container (best for development): ```bash -docker run -p 9090:9090 -it --name e2e --rm playwright +docker run -p 4321:4321 -it --name e2e --rm playwright ``` ```bash @@ -107,5 +107,5 @@ docker exec -it e2e pnpm playwright test To debug and follow the flow of a test in a browser, you can run: ```bash -pnpm playwright test --ui-port=8080 --ui-host=0.0.0.0 +export E2E_ENDPOINT=http://localhost:4321; pnpm playwright test --ui-port=8080 --ui-host=0.0.0.0 ``` \ No newline at end of file diff --git a/e2e/create.spec.ts b/e2e/create.spec.ts index c0e7883b..2516d9f6 100644 --- a/e2e/create.spec.ts +++ b/e2e/create.spec.ts @@ -1,4 +1,4 @@ -import { test, expect, Page } from '@playwright/test'; +import { test, expect, Page, Response } from '@playwright/test'; import { GuidedFormCreation, Create } from '../packages/design/src/FormManager/routes'; import { BASE_URL } from './constants'; @@ -10,6 +10,7 @@ const createNewForm = async (page: Page) => { } const getLocalStorageData = async (page: Page, token: string) => { + console.log(localStorage); const localStorageValue = await page.evaluate((token) => localStorage.getItem(token), token); return JSON.parse((localStorageValue as string)); }; @@ -19,6 +20,11 @@ const getPatternData = (storageData: any, pageNumber: number, patternIndex: numb return storageData.patterns[patternPage].data.patterns[patternIndex]; } +test('Open site', async ({ page }) => { + const response = await page.goto(`${BASE_URL}`); + await expect(response.ok()).toBe(true); +}); + test('Create form from scratch', async ({ page }) => { const createPage = new RegExp(`${uuidPattern}/${Create.slug}$`, 'i'); await createNewForm(page);