Skip to content

Commit 60cd61f

Browse files
committed
test(expo): verify theme delivery in a unit test; drop fragile pixel-check
The Maestro screenshot pixel-check for theming was unreliable: it asserted a hardcoded color against a screenshot whose primary-colored button is disabled (empty email field on a clean launch) and rendered at a degraded 320x640 CI emulator resolution — so it consistently 'failed' even though the theme applied. Per the layer split, @clerk/expo owns theme DELIVERY (the config plugin embeds the theme into iOS Info.plist + Android assets); the color RENDER is the native SDKs' responsibility. So: - Add a deterministic config-plugin unit test (appPlugin.theme.test.js) that runs withClerkTheme and asserts it embeds the parsed theme into the Info.plist mod and queues the Android assets mod — and is a no-op without a theme prop (the original 'bare @clerk/expo plugin string' regression). Runs in turbo test on every PR; no emulator, no screenshot. - Remove the theming Maestro flows, verify-themes.sh, check-theme-color.js, pngjs, the CI 'Verify theming' steps, and the runner post-steps.
1 parent 3106999 commit 60cd61f

12 files changed

Lines changed: 68 additions & 276 deletions

File tree

.github/workflows/mobile-e2e.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -597,15 +597,6 @@ jobs:
597597
| while read f; do grep -qE "^[[:space:]]*-[[:space:]]*(${pattern})[[:space:]]*$" "$f" || printf '%s\n' "$f"; done
598598
| xargs -n 1 -I FLOW bash -c 'flow="$1"; for a in 1 2; do if maestro test --env CLERK_TEST_EMAIL="$CLERK_TEST_EMAIL" --env CLERK_TEST_PASSWORD="$CLERK_TEST_PASSWORD" --flatten-debug-output "$flow"; then exit 0; fi; if [ "$a" -eq 2 ]; then echo "::error::Flow $flow failed after 2 attempts"; exit 1; fi; echo "::warning::Flow $flow failed attempt $a, retrying after 10s..."; adb shell am force-stop com.clerk.clerkexpoquickstart >/dev/null 2>&1 || true; sleep 10; done' _ FLOW
599599
600-
# Theme verification is a Node post-step (Maestro can't decode PNGs in its
601-
# JS sandbox). The theming flows wrote theme-light.png / theme-dark.png to
602-
# integration/mobile; this asserts each contains a large region of the
603-
# expected themed color. Runs on success OR failure so a flaked flow
604-
# doesn't hide a theming regression; skips cleanly if no theme shots exist.
605-
- name: Verify Android theming
606-
if: success() || failure()
607-
run: bash integration/mobile/scripts/verify-themes.sh
608-
609600
- name: Upload Maestro artifacts on failure or cancel
610601
if: failure() || cancelled()
611602
uses: actions/upload-artifact@v4
@@ -1039,13 +1030,6 @@ jobs:
10391030
done
10401031
' _ FLOW
10411032
1042-
# Theme verification is a Node post-step (Maestro can't decode PNGs in its
1043-
# JS sandbox). iOS runs the light theme only (dark-mode is androidOnly);
1044-
# verify-themes.sh skips any theme shot that wasn't produced.
1045-
- name: Verify iOS theming
1046-
if: success() || failure()
1047-
run: bash integration/mobile/scripts/verify-themes.sh
1048-
10491033
- name: Upload Maestro artifacts on failure or cancel
10501034
if: failure() || cancelled()
10511035
uses: actions/upload-artifact@v4

integration/mobile/flows/theming/custom-theme-applied.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

integration/mobile/flows/theming/dark-mode-applied.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

integration/mobile/scripts/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

integration/mobile/scripts/check-theme-color.js

Lines changed: 0 additions & 111 deletions
This file was deleted.

integration/mobile/scripts/package.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

integration/mobile/scripts/run-android.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,10 @@ if [[ ${#KEEP[@]} -eq 0 ]]; then
3838
exit 0
3939
fi
4040

41-
# Run maestro from integration/mobile so `takeScreenshot` files (theme-*.png)
42-
# land in a known place for the theme post-step below. KEEP[] are absolute
43-
# paths and subflows resolve relative to their flow file, so the cd is safe.
44-
cd "$FLOWS_DIR/.."
45-
46-
set +e
4741
maestro --platform android test \
4842
-e CLERK_TEST_EMAIL="${CLERK_TEST_EMAIL}" \
4943
-e CLERK_TEST_PASSWORD="${CLERK_TEST_PASSWORD}" \
5044
-e CLERK_TEST_EMAIL_SECONDARY="${CLERK_TEST_EMAIL_SECONDARY:-}" \
5145
-e CLERK_TEST_PASSWORD_SECONDARY="${CLERK_TEST_PASSWORD_SECONDARY:-}" \
5246
"$@" \
5347
"${KEEP[@]}"
54-
maestro_rc=$?
55-
set -e
56-
57-
# Verify theming on whatever screenshots the theming flows captured (Node
58-
# post-step; Maestro can't decode PNGs). A theme regression fails the run.
59-
"$SCRIPT_DIR/verify-themes.sh" || maestro_rc=1
60-
61-
exit "$maestro_rc"

integration/mobile/scripts/run-ios.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,10 @@ if [[ ${#KEEP[@]} -eq 0 ]]; then
4141
exit 0
4242
fi
4343

44-
# Run maestro from integration/mobile so `takeScreenshot` files (theme-*.png)
45-
# land in a known place for the theme post-step below. KEEP[] are absolute
46-
# paths and subflows resolve relative to their flow file, so the cd is safe.
47-
cd "$FLOWS_DIR/.."
48-
49-
set +e
5044
maestro --platform ios test \
5145
-e CLERK_TEST_EMAIL="${CLERK_TEST_EMAIL}" \
5246
-e CLERK_TEST_PASSWORD="${CLERK_TEST_PASSWORD}" \
5347
-e CLERK_TEST_EMAIL_SECONDARY="${CLERK_TEST_EMAIL_SECONDARY:-}" \
5448
-e CLERK_TEST_PASSWORD_SECONDARY="${CLERK_TEST_PASSWORD_SECONDARY:-}" \
5549
"$@" \
5650
"${KEEP[@]}"
57-
maestro_rc=$?
58-
set -e
59-
60-
# Verify theming on whatever screenshots the theming flows captured (Node
61-
# post-step; Maestro can't decode PNGs). A theme regression fails the run.
62-
"$SCRIPT_DIR/verify-themes.sh" || maestro_rc=1
63-
64-
exit "$maestro_rc"

integration/mobile/scripts/run-regressions.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ source "$SCRIPT_DIR/lib/filter-flows.sh"
1111

1212
# Note: google-sso-from-forgot-password and sign-in-sign-out-sign-in were moved
1313
# to flows/native-side/ (they primarily exercise native auth UI, which the
14-
# clerk-ios/clerk-android suites own). They no longer run as part of the Expo
15-
# regression set. See flows/native-side/README.md.
14+
# clerk-ios/clerk-android suites own). The theming flows were removed entirely:
15+
# theme *delivery* is now verified deterministically by the config-plugin unit
16+
# test (src/__tests__/appPlugin.theme.test.js), and the color *render* is the
17+
# native SDKs' responsibility — no fragile screenshot pixel-check.
1618
REGRESSION_FLOWS=(
1719
"$FLOWS_DIR/sign-in/get-help-loop-regression.yaml"
18-
"$FLOWS_DIR/theming/custom-theme-applied.yaml"
1920
"$FLOWS_DIR/smoke/cold-launch-no-flash.yaml"
2021
)
2122

integration/mobile/scripts/verify-themes.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)