feat(e2e): port Behave/Appium UI tests + UITests mode in Example#48
Draft
mikemilla wants to merge 1 commit into
Draft
feat(e2e): port Behave/Appium UI tests + UITests mode in Example#48mikemilla wants to merge 1 commit into
mikemilla wants to merge 1 commit into
Conversation
Brings the iOS UIKit end-to-end tests from trycourier/mobile-automation-tests into this repo so they run against this Example app on PRs. - e2e/: Python/Behave/Appium suite (smoke.feature, smoke_push.feature, iOS screens, steps, courier_api util). install_apps.py adapted to build Example.xcodeproj on a CI-supplied IOS_UDID and write Env.swift from COURIER_AUTH_KEY (CocoaPods chmod dropped — Example is pure SPM). - Example/Example/UITests/: parallel UI flow gated by `-UITests` launch arg. Adds UITestsAuthVC (usernameInput + signInButton), UITestsComponentsVC (inboxButton / pushNotificationsButton / preferencesButton / signOutButton), inbox + edit-theme + push + preferences screens with the accessibility identifiers the Behave suite drives. Normal demo UI is unchanged. - AppDelegate sets `Courier.isUITestsActive = true` when launched with -UITests; SceneDelegate swaps the root VC accordingly. - .github/workflows/e2e-ios.yml: macos-latest, installs Appium 2 + xcuitest driver, boots a sim, runs `behave -t @iOS`, uploads artifacts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mikemilla
marked this pull request as draft
July 15, 2026 16:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
trycourier/mobile-automation-testsinto/e2ein this repo — Behave + Appium + Py-TestUI, iOS-only.-UITestsUI flow to the Example app (Example/Example/UITests/) so the existing Behave selectors resolve. Normal demo UI is unchanged.e2e-iosworkflow runs the suite onmacos-latestfor every PR: installs Appium 2 + xcuitest driver, boots a sim, runsbehave -t @iOS, uploads artifacts.What's in
/e2eFaithful copy of the iOS-relevant parts of
mobile-automation-tests:features/smoke.feature,features/smoke_push.featurefeatures/screens_ios/(selectors),features/screens_common/(base classes),features/steps/,features/utils/install_apps.py: buildsExample.xcodeproj(schemeExample, bundlecom.courier.ios-example), writesEnv.swiftfromCOURIER_AUTH_KEY, drops CocoaPods chmod (Example is pure SPM)IOS_UDIDenv override so CI can pass a freshly-booted simulator UDIDUITests mode in Example
Gated by
-UITestslaunch argument. When inactive, app behaves identically.AppDelegate: setsCourier.isUITestsActive = trueif launched with-UITestsSceneDelegate: swaps the storyboard tab bar for a programmaticUITestsAuthVC → UITestsComponentsVC → Inbox/Push/Preferences/EditThemeflowusernameInput,signInButton,inboxButton,pushNotificationsButton,preferencesButton,signOutButton,<kind>Inputrows, button titlesEdit/Close/Save/Request permissionPBXFileSystemSynchronizedRootGrouponExample/Example/UITests/— drop any.swiftin that folder and it auto-compiles, no per-file pbxproj editsWorkflow
.github/workflows/e2e-ios.ymlonmacos-latest:GoogleService-Info.plist(the real one is gitignored)IOS_UDIDpip install -r e2e/requirements.txtpython -m behave features -t @iOS -ke2e/features/artifacts/+e2e/logs/Trigger: PR to
main,workflow_dispatch, andrepository_dispatch: [iOS-UIKit].Required secrets
COURIER_AUTH_KEYEnv.swift(JWT minting) and also passed asCOURIER_API_KEYsoutils/courier_api.pycan hit/send. Must point at a workspace where templatesYV8XBE4N4X438RG0WT3Q42HSPQR7,4Z2A89Q7F149SHPP45YFB8C1WSYA,J5VKSSE0PXMFWFQAAZN7BBRZE49V,J08YK1WN2YMY6APMK1Q26JMK61ZEare publishedCOURIER_USER_ID,COURIER_CLIENT_KEY,COURIER_BRAND_ID,COURIER_PREFERENCE_TOPIC_ID,COURIER_MESSAGE_TEMPLATE_IDEnv.swiftfor parity withci.ymlKnown caveats
smoke_push.feature@iOS APNS scenario won't pass on a hosted-simulator runner — APNs delivery doesn't work there. The default tag filter is@iOSwhich picks up these scenarios; will need a real device or self-hosted runner to exercise. Inbox scenarios insmoke.featurework on simulator.GoogleService-Info.plist. Firebase will log init errors at runtime but won't crash. Swap in a real plist via a secret when you want FCM to actually work.runs-on: macos-latestto match the existingci.yml. If you'd rather use the self-hosted Mac runner thatmobile-automation-testsused, change one line.Test plan
COURIER_AUTH_KEYsecret on the repoworkflow_dispatchfirst, watch the rune2e/features/artifacts/screenshots/artifact uploaded on failure-UITestsfrom Xcode → sanity check the new flow works without breaking the normal demo UI🤖 Generated with Claude Code