Skip to content

Commit

Permalink
refactor: (WIP) using just chrome while getting things working
Browse files Browse the repository at this point in the history
  • Loading branch information
uchilaka committed Apr 2, 2024
1 parent c077524 commit 08ce8e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,30 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV

# See https://dev.to/ayomiku222/how-to-cache-playwright-browser-on-github-actions-51o6
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Install dependencies
run: npm ci

- name: Install Playwright Browsers
run: npx playwright install chrome firefox webkit
run: npx playwright install chrome
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Generate mock audit report (default options)
run: cat ${{ github.workspace }}/.playwright/fixtures/npm-audit.json | ./src/index.js --folder ${{ github.workspace }}/.reports --file npm-audit.html

- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
Expand Down
18 changes: 10 additions & 8 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ module.exports = defineConfig({
use: { ...devices["Desktop Chrome"] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
/* Test against Firefox. */
// {
// name: "firefox",
// use: { ...devices["Desktop Firefox"] },
// },

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
/* Test against WebKit. */
// {
// name: "webkit",
// use: { ...devices["Desktop Safari"] },
// },

/* Test against mobile viewports. */
// {
Expand Down

0 comments on commit 08ce8e4

Please sign in to comment.