Skip to content

Commit

Permalink
testing e2e (#193)
Browse files Browse the repository at this point in the history
- Moved all e2e testing to Playwright, moving away from Nightwatch
- No longer needed the e2e page, just using the kitchen sink page

Tests were failing with Nightwatch and I could not find any support as to why. It worked last Friday. Playwright seems much more supported and the current standard.
  • Loading branch information
sikhote authored Dec 10, 2024
1 parent 2a136c8 commit eeb1f87
Show file tree
Hide file tree
Showing 20 changed files with 242 additions and 2,803 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,14 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm run unit
- name: Run headless test
uses: coactions/setup-xvfb@v1
with:
run: npm run e2e
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm run unit
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ backstop_data/bitmaps_reference
backstop_data/bitmaps_backup
backstop_data/bitmaps_test
backstop_data/html_report
test/e2e/reports
test/unit/coverage
coverage/

Expand All @@ -55,4 +54,8 @@ unmigrated/
pages

# Ignore reports directory
/reports/
/reports/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ Runs unit tests.

Runs unit tests in watch mode. This also allows you to inspect snapshot discrepancies and regenerate the snapshots if appropriate.

`npm run e2e`
`npm run test:playwright`

Runs [Nightwatch](http://nightwatchjs.org/) end-to-end tests and Axe a11y tests.

Tests run using Chromedriver. To upgrade Chromedriver, determine the latest version of Chrome and Puppeteer that are compatible by visiting [this](https://pptr.dev/supported-browsers) page.
Runs [Playwright](https://playwright.dev) end-to-end tests and Axe a11y tests.

`npm run test`

Expand All @@ -67,3 +65,4 @@ This projects Changelogs are generated.
## Developer demo

The main documentation site for Cedar is our separate [Cedar docs](https://cedar.rei.com) website. With that in mind, we also have a playground for developing components and sharing ideas with others and within our team. The Cedar team produces this *developer demo* through GitHub Pages that can be accessed at [https://rei.github.io/rei-cedar/](https://rei.github.io/rei-cedar/), but we do not guarantee it will always be up to date or be an accurate representation of the Cedar library.

Loading

0 comments on commit eeb1f87

Please sign in to comment.