From fd0ef25209ed0224946b8c8ce093337ad0a49898 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:32:19 -0400 Subject: [PATCH] test(percy): Add back (abbreviated) Calltaker tests. --- .github/workflows/percy.yml | 18 +++++++++++++++++- percy/percy.test.js | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/percy.yml b/.github/workflows/percy.yml index 1b8c68c16..ae53907d2 100644 --- a/.github/workflows/percy.yml +++ b/.github/workflows/percy.yml @@ -27,6 +27,7 @@ jobs: env: PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_MOCKOTP2_CONFIG_URL_METRO_MODE_SELECTOR }} - name: Build OTP-RR + # Artifacts are shared between desktop and mobile tests (but not call-taker). run: yarn build env: YAML_CONFIG: /tmp/otp2config.yml @@ -36,4 +37,19 @@ jobs: env: PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_OTP2 }} OTP_RR_UI_MODE: desktop - # TODO: Reinstate calltaker UI tests. + - name: Take Percy Snapshots (Mobile) + run: npx percy exec -- npx jest percy/percy.test.js --force-exit + env: + PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_OTP2 }} + OTP_RR_UI_MODE: mobile + # Calltaker has a separate config file, so another build should be produced. + - name: Build OTP-RR Calltaker + run: yarn build + env: + YAML_CONFIG: /tmp/otp2config.yml + JS_CONFIG: ./percy/har-mock-config-call-taker.js + - name: Take Percy Snapshots (Calltaker) + run: npx percy exec -- npx jest percy/percy.test.js --force-exit + env: + PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_OTP2 }} + OTP_RR_UI_MODE: calltaker diff --git a/percy/percy.test.js b/percy/percy.test.js index a1033402b..bc1457fcb 100644 --- a/percy/percy.test.js +++ b/percy/percy.test.js @@ -207,6 +207,9 @@ async function executeTest(page, isMobile, isCallTaker) { // take screenshot await percySnapshotWithWait(page, 'Call Taker With Settings Adjusted') + + // Other steps are identical to desktop, so we end here to not waste screenshots. + return } // Select a trip