From ef2abea2b307b795b5f1c4dd075f06ab3394bb18 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Mon, 23 Jun 2025 09:22:45 +0100 Subject: [PATCH 1/7] test: Adding simple test cases as a foundation for e2e tests for React Native --- example/e2e/maestro/android/open-help-center.yaml | 11 +++++++++++ example/e2e/maestro/android/open-messenger.yaml | 10 ++++++++++ example/e2e/maestro/ios/open-help-center.yaml | 11 +++++++++++ example/e2e/maestro/ios/open-messenger.yaml | 10 ++++++++++ 4 files changed, 42 insertions(+) create mode 100644 example/e2e/maestro/android/open-help-center.yaml create mode 100644 example/e2e/maestro/android/open-messenger.yaml create mode 100644 example/e2e/maestro/ios/open-help-center.yaml create mode 100644 example/e2e/maestro/ios/open-messenger.yaml diff --git a/example/e2e/maestro/android/open-help-center.yaml b/example/e2e/maestro/android/open-help-center.yaml new file mode 100644 index 00000000..9dacb5c6 --- /dev/null +++ b/example/e2e/maestro/android/open-help-center.yaml @@ -0,0 +1,11 @@ +appId: com.example.intercomreactnative +tags: + - android + - help-center +--- +- launchApp +- tapOn: "Login as an Unidentified User" +- tapOn: "Present Help Center" +- assertVisible: "Help" +- assertVisible: "Intercom Overview" +- tapOn: "Intercom Overview" diff --git a/example/e2e/maestro/android/open-messenger.yaml b/example/e2e/maestro/android/open-messenger.yaml new file mode 100644 index 00000000..767d8608 --- /dev/null +++ b/example/e2e/maestro/android/open-messenger.yaml @@ -0,0 +1,10 @@ +appId: com.example.intercomreactnative +tags: + - android + - messenger +--- +- launchApp +- tapOn: "Login as an Unidentified User" +- tapOn: "Present Intercom" +- tapOn: "Messages" + diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/e2e/maestro/ios/open-help-center.yaml new file mode 100644 index 00000000..82622cdc --- /dev/null +++ b/example/e2e/maestro/ios/open-help-center.yaml @@ -0,0 +1,11 @@ +appId: com.example.intercomreactnative +tags: + - ios + - help-center +--- +- launchApp +- tapOn: "Login as an Unidentified User" +- tapOn: "Present Help Center" +- assertVisible: "Help" +- assertVisible: "Untitled collection" +- tapOn: "Untitled collection" diff --git a/example/e2e/maestro/ios/open-messenger.yaml b/example/e2e/maestro/ios/open-messenger.yaml new file mode 100644 index 00000000..5a351f1b --- /dev/null +++ b/example/e2e/maestro/ios/open-messenger.yaml @@ -0,0 +1,10 @@ +appId: com.example.intercomreactnative +tags: + - ios + - messenger +--- +- launchApp +- tapOn: "Login as an Unidentified User" +- tapOn: "Present Intercom" +- tapOn: "Messenger apps" + From 0923e6531f4f0cc87fe3c0a96458516dcf7a9ec8 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 08:34:44 +0100 Subject: [PATCH 2/7] chore: adding dependency for meastro --- example/e2e/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/example/e2e/package.json b/example/e2e/package.json index afeac650..bab47d9c 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -25,6 +25,7 @@ "@wdio/mocha-framework": "^7.7.3", "@wdio/spec-reporter": "^9.5.0", "chromedriver": "^131.0.4", + "maestro-cli": "^1.0.6", "ts-node": "^10.0.0", "typescript": "^4.3.2", "wdio-chromedriver-service": "^8.1.1" From 4ec78b79687d5892ce37a3e40e8f55d7b23b87d6 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 14:42:03 +0100 Subject: [PATCH 3/7] none: adding correct maestro install --- example/e2e/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/e2e/package.json b/example/e2e/package.json index bab47d9c..5a893433 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -7,7 +7,8 @@ "build:android": "../android/gradlew assembleFossRelease -p ../android", "build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build", "test:android": "npx wdio ./wdio.android.conf.ts", - "test:ios": "npx wdio ./wdio.ios.conf.ts" + "test:ios": "npx wdio ./wdio.ios.conf.ts", + "maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash" }, "keywords": [], "author": "", From bf0e0dca46bb2bca9ccae5d8c818da40ddae8f30 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 14:47:29 +0100 Subject: [PATCH 4/7] none: removing old dep --- example/e2e/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/example/e2e/package.json b/example/e2e/package.json index 5a893433..4c0b4832 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -26,7 +26,6 @@ "@wdio/mocha-framework": "^7.7.3", "@wdio/spec-reporter": "^9.5.0", "chromedriver": "^131.0.4", - "maestro-cli": "^1.0.6", "ts-node": "^10.0.0", "typescript": "^4.3.2", "wdio-chromedriver-service": "^8.1.1" From 9c9289266c489e6a642f5658e2db9b4bde9fa79f Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 15:31:11 +0100 Subject: [PATCH 5/7] refactor: moving tests into new directory and moving maestro installation into setup script --- example/e2e/package.json | 1 - .../maestro/android/open-help-center.yaml | 4 ++-- .../maestro/android/open-messenger.yaml | 4 ++-- .../maestro/ios/open-help-center.yaml | 0 .../maestro/ios/open-messenger.yaml | 0 script/setup | 23 +++++++++++++++---- 6 files changed, 22 insertions(+), 10 deletions(-) rename example/{e2e => test}/maestro/android/open-help-center.yaml (72%) rename example/{e2e => test}/maestro/android/open-messenger.yaml (63%) rename example/{e2e => test}/maestro/ios/open-help-center.yaml (100%) rename example/{e2e => test}/maestro/ios/open-messenger.yaml (100%) diff --git a/example/e2e/package.json b/example/e2e/package.json index 4c0b4832..48e1bd5a 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -8,7 +8,6 @@ "build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build", "test:android": "npx wdio ./wdio.android.conf.ts", "test:ios": "npx wdio ./wdio.ios.conf.ts", - "maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash" }, "keywords": [], "author": "", diff --git a/example/e2e/maestro/android/open-help-center.yaml b/example/test/maestro/android/open-help-center.yaml similarity index 72% rename from example/e2e/maestro/android/open-help-center.yaml rename to example/test/maestro/android/open-help-center.yaml index 9dacb5c6..68001e49 100644 --- a/example/e2e/maestro/android/open-help-center.yaml +++ b/example/test/maestro/android/open-help-center.yaml @@ -7,5 +7,5 @@ tags: - tapOn: "Login as an Unidentified User" - tapOn: "Present Help Center" - assertVisible: "Help" -- assertVisible: "Intercom Overview" -- tapOn: "Intercom Overview" +- assertVisible: "Untitled Collection" +- tapOn: "Untitled Collection" diff --git a/example/e2e/maestro/android/open-messenger.yaml b/example/test/maestro/android/open-messenger.yaml similarity index 63% rename from example/e2e/maestro/android/open-messenger.yaml rename to example/test/maestro/android/open-messenger.yaml index 767d8608..62ee64fb 100644 --- a/example/e2e/maestro/android/open-messenger.yaml +++ b/example/test/maestro/android/open-messenger.yaml @@ -1,4 +1,4 @@ -appId: com.example.intercomreactnative +git appId: com.example.intercomreactnative tags: - android - messenger @@ -6,5 +6,5 @@ tags: - launchApp - tapOn: "Login as an Unidentified User" - tapOn: "Present Intercom" -- tapOn: "Messages" +- tapOn: "Messenger Apps" diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/test/maestro/ios/open-help-center.yaml similarity index 100% rename from example/e2e/maestro/ios/open-help-center.yaml rename to example/test/maestro/ios/open-help-center.yaml diff --git a/example/e2e/maestro/ios/open-messenger.yaml b/example/test/maestro/ios/open-messenger.yaml similarity index 100% rename from example/e2e/maestro/ios/open-messenger.yaml rename to example/test/maestro/ios/open-messenger.yaml diff --git a/script/setup b/script/setup index aada7798..b2bb3377 100755 --- a/script/setup +++ b/script/setup @@ -13,7 +13,7 @@ CYAN='\033[0;36m' NC='\033[0m' # No Color # Progress tracking -TOTAL_STEPS=8 +TOTAL_STEPS=9 CURRENT_STEP=0 START_TIME=$(date +%s) @@ -31,7 +31,7 @@ function step_start() { CURRENT_STEP=$((CURRENT_STEP + 1)) local step_name="$1" local icon="$2" - + echo "${CYAN}┌─ Step ${CURRENT_STEP}/${TOTAL_STEPS} ────────────────────────────────────────────────┐${NC}" echo "${CYAN}│${NC} ${icon} ${step_name}" echo "${CYAN}└─────────────────────────────────────────────────────────────┘${NC}" @@ -62,7 +62,7 @@ function show_progress() { local percentage=$((CURRENT_STEP * 100 / TOTAL_STEPS)) local filled=$((CURRENT_STEP * 50 / TOTAL_STEPS)) local empty=$((50 - filled)) - + printf "${CYAN}Progress: [${NC}" printf "%${filled}s" | tr ' ' '█' printf "%${empty}s" | tr ' ' '░' @@ -74,7 +74,7 @@ function final_summary() { local duration=$((end_time - START_TIME)) local minutes=$((duration / 60)) local seconds=$((duration % 60)) - + echo "\n${GREEN}┌─────────────────────────────────────────────────────────────┐${NC}" echo "${GREEN}│ 🎉 Setup Complete! 🎉 │${NC}" echo "${GREEN}└─────────────────────────────────────────────────────────────┘${NC}" @@ -181,7 +181,20 @@ cd - step_success "iOS dependencies installed" show_progress -# Step 8: Final Setup +# Step 8: Install Maestro +step_start "Installing Maestro" "🧪" +if ! [ -x "$(command -v maestro)" ]; then + curl -Ls "https://get.maestro.mobile.dev" | bash + export PATH="$PATH:$HOME/.maestro/bin" + step_success "Maestro installed successfully" +else + step_info "Checking Maestro version..." + maestro -v + step_success "Maestro is already installed" +fi +show_progress + +# Step 9: Final Setup step_start "Finalizing setup" "🏁" step_success "Setup completed successfully" show_progress From 25d39242f774e736aa0008c222fb08b5fb932a86 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 15:32:29 +0100 Subject: [PATCH 6/7] chore: removing extra comma --- example/e2e/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/e2e/package.json b/example/e2e/package.json index 48e1bd5a..afeac650 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -7,7 +7,7 @@ "build:android": "../android/gradlew assembleFossRelease -p ../android", "build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build", "test:android": "npx wdio ./wdio.android.conf.ts", - "test:ios": "npx wdio ./wdio.ios.conf.ts", + "test:ios": "npx wdio ./wdio.ios.conf.ts" }, "keywords": [], "author": "", From 53140970280dfc4835b0c2692a8b676e843dae5a Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 15:41:47 +0100 Subject: [PATCH 7/7] test: adjusting setup test to reflect changes to script --- __tests__/setup.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__tests__/setup.test.js b/__tests__/setup.test.js index 22269a02..d88abbf4 100644 --- a/__tests__/setup.test.js +++ b/__tests__/setup.test.js @@ -51,7 +51,7 @@ describe('Setup Script', () => { const content = fs.readFileSync(setupScriptPath, 'utf8'); // Check for progress tracking - expect(content).toContain('TOTAL_STEPS=8'); + expect(content).toContain('TOTAL_STEPS=9'); expect(content).toContain('CURRENT_STEP=0'); expect(content).toContain('START_TIME='); }); @@ -67,7 +67,8 @@ describe('Setup Script', () => { expect(content).toContain('Step 5: Yarn Package Manager'); expect(content).toContain('Step 6: Project Dependencies'); expect(content).toContain('Step 7: iOS Dependencies'); - expect(content).toContain('Step 8: Final Setup'); + expect(content).toContain('Step 8: Install Maestro'); + expect(content).toContain('Step 9: Final Setup'); }); test('setup script should have enhanced user feedback', () => {