diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 0bfbebf..55143d4 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -22,7 +22,13 @@ jobs: node-version: '21' - name: install playwright and run tests - run: | + run: | npm install -g yarn && yarn yarn playwright install --with-deps yarn playwright test + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 7 diff --git a/playwright.config.ts b/playwright.config.ts index 0f4d76b..7b58d82 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -20,7 +20,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: process.env.CI ? 'list' : 'html', + reporter: 'html', /* 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/tests/perusteestaAmmatillinenPutki.spec.ts b/tests/perusteestaAmmatillinenPutki.spec.ts index 481cfdd..7f1c632 100644 --- a/tests/perusteestaAmmatillinenPutki.spec.ts +++ b/tests/perusteestaAmmatillinenPutki.spec.ts @@ -82,6 +82,7 @@ test.describe('Uusi peruste ja perusteesta ammatillinen', async () => { await page.getByRole('button', { name: 'Sisällön kieli' }).click(); await page.getByRole('menuitem', { name: 'Svenska' }).click(); await page.getByRole('button', { name: 'Muokkaa' }).click(); + await waitSmall(page); await page.getByRole('group', { name: 'Tutkinnon osan nimi' }).getByRole('textbox').fill('Testiosa sv'); await page.getByRole('button', { name: 'Tallenna' }).click(); await expect(page.locator('body')).toContainText('Tallennus onnistui');