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

. #1350

Merged
merged 6 commits into from
Oct 23, 2024
Merged

. #1350

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
28 changes: 25 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,36 @@ jobs:
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build the project
run: npm run build
env:
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- name: Start the application
run: npm run start &
env:
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- name: Wait for the application to be ready
run: |
echo "Waiting for the application to be ready..."
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:3000)" != "200" ]]; do sleep 5; done' || false
echo "Application is ready!"
- name: Run Playwright tests
run: npx playwright test
env:
CI: true
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- uses: actions/upload-artifact@v4
CI: true
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
DEBUG: pw:api
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload test traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-traces
path: test-results/
retention-days: 30
102 changes: 60 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"framer-motion": "11.11.9",
"graphql": "^16.9.0",
"lodash": "^4.17.21",
"next": "^14.2.15",
"next": "^14.2.16",
"nprogress": "^0.2.0",
"postcss": "^8.4.47",
"react": "^18.3.1",
Expand All @@ -49,7 +49,7 @@
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"babel-plugin-styled-components": "^2.1.4",
"eslint-config-next": "^14.2.15",
"eslint-config-next": "^14.2.16",
"postcss-preset-env": "^10.0.7",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.14",
Expand Down
7 changes: 4 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { devices } from '@playwright/test';
const config: PlaywrightTestConfig = {
testDir: './src/tests',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
timeout: 60 * 1000, // Increased to 60 seconds
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 15000,
timeout: 30000, // Increased to 30 seconds
},
/* Run tests in files in parallel */
fullyParallel: true,
Expand All @@ -33,7 +33,7 @@ const config: PlaywrightTestConfig = {
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
actionTimeout: 30000, // Added 30 second timeout for actions
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:3000',

Expand Down Expand Up @@ -103,6 +103,7 @@ const config: PlaywrightTestConfig = {
reuseExistingServer: true,
command: 'npm run dev',
port: 3000,
timeout: 120000, // Added 2 minute timeout for server start
},
};

Expand Down
Loading
Loading