Skip to content

Commit

Permalink
chore: add report tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luizstacio committed Feb 20, 2024
1 parent c0f0a40 commit 5f71ebf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ contracts
**/__generated__/
**/generated/*
.changeset/**.md
**/playwright-results/
**/playwright-html/
4 changes: 3 additions & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ jobs:
if: always()
with:
name: playwright-report
path: packages/e2e-contract-tests/playwright-report/
path: |
packages/app/playwright-report/
packages/app/playwright-html/
retention-days: 30

- name: Stop Test Node
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ act-actions

# XState typegen
*.typegen.ts


playwright-results
playwright-html
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ pnpm-lock.yaml
**/__generated__/
**/generated/
.changeset/**.md
**/playwright-results/
**/playwright-html/
15 changes: 9 additions & 6 deletions packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PlaywrightTestConfig } from '@playwright/test';
import { defineConfig } from '@playwright/test';
import { join } from 'path';
import './load.envs';

Expand All @@ -7,11 +7,15 @@ const distDirectory = join(__dirname, './dist');
const IS_CI = !!process.env.CI;
const PORT = process.env.PORT;

const config: PlaywrightTestConfig = {
export default defineConfig({
workers: 1,
testMatch: join(__dirname, './playwright/**/*.test.ts'),
testDir: join(__dirname, './playwright/'),
reporter: [['list', { printSteps: true }]],
outputDir: join(__dirname, './playwright-results/'),
reporter: [
['list', { printSteps: true }],
['html', { outputFolder: join(__dirname, './playwright-html/') }],
],
// Retry tests on CI if they fail
retries: IS_CI ? 2 : 0,
webServer: {
Expand All @@ -23,7 +27,6 @@ const config: PlaywrightTestConfig = {
baseURL: `http://localhost:${PORT}/`,
permissions: ['clipboard-read', 'clipboard-write'],
headless: true,
trace: 'on-first-retry',
},
};

export default config;
});

0 comments on commit 5f71ebf

Please sign in to comment.