Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed configuration test #952

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
test_setup:
name: Test setup
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
Expand All @@ -19,16 +19,16 @@ jobs:
needs: test_setup
name: Test
timeout-minutes: 60
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn
run: yarn install --immutable
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
run: yarn playwright install --with-deps chromium firefox webkit
- name: Run Playwright tests
run: yarn playwright test
env:
Expand Down
33 changes: 21 additions & 12 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,43 @@ import { defineConfig, devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
const PORT = process.env.PORT || 3000;

export default defineConfig({
testDir: 'tests',
outputDir: 'test-results',
timeout: 60000,
globalTimeout: 60000,
expect: {
timeout: 60000,
},
/* Run your local dev server before starting the tests */
webServer: process.env.CI
? undefined
: {
command: process.env.CI ? 'yarn build && yarn start' : 'yarn dev',
url: `http://localhost:${PORT}`,
reuseExistingServer: !process.env.CI,
timeout: 300000,
},
/* Run tests in files in parallel */
fullyParallel: true,
fullyParallel: !process.env.CI,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* 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: [['list'], ['html', { open: 'never' }]],
/* 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('/')`. */
// baseURL: 'http://127.0.0.1:3000',
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000',
baseURL: process.env.CI ? process.env.PLAYWRIGHT_TEST_BASE_URL : `http://localhost:${PORT}`,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
navigationTimeout: 60000,
},

/* Configure projects for major browsers */
Expand Down Expand Up @@ -67,12 +84,4 @@ export default defineConfig({
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
// command: process.env.CI ? 'yarn build && yarn start' : 'yarn dev',
command: 'yarn dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
});
Loading