Skip to content

Commit 1b5e6af

Browse files
committed
Update package.json to include Playwright version override and enhance GitHub Actions workflow by adding steps to clean npm cache and ensure a fresh installation of dependencies. Streamline Playwright browser installation process and simplify test execution command.
1 parent f00f099 commit 1b5e6af

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/deployment.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,23 @@ jobs:
3030
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
3131
restore-keys: |
3232
${{ runner.os }}-node-
33+
# Clear npm cache and remove node_modules to ensure clean install
34+
- name: Clean npm cache
35+
run: |
36+
npm cache clean --force
37+
rm -rf node_modules
38+
# Install dependencies with a clean slate
3339
- name: Install dependencies
3440
run: |
3541
npm install
36-
npm install --save-dev @web/test-runner @web/test-runner-playwright @web/dev-server-esbuild @open-wc/testing
37-
- name: Install Playwright
42+
npm install -g playwright
43+
# Install browsers after playwright is installed globally
44+
- name: Install Playwright browsers
3845
run: |
39-
npx playwright install
40-
npx playwright install-deps
46+
playwright install
47+
playwright install-deps
4148
- name: Run tests
42-
run: npx web-test-runner test/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit && npx web-test-runner test/visual/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit
49+
run: npm test
4350
test_win:
4451
name: "Windows"
4552
runs-on: windows-latest

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"*.js": [
101101
"eslint --fix"
102102
]
103+
},
104+
"overrides": {
105+
"playwright": "1.25.2"
103106
}
104107
}

0 commit comments

Comments
 (0)