From 999f83aa191e400534c21914331d00c660d9a5b9 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 19 Apr 2023 14:57:45 -0400 Subject: [PATCH] metro mode selector-compatible percy tests --- .github/workflows/percy.yml | 18 +++++++++--------- percy/percy.test.js | 13 +++++++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/percy.yml b/.github/workflows/percy.yml index 5dc6abc37..f18761699 100644 --- a/.github/workflows/percy.yml +++ b/.github/workflows/percy.yml @@ -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: @@ -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: @@ -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 @@ -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 diff --git a/percy/percy.test.js b/percy/percy.test.js index 7ccfbfbd3..ceffa31c2 100644 --- a/percy/percy.test.js +++ b/percy/percy.test.js @@ -279,12 +279,12 @@ 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') @@ -292,14 +292,15 @@ test('OTP-RR', async () => { 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')