Skip to content

Commit

Permalink
test: fix playwright config
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Sep 26, 2023
1 parent 0b1f245 commit 1f9606f
Show file tree
Hide file tree
Showing 7 changed files with 1,499 additions and 501 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ concurrency:
group: 'pages'
cancel-in-progress: true

env:
VITE_GROWTH_BOOK_KEY: ${{ secrets.VITE_GROWTH_BOOK_KEY }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -36,6 +33,8 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
env:
VITE_GROWTH_BOOK_KEY: ${{ secrets.VITE_GROWTH_BOOK_KEY }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
run: pnpm exec playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"@vitejs/plugin-react": "^4.0.1",
"@vitejs/plugin-react": "^4.1.0",
"autoprefixer": "^10.4.7",
"cssnano": "^6.0.1",
"eslint": "^8.47.0",
Expand All @@ -65,7 +65,7 @@
"storybook": "^7.1.0",
"tailwindcss": "^3.3.2",
"typescript": "^5.1.3",
"vite": "^4.4.7",
"vite": "^4.4.9",
"vite-plugin-pwa": "^0.16.4",
"vitest": "^0.34.2"
},
Expand Down
7 changes: 4 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const config: PlaywrightTestConfig = {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http:/localhost:4173/',
baseURL: 'http:/localhost:4173/local-microblogging-client/',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
Expand Down Expand Up @@ -101,8 +101,9 @@ const config: PlaywrightTestConfig = {

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
command: 'pnpm run build && pnpm run preview',
url: 'http://localhost:4173/local-microblogging-client/',
reuseExistingServer: !process.env.CI,
},
};

Expand Down
Loading

0 comments on commit 1f9606f

Please sign in to comment.