Skip to content

Commit

Permalink
metro mode selector-compatible percy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Apr 19, 2023
1 parent 8afa564 commit 999f83a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/percy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

jobs:
run-pixel-tests-with-otp1-real-server:
run-pixel-tests-with-otp2-real-server:
runs-on: ubuntu-latest

steps:
Expand All @@ -22,17 +22,17 @@ jobs:
node-version: 16.x
- name: Install npm packages using cache
uses: bahmutov/npm-install@v1
- name: Download OTP1 config file
run: curl $PERCY_OTP1_CONFIG_URL --output /tmp/otp1config.yml
- name: Download OTP2 config file
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
env:
PERCY_OTP1_CONFIG_URL: ${{ secrets.PERCY_OTP1_CONFIG_URL_METRO }}
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
- name: Take Percy Snapshots
# Move everything from latest commit back to staged
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_OTP_CONFIG_OVERRIDE: /tmp/otp1config.yml
run-pixel-tests-with-otp2-real-server:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_OTP2 }}
PERCY_OTP_CONFIG_OVERRIDE: /tmp/otp2config.yml
run-pixel-tests-with-otp2-real-server-mobile:
runs-on: ubuntu-latest

steps:
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Download OTP2 config file
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
env:
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO }}
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
- name: Take Percy Snapshots
# Move everything from latest commit back to staged
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Download OTP2 config file
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
env:
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO }}
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
- name: Take Percy Snapshots
# Move everything from latest commit back to staged
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
Expand Down
13 changes: 7 additions & 6 deletions percy/percy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,27 +279,28 @@ test('OTP-RR', async () => {

if (!OTP_RR_PERCY_CALL_TAKER) {
// Change the modes
await page.click('button[aria-label="Transit"]')
await page.click('label[title="Transit"]')
await page.click('#plan-trip')

await percySnapshotWithWait(page, 'Metro Itinerary No Transit')
// Restore transit
await page.click('button[aria-label="Transit"]')
await page.click('label[title="Transit"]')

// Change the time
await page.click('.summary')
await page.focus('input[type="time"]')
await page.keyboard.type('10')
await page.waitForTimeout(200)
// Check submode selector
await page.click('button[aria-label="Trip Settings"]')
await page.hover('label[title="Transit"]')
await page.waitForTimeout(500)
const [streetcarButton] = await page.$x("//span[contains(., 'Streetcar')]")
await streetcarButton.click()
await page.click('#id-query-param-addTram')

// Disable accessible routing
await page.hover('label[title="Transit"]')
await page.click('#id-query-param-wheelchair')
await percySnapshotWithWait(page, 'Metro Mode Selector Expanded')

await page.click('button[aria-label="Trip Settings"]')
await page.waitForTimeout(200)

await page.click('#plan-trip')
Expand Down

0 comments on commit 999f83a

Please sign in to comment.