From ef2abea2b307b795b5f1c4dd075f06ab3394bb18 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Mon, 23 Jun 2025 09:22:45 +0100 Subject: [PATCH 01/41] 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 36b0685dc591dce75fe32dd087ea43a3a55ac36a Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Tue, 24 Jun 2025 15:26:03 +0100 Subject: [PATCH 02/41] feat: running tests as part of the pipeline --- .circleci/config.yml | 54 ++++++++++++++++++++++++++-------------- example/e2e/package.json | 8 +++--- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb0d3020..02b0b3c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,6 +125,11 @@ jobs: - <<: *setup_env_file + - run: + working_directory: example/e2e + name: Install Maestro + command: npm run maestro:install + - run: working_directory: example/e2e name: Build android @@ -145,6 +150,10 @@ jobs: name: Run UI Tests command: npm run test:android + - store_artifacts: + path: ~/.maestro/tests + destination: maestro-tests + # Build the Test App used for UI Testing and save is to the workspace. This allows it to be used by other jobs. ios-e2e-test: <<: *macos_config @@ -155,6 +164,11 @@ jobs: - <<: *setup_env_file + - run: + working_directory: example/e2e + name: Install Maestro + command: npm run maestro:install + - restore_cache: keys: - pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} @@ -177,6 +191,9 @@ jobs: name: Run UI Tests command: npm run test:ios + - store_artifacts: + path: ~/.maestro/tests + destination: maestro-tests release-to-npm: executor: default @@ -224,22 +241,23 @@ workflows: <<: *run_always requires: - install-dependencies - # - android-e2e-test: - # <<: *run_always - # requires: - # - install-dependencies - # - lint - # - typescript - # - unit-tests - # - build-package - # - ios-e2e-test: - # <<: *run_always - # requires: - # - install-dependencies - # - lint - # - typescript - # - unit-tests - # - build-package + - android-e2e-test: + <<: *run_always + requires: + - install-dependencies + - lint + - typescript + - unit-tests + - build-package + - ios-e2e-te st: + <<: *run_always + requires: + - install-dependencies + - lint + - typescript + - unit-tests + - build-package + - release-to-npm: <<: *run_on_release context: @@ -250,5 +268,5 @@ workflows: - typescript - unit-tests - build-package - # - ios-e2e-test - # - android-e2e-test + - ios-e2e-test + - android-e2e-test diff --git a/example/e2e/package.json b/example/e2e/package.json index afeac650..934bde65 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -4,10 +4,11 @@ "description": "", "main": "index.js", "scripts": { - "build:android": "../android/gradlew assembleFossRelease -p ../android", + "build:android": "../android/gradlew assembleRelease -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:android": "maestro test ./maestro/android/*.yaml", + "test:ios": "maestro test ./maestro/ios/*.yaml", + "maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash" }, "keywords": [], "author": "", @@ -25,6 +26,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 a1573a9cc5903b4f211a5164e63a3078f33aed0b Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Tue, 24 Jun 2025 15:29:44 +0100 Subject: [PATCH 03/41] chore: removing accidental space --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02b0b3c1..96c0628b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -249,7 +249,7 @@ workflows: - typescript - unit-tests - build-package - - ios-e2e-te st: + - ios-e2e-test: <<: *run_always requires: - install-dependencies From 1a398854cdd9be55fd9ff558846b6d8ef8729eb6 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Tue, 24 Jun 2025 16:06:27 +0100 Subject: [PATCH 04/41] feat: installing ruby version from .ruby-version --- .circleci/config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96c0628b..5a5f6858 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,6 +50,15 @@ jobs: - checkout - attach_project + # Use Ruby version from .ruby-version file + - run: + name: Set Ruby Version + command: | + RUBY_VERSION=$(cat .ruby-version) + rvm install $RUBY_VERSION + rvm use $RUBY_VERSION + gem install bundler + - run: name: Install dependencies command: | From cf68ea20999767a4c998b74f0fadced55e5710b6 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Tue, 24 Jun 2025 16:24:27 +0100 Subject: [PATCH 05/41] none: try installing a particular ruby version --- .circleci/config.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a5f6858..bfdba37f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,15 +50,6 @@ jobs: - checkout - attach_project - # Use Ruby version from .ruby-version file - - run: - name: Set Ruby Version - command: | - RUBY_VERSION=$(cat .ruby-version) - rvm install $RUBY_VERSION - rvm use $RUBY_VERSION - gem install bundler - - run: name: Install dependencies command: | @@ -171,6 +162,18 @@ jobs: - attach_workspace: at: ~/project + - run: + name: Install Ruby version + command: | + brew install rbenv ruby-build + RUBY_VERSION=$(cat .ruby-version) + + rbenv install -s $RUBY_VERSION + rbenv global $RUBY_VERSION + rbenv rehash + + gem install bundler + - <<: *setup_env_file - run: @@ -184,7 +187,10 @@ jobs: - run: working_directory: example/ios name: Install Pods - command: pod install + command: | + # Ensure we're using the correct Ruby version + eval "$(rbenv init -)" + pod install - save_cache: key: pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} paths: From 4601908def6483bd4f0833ba208ce0395c6222e9 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 08:27:17 +0100 Subject: [PATCH 06/41] none: adding cocoapods to fix error --- .circleci/config.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bfdba37f..2a76e8a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,17 +162,21 @@ jobs: - attach_workspace: at: ~/project + # Install Ruby and CocoaPods - run: - name: Install Ruby version + name: Install Ruby command: | brew install rbenv ruby-build - RUBY_VERSION=$(cat .ruby-version) + echo 'eval "$(rbenv init -)"' >> $BASH_ENV + source $BASH_ENV + RUBY_VERSION=$(cat .ruby-version) rbenv install -s $RUBY_VERSION rbenv global $RUBY_VERSION rbenv rehash gem install bundler + gem install cocoapods - <<: *setup_env_file @@ -188,8 +192,12 @@ jobs: working_directory: example/ios name: Install Pods command: | - # Ensure we're using the correct Ruby version + # Ensure we're using the correct Ruby environment eval "$(rbenv init -)" + # Verify pod command is available + which pod + pod --version + # Install pods pod install - save_cache: key: pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} From 8ef74f3f36b1d2d4d1978af984d5cdfdd67f1b01 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 09:20:44 +0100 Subject: [PATCH 07/41] none: trying to increase resources to run android test --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a76e8a0..42dab3af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,6 +115,7 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine + resource_class: large working_directory: ~/project steps: - checkout: @@ -161,8 +162,6 @@ jobs: - checkout - attach_workspace: at: ~/project - - # Install Ruby and CocoaPods - run: name: Install Ruby command: | From 4a670b9a56d65e12b039f9579c5c03a6610636a9 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 09:23:43 +0100 Subject: [PATCH 08/41] none: fixing error with resources --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42dab3af..197c3058 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,7 +115,7 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine - resource_class: large + resource_class: large working_directory: ~/project steps: - checkout: From 56e9d2c0a61907ab7346dbc29995c96a5fbb007a Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 09:28:05 +0100 Subject: [PATCH 09/41] none: trying to allocate resources to android-e2e-test --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 197c3058..8881ffcd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,7 +115,8 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine - resource_class: large + resource_class: medium + tag: default working_directory: ~/project steps: - checkout: From c824c94dead94dbe64d1b5672da46a1e865f06c2 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 09:30:29 +0100 Subject: [PATCH 10/41] none: increasing the android orb version --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8881ffcd..6ae17884 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ executors: working_directory: ~/project orbs: - android: circleci/android@1.0 + android: circleci/android@2.5.0 # Always run job run_always: &run_always @@ -115,8 +115,6 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine - resource_class: medium - tag: default working_directory: ~/project steps: - checkout: From 147da469bca162225da44d28bede13935e1df619 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 09:31:49 +0100 Subject: [PATCH 11/41] none: adding missing parameters --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ae17884..f5eba676 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,6 +115,8 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine + tag: 2023.07.1 + resource_class: medium working_directory: ~/project steps: - checkout: From 998a8fa9a6136ac943aad868f16603a52aab04db Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 09:32:43 +0100 Subject: [PATCH 12/41] none: reverting resource parameter as it is duplicated --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f5eba676..0733baed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -116,7 +116,6 @@ jobs: executor: name: android/android-machine tag: 2023.07.1 - resource_class: medium working_directory: ~/project steps: - checkout: From 3663aa8d43a6a7bb183925daebb0150668115463 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 10:17:51 +0100 Subject: [PATCH 13/41] none: trying to install correct ruby version --- .circleci/config.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0733baed..7f2a11be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,15 @@ version: 2.1 +setup_ruby: &setup_ruby + run: + name: Setup Ruby + command: | + echo "ruby-3.3.4" > ~/.ruby-version + source /opt/circleci/.circleci_bash_profile + ruby --version + gem install bundler + gem install cocoapods + # Default VM config to be used for macOS builds macos_config: &macos_config macos: @@ -20,7 +30,7 @@ executors: working_directory: ~/project orbs: - android: circleci/android@2.5.0 + android: circleci/android@1.0 # Always run job run_always: &run_always @@ -47,6 +57,7 @@ jobs: install-dependencies: <<: *macos_config steps: + - <<: *setup_ruby - checkout - attach_project @@ -115,9 +126,9 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine - tag: 2023.07.1 working_directory: ~/project steps: + - <<: *setup_ruby - checkout: path: ~/project @@ -162,20 +173,6 @@ jobs: - checkout - attach_workspace: at: ~/project - - run: - name: Install Ruby - command: | - brew install rbenv ruby-build - echo 'eval "$(rbenv init -)"' >> $BASH_ENV - source $BASH_ENV - - RUBY_VERSION=$(cat .ruby-version) - rbenv install -s $RUBY_VERSION - rbenv global $RUBY_VERSION - rbenv rehash - - gem install bundler - gem install cocoapods - <<: *setup_env_file From 00bf65d15d1868490bac5d59a6832267b6a50adc Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 10:23:22 +0100 Subject: [PATCH 14/41] none: trying to install correct ruby version using chruby --- .circleci/config.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f2a11be..3c0747c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,12 +3,7 @@ version: 2.1 setup_ruby: &setup_ruby run: name: Setup Ruby - command: | - echo "ruby-3.3.4" > ~/.ruby-version - source /opt/circleci/.circleci_bash_profile - ruby --version - gem install bundler - gem install cocoapods + command: sed -i '' 's/.*chruby ruby.*/chruby ruby-3.3.4/' ~/.bash_profile # Default VM config to be used for macOS builds macos_config: &macos_config From 59fd75fe914cc0253c9eb05db622bea20b416caf Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 10:31:34 +0100 Subject: [PATCH 15/41] none: adding setup ruby step to ios test job --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c0747c5..f3cf90ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,6 +165,7 @@ jobs: ios-e2e-test: <<: *macos_config steps: + - <<: *setup_ruby - checkout - attach_workspace: at: ~/project From 934bfc0179f0d291309f814862a4f53b0e8444a9 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 10:55:42 +0100 Subject: [PATCH 16/41] none: returning to original pod command --- .circleci/config.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3cf90ee..3371e2b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -183,14 +183,8 @@ jobs: - run: working_directory: example/ios name: Install Pods - command: | - # Ensure we're using the correct Ruby environment - eval "$(rbenv init -)" - # Verify pod command is available - which pod - pod --version - # Install pods - pod install + command: pod install + - save_cache: key: pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} paths: From 468bd2bc5b38de972f0e12febf1faf154cd9244f Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 11:05:29 +0100 Subject: [PATCH 17/41] none: trying to get pod install to work --- .circleci/config.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3371e2b0..12719422 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,7 +165,6 @@ jobs: ios-e2e-test: <<: *macos_config steps: - - <<: *setup_ruby - checkout - attach_workspace: at: ~/project @@ -181,9 +180,23 @@ jobs: keys: - pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} - run: - working_directory: example/ios - name: Install Pods - command: pod install + name: Set Ruby Version + command: sed -i '' 's/.*chruby ruby.*/chruby ruby-3.3.4/' ~/.bash_profile + - run: + name: Install Bundler + command: gem install bundler + - run: + name: Bundler + command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 + - run: + name: CocoaPods + command: | + cd Example + if bundle exec pod check; then + echo "Skipping pod install" + else + bundle exec pod install + fi - save_cache: key: pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} From 626affc37a68f5812c8ee12d7a9f0eb2b5fd0af0 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 11:20:11 +0100 Subject: [PATCH 18/41] none: reverting pod changes to original --- .circleci/config.yml | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 12719422..0a36989b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,5 @@ version: 2.1 -setup_ruby: &setup_ruby - run: - name: Setup Ruby - command: sed -i '' 's/.*chruby ruby.*/chruby ruby-3.3.4/' ~/.bash_profile - # Default VM config to be used for macOS builds macos_config: &macos_config macos: @@ -52,7 +47,6 @@ jobs: install-dependencies: <<: *macos_config steps: - - <<: *setup_ruby - checkout - attach_project @@ -123,7 +117,6 @@ jobs: name: android/android-machine working_directory: ~/project steps: - - <<: *setup_ruby - checkout: path: ~/project @@ -180,23 +173,9 @@ jobs: keys: - pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} - run: - name: Set Ruby Version - command: sed -i '' 's/.*chruby ruby.*/chruby ruby-3.3.4/' ~/.bash_profile - - run: - name: Install Bundler - command: gem install bundler - - run: - name: Bundler - command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 - - run: - name: CocoaPods - command: | - cd Example - if bundle exec pod check; then - echo "Skipping pod install" - else - bundle exec pod install - fi + working_directory: example/ios + name: Install Pods + command: pod install - save_cache: key: pod-dependencies-{{ checksum "~/project/example/ios/Podfile" }} From 0698ff41a77f2341f1ad1bab0ade75e42283e03c Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 11:34:37 +0100 Subject: [PATCH 19/41] none: trying to fix android resourcing --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a36989b..56bcbb09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ executors: working_directory: ~/project orbs: - android: circleci/android@1.0 + android: circleci/android@2.4.0 # Always run job run_always: &run_always @@ -115,6 +115,8 @@ jobs: JAVA_OPTS: '-Xms512m -Xmx1024m' executor: name: android/android-machine + resource-class: large + tag: 2021.10.1 working_directory: ~/project steps: - checkout: From fa8eb3b699e13364ef27cf85ceb6a61f3bcf7dbd Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 11:49:36 +0100 Subject: [PATCH 20/41] chore: bumping ruby and node versions --- .circleci/config.yml | 9 +++++++-- .ruby-version | 2 +- Gemfile | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56bcbb09..95f4fd5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,7 @@ executors: orbs: android: circleci/android@2.4.0 + node: circleci/node@5.1.0 # Always run job run_always: &run_always @@ -116,12 +117,13 @@ jobs: executor: name: android/android-machine resource-class: large - tag: 2021.10.1 + tag: default working_directory: ~/project steps: - checkout: path: ~/project - + - node/install: + node-version: '18.17.0' - attach_workspace: at: ~/project @@ -170,6 +172,9 @@ jobs: working_directory: example/e2e name: Install Maestro command: npm run maestro:install + - run: + name: Set Ruby Version + command: rbenv global 3.3.5 && rbenv rehash - restore_cache: keys: diff --git a/.ruby-version b/.ruby-version index a0891f56..fa7adc7a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.3.5 diff --git a/Gemfile b/Gemfile index 83284e46..93fc4a44 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '3.3.4' +ruby '3.3.5' gem 'activesupport', '~> 7.2' gem 'cocoapods', '~> 1.16' From 39d1997791387d96bc65aae5755c9a014249ce4b Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 12:03:45 +0100 Subject: [PATCH 21/41] chore: check ruby file and fix file path of index --- .circleci/config.yml | 13 +++++++++++-- example/android/app/build.gradle | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95f4fd5c..418e3d15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -173,8 +173,17 @@ jobs: name: Install Maestro command: npm run maestro:install - run: - name: Set Ruby Version - command: rbenv global 3.3.5 && rbenv rehash + name: Set Ruby Version + command: | + # Check available Ruby versions + rbenv versions + # Try to install Ruby 3.3.5 if not available + rbenv install 3.3.5 || true + # Set global Ruby version + rbenv global 3.3.5 + rbenv rehash + # Verify Ruby version + ruby --version - restore_cache: keys: diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 6d1cf5b2..d694c220 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -42,7 +42,7 @@ react { // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' - entryFile = file("index.tsx") + entryFile = file("../../index.tsx") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle From 908e914cd3dc4c937cc3d297b30704fb8f8ee659 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 12:37:14 +0100 Subject: [PATCH 22/41] none: checking emulator is up before running tests and installing ruby version for ios --- .circleci/config.yml | 27 ++++++++++++++++++--------- .ruby-version | 2 +- Gemfile | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 418e3d15..2c3658d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,6 @@ executors: orbs: android: circleci/android@2.4.0 - node: circleci/node@5.1.0 # Always run job run_always: &run_always @@ -117,13 +116,12 @@ jobs: executor: name: android/android-machine resource-class: large - tag: default + tag: 2021.10.1 working_directory: ~/project steps: - checkout: path: ~/project - - node/install: - node-version: '18.17.0' + - attach_workspace: at: ~/project @@ -149,6 +147,19 @@ jobs: no-window: true post-emulator-launch-assemble-command: echo Emulator Started + - run: + name: Wait for emulator to boot completely + command: | + # Wait for emulator to fully boot + adb wait-for-device + # Wait until the device is fully booted + BOOT_COMPLETED=$(adb shell getprop sys.boot_completed | tr -d '\r') + while [ "$BOOT_COMPLETED" != "1" ]; do + sleep 5 + BOOT_COMPLETED=$(adb shell getprop sys.boot_completed | tr -d '\r') + echo "Waiting for emulator to boot: $BOOT_COMPLETED" + done + - run: working_directory: example/e2e name: Run UI Tests @@ -175,12 +186,10 @@ jobs: - run: name: Set Ruby Version command: | - # Check available Ruby versions - rbenv versions - # Try to install Ruby 3.3.5 if not available - rbenv install 3.3.5 || true + # Try to install Ruby 3.3.4 if not available + rbenv install 3.3.4 || true # Set global Ruby version - rbenv global 3.3.5 + rbenv global 3.3.4 rbenv rehash # Verify Ruby version ruby --version diff --git a/.ruby-version b/.ruby-version index fa7adc7a..a0891f56 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.5 +3.3.4 diff --git a/Gemfile b/Gemfile index 93fc4a44..83284e46 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '3.3.5' +ruby '3.3.4' gem 'activesupport', '~> 7.2' gem 'cocoapods', '~> 1.16' From 8503d317bd3b41d9fa6b2129e45c69cf6c776a7b Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 13:32:30 +0100 Subject: [PATCH 23/41] none: readding node orb and setting ruby version to 3.3.0 --- .circleci/config.yml | 11 +---------- .ruby-version | 2 +- Gemfile | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c3658d2..102f0970 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,7 @@ executors: orbs: android: circleci/android@2.4.0 + node: circleci/node@5.1.0 # Always run job run_always: &run_always @@ -183,16 +184,6 @@ jobs: working_directory: example/e2e name: Install Maestro command: npm run maestro:install - - run: - name: Set Ruby Version - command: | - # Try to install Ruby 3.3.4 if not available - rbenv install 3.3.4 || true - # Set global Ruby version - rbenv global 3.3.4 - rbenv rehash - # Verify Ruby version - ruby --version - restore_cache: keys: diff --git a/.ruby-version b/.ruby-version index a0891f56..15a27998 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.3.0 diff --git a/Gemfile b/Gemfile index 83284e46..428fa8c5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '3.3.4' +ruby '3.3.0' gem 'activesupport', '~> 7.2' gem 'cocoapods', '~> 1.16' From 66e5ee8fa357e81ae98d83d8816149e3011af99c Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 13:52:21 +0100 Subject: [PATCH 24/41] none: listing available emulators as ios step cant find any --- .circleci/config.yml | 6 +++++- .ruby-version | 2 +- Gemfile | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 102f0970..27e84ddc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 # Default VM config to be used for macOS builds macos_config: &macos_config macos: - xcode: 15.3.0 + xcode: 16.0.0 resource_class: macos.m1.large.gen1 shell: /bin/bash --login -eo pipefail @@ -203,6 +203,10 @@ jobs: name: Build command: npm run build:ios + - run: + name: List available simulators + command: xcrun simctl list + - run: working_directory: example/e2e name: Run UI Tests diff --git a/.ruby-version b/.ruby-version index 15a27998..a0891f56 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.0 +3.3.4 diff --git a/Gemfile b/Gemfile index 428fa8c5..83284e46 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '3.3.0' +ruby '3.3.4' gem 'activesupport', '~> 7.2' gem 'cocoapods', '~> 1.16' From ecf24ca1401d56edfca59f917f5beeb127c047cb Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 14:19:03 +0100 Subject: [PATCH 25/41] none: trying to use older version of maestro --- .circleci/config.yml | 2 ++ example/e2e/package.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27e84ddc..8c50685a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,6 +122,8 @@ jobs: steps: - checkout: path: ~/project + - node/install: + node-version: '18.17.0' - attach_workspace: at: ~/project diff --git a/example/e2e/package.json b/example/e2e/package.json index 934bde65..1acb6fc3 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -8,7 +8,7 @@ "build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build", "test:android": "maestro test ./maestro/android/*.yaml", "test:ios": "maestro test ./maestro/ios/*.yaml", - "maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash" + "maestro:install": "export MAESTRO_VERSION=1.36.0; curl -Ls \"https://get.maestro.mobile.dev\" | bash" }, "keywords": [], "author": "", @@ -26,7 +26,7 @@ "@wdio/mocha-framework": "^7.7.3", "@wdio/spec-reporter": "^9.5.0", "chromedriver": "^131.0.4", - "maestro-cli": "^1.0.6", + "maestro-cli": "^1.40.3", "ts-node": "^10.0.0", "typescript": "^4.3.2", "wdio-chromedriver-service": "^8.1.1" From 6364fda3e6c499477fd3818929fc992f0423225d Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 14:21:00 +0100 Subject: [PATCH 26/41] none: reverting maestro dependency to see if it fixes the issue --- example/e2e/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example/e2e/package.json b/example/e2e/package.json index 1acb6fc3..43349557 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -8,7 +8,7 @@ "build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build", "test:android": "maestro test ./maestro/android/*.yaml", "test:ios": "maestro test ./maestro/ios/*.yaml", - "maestro:install": "export MAESTRO_VERSION=1.36.0; curl -Ls \"https://get.maestro.mobile.dev\" | bash" + "maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash" }, "keywords": [], "author": "", @@ -26,7 +26,6 @@ "@wdio/mocha-framework": "^7.7.3", "@wdio/spec-reporter": "^9.5.0", "chromedriver": "^131.0.4", - "maestro-cli": "^1.40.3", "ts-node": "^10.0.0", "typescript": "^4.3.2", "wdio-chromedriver-service": "^8.1.1" From 6530573d60917d6839eddf484aceef79c9fab0a9 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Wed, 25 Jun 2025 14:36:42 +0100 Subject: [PATCH 27/41] none: try listing maestro version and returning tag to default --- .circleci/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c50685a..b2ee2cb3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,13 +117,13 @@ jobs: executor: name: android/android-machine resource-class: large - tag: 2021.10.1 + tag: default working_directory: ~/project steps: - checkout: path: ~/project - node/install: - node-version: '18.17.0' + node-version: 18.17.0 - attach_workspace: at: ~/project @@ -209,6 +209,11 @@ jobs: name: List available simulators command: xcrun simctl list + - run: + working_directory: example/e2e + name: Check Maestro version + command: maestro -v + - run: working_directory: example/e2e name: Run UI Tests From 08464dc3af215188b9bcc251c950918bb5f31b87 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 08:55:33 +0100 Subject: [PATCH 28/41] feat: add steps to install ios app on emulator --- .circleci/config.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b2ee2cb3..db3a8464 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,6 +209,18 @@ jobs: name: List available simulators command: xcrun simctl list + - run: + name: Create and boot iPhone 15 simulator + command: | + echo "Creating iPhone 15 simulator with runtime $RUNTIME" + xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15 $RUNTIME + xcrun simctl boot "iPhone 15" || true + + - run: + name: Install app on simulator + command: | + xcrun simctl install booted ~/project/example/e2e/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app + - run: working_directory: example/e2e name: Check Maestro version From a0f0e98b6de61766c3c489ee292f76668acd50b9 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 09:22:20 +0100 Subject: [PATCH 29/41] test: adding a delay to allow for logging in --- example/e2e/maestro/ios/open-help-center.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/e2e/maestro/ios/open-help-center.yaml index 82622cdc..368d41c2 100644 --- a/example/e2e/maestro/ios/open-help-center.yaml +++ b/example/e2e/maestro/ios/open-help-center.yaml @@ -5,6 +5,7 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- sleep: 2000 - tapOn: "Present Help Center" - assertVisible: "Help" - assertVisible: "Untitled collection" From 9c0c7285b72e10fc740053e47fc5bbf03969ecb8 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 09:37:18 +0100 Subject: [PATCH 30/41] test: trying to fix ios help center test --- example/e2e/maestro/ios/open-help-center.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/e2e/maestro/ios/open-help-center.yaml index 368d41c2..dfebfcb5 100644 --- a/example/e2e/maestro/ios/open-help-center.yaml +++ b/example/e2e/maestro/ios/open-help-center.yaml @@ -5,8 +5,8 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" -- sleep: 2000 - tapOn: "Present Help Center" -- assertVisible: "Help" -- assertVisible: "Untitled collection" - tapOn: "Untitled collection" +- assertVisible: "Untitled collection" + + From 85103798673506e7542a5ed45fd2160a53642c46 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 10:39:59 +0100 Subject: [PATCH 31/41] test: check if present help center is enabled before tapping --- example/e2e/maestro/ios/open-help-center.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/e2e/maestro/ios/open-help-center.yaml index dfebfcb5..a0b79ce2 100644 --- a/example/e2e/maestro/ios/open-help-center.yaml +++ b/example/e2e/maestro/ios/open-help-center.yaml @@ -5,8 +5,11 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Help Center" + enabled: true - tapOn: "Present Help Center" -- tapOn: "Untitled collection" - assertVisible: "Untitled collection" +- tapOn: "Untitled collection" From f7e2784136c2c0099116c44abb8af4058213efa4 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 10:58:05 +0100 Subject: [PATCH 32/41] feat: adding android install step --- .circleci/config.yml | 21 ++----------------- .../e2e/maestro/android/open-help-center.yaml | 8 ++++--- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db3a8464..e5d9a1a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -151,17 +151,9 @@ jobs: post-emulator-launch-assemble-command: echo Emulator Started - run: - name: Wait for emulator to boot completely + name: Install app on emulator command: | - # Wait for emulator to fully boot - adb wait-for-device - # Wait until the device is fully booted - BOOT_COMPLETED=$(adb shell getprop sys.boot_completed | tr -d '\r') - while [ "$BOOT_COMPLETED" != "1" ]; do - sleep 5 - BOOT_COMPLETED=$(adb shell getprop sys.boot_completed | tr -d '\r') - echo "Waiting for emulator to boot: $BOOT_COMPLETED" - done + adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk - run: working_directory: example/e2e @@ -205,10 +197,6 @@ jobs: name: Build command: npm run build:ios - - run: - name: List available simulators - command: xcrun simctl list - - run: name: Create and boot iPhone 15 simulator command: | @@ -221,11 +209,6 @@ jobs: command: | xcrun simctl install booted ~/project/example/e2e/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app - - run: - working_directory: example/e2e - name: Check Maestro version - command: maestro -v - - run: working_directory: example/e2e name: Run UI Tests diff --git a/example/e2e/maestro/android/open-help-center.yaml b/example/e2e/maestro/android/open-help-center.yaml index 9dacb5c6..0275a049 100644 --- a/example/e2e/maestro/android/open-help-center.yaml +++ b/example/e2e/maestro/android/open-help-center.yaml @@ -5,7 +5,9 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Help Center" + enabled: true - tapOn: "Present Help Center" -- assertVisible: "Help" -- assertVisible: "Intercom Overview" -- tapOn: "Intercom Overview" +- assertVisible: "Untitled collection" +- tapOn: "Untitled collection" From 6a803607916f61c56335cac312ac70ae4554e67f Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 11:17:15 +0100 Subject: [PATCH 33/41] test: adding assertions to make android tests pass --- example/e2e/maestro/android/open-messenger.yaml | 3 +++ example/e2e/maestro/ios/open-messenger.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/example/e2e/maestro/android/open-messenger.yaml b/example/e2e/maestro/android/open-messenger.yaml index 767d8608..2c584f2a 100644 --- a/example/e2e/maestro/android/open-messenger.yaml +++ b/example/e2e/maestro/android/open-messenger.yaml @@ -5,6 +5,9 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Intercom" + enabled: true - tapOn: "Present Intercom" - tapOn: "Messages" diff --git a/example/e2e/maestro/ios/open-messenger.yaml b/example/e2e/maestro/ios/open-messenger.yaml index 5a351f1b..78a38393 100644 --- a/example/e2e/maestro/ios/open-messenger.yaml +++ b/example/e2e/maestro/ios/open-messenger.yaml @@ -5,6 +5,9 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Intercom" + enabled: true - tapOn: "Present Intercom" - tapOn: "Messenger apps" From 18e2ea7a2a38b722694c2dc93e4822326c523614 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 13:10:10 +0100 Subject: [PATCH 34/41] test: adding assertions to get android tests to pass --- example/e2e/maestro/android/open-help-center.yaml | 3 +++ example/e2e/maestro/android/open-messenger.yaml | 2 ++ example/e2e/maestro/ios/open-help-center.yaml | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/example/e2e/maestro/android/open-help-center.yaml b/example/e2e/maestro/android/open-help-center.yaml index 0275a049..7b213e8b 100644 --- a/example/e2e/maestro/android/open-help-center.yaml +++ b/example/e2e/maestro/android/open-help-center.yaml @@ -4,6 +4,9 @@ tags: - help-center --- - launchApp +- assertVisible: + text: "Login as an Unidentified User" + enabled: true - tapOn: "Login as an Unidentified User" - assertVisible: text: "Present Help Center" diff --git a/example/e2e/maestro/android/open-messenger.yaml b/example/e2e/maestro/android/open-messenger.yaml index 2c584f2a..40239be1 100644 --- a/example/e2e/maestro/android/open-messenger.yaml +++ b/example/e2e/maestro/android/open-messenger.yaml @@ -9,5 +9,7 @@ tags: text: "Present Intercom" enabled: true - tapOn: "Present Intercom" +- assertVisible: + text: "Messages" - tapOn: "Messages" diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/e2e/maestro/ios/open-help-center.yaml index a0b79ce2..ddf1cc99 100644 --- a/example/e2e/maestro/ios/open-help-center.yaml +++ b/example/e2e/maestro/ios/open-help-center.yaml @@ -6,8 +6,8 @@ tags: - launchApp - tapOn: "Login as an Unidentified User" - assertVisible: - text: "Present Help Center" - enabled: true + text: "Present Help Center" + enabled: true - tapOn: "Present Help Center" - assertVisible: "Untitled collection" - tapOn: "Untitled collection" From 817582ee20d5305a7545346f83cfef0181c916c2 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 13:44:35 +0100 Subject: [PATCH 35/41] none: trying to fix android app for android tests --- example/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index d694c220..ec618645 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -42,7 +42,7 @@ react { // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' - entryFile = file("../../index.tsx") + entryFile = file("../../../src/index.tsx") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle From b0b26a8d9888d91840da8259b2271d0081d1d560 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 13:52:21 +0100 Subject: [PATCH 36/41] none: reverting change to build.gradle --- example/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index ec618645..d694c220 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -42,7 +42,7 @@ react { // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' - entryFile = file("../../../src/index.tsx") + entryFile = file("../../index.tsx") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle From ae3780649db50e043b85c29da7253b8f3935e675 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 14:04:17 +0100 Subject: [PATCH 37/41] refactor: moving tests to test folder and updating config --- .circleci/config.yml | 22 ++++++++----------- .../e2e/maestro/android/open-help-center.yaml | 16 -------------- .../e2e/maestro/android/open-messenger.yaml | 15 ------------- example/e2e/maestro/ios/open-help-center.yaml | 15 ------------- example/e2e/maestro/ios/open-messenger.yaml | 13 ----------- .../maestro/android/open-help-center.yaml | 3 +++ .../test/maestro/android/open-messenger.yaml | 2 +- .../test/maestro/ios/open-help-center.yaml | 4 +++- example/test/maestro/ios/open-messenger.yaml | 4 +++- example/test/package.json | 15 +++++++++++++ 10 files changed, 34 insertions(+), 75 deletions(-) delete mode 100644 example/e2e/maestro/android/open-help-center.yaml delete mode 100644 example/e2e/maestro/android/open-messenger.yaml delete mode 100644 example/e2e/maestro/ios/open-help-center.yaml delete mode 100644 example/e2e/maestro/ios/open-messenger.yaml create mode 100644 example/test/package.json diff --git a/.circleci/config.yml b/.circleci/config.yml index e5d9a1a0..2d85018c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,4 @@ + version: 2.1 # Default VM config to be used for macOS builds @@ -56,7 +57,6 @@ jobs: command: | corepack enable yarn install --cwd example - yarn install --cwd example/e2e yarn install - save_cache: key: dependencies-{{ checksum "package.json" }} @@ -64,9 +64,6 @@ jobs: - save_cache: key: dependencies-example-{{ checksum "example/package.json" }} paths: example/node_modules - - save_cache: - key: dependencies-example-e2e-{{ checksum "example/package.json" }} - paths: example/e2e/node_modules - persist_to_workspace: root: . paths: . @@ -131,14 +128,13 @@ jobs: - <<: *setup_env_file - run: - working_directory: example/e2e name: Install Maestro - command: npm run maestro:install + command: curl -Ls "https://get.maestro.mobile.dev" | bash - run: - working_directory: example/e2e + working_directory: example/test name: Build android - command: npm run build:android + command: npm run build:android - android/create-avd: avd-name: Android_29 @@ -156,7 +152,7 @@ jobs: adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk - run: - working_directory: example/e2e + working_directory: example/test name: Run UI Tests command: npm run test:android @@ -177,7 +173,7 @@ jobs: - run: working_directory: example/e2e name: Install Maestro - command: npm run maestro:install + command: curl -Ls "https://get.maestro.mobile.dev" | bash - restore_cache: keys: @@ -193,7 +189,7 @@ jobs: - ~/project/example/ios/Pods - run: - working_directory: example/e2e + working_directory: example/test name: Build command: npm run build:ios @@ -207,10 +203,10 @@ jobs: - run: name: Install app on simulator command: | - xcrun simctl install booted ~/project/example/e2e/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app + xcrun simctl install booted ~/project/example/test/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app - run: - working_directory: example/e2e + working_directory: example/test name: Run UI Tests command: npm run test:ios diff --git a/example/e2e/maestro/android/open-help-center.yaml b/example/e2e/maestro/android/open-help-center.yaml deleted file mode 100644 index 7b213e8b..00000000 --- a/example/e2e/maestro/android/open-help-center.yaml +++ /dev/null @@ -1,16 +0,0 @@ -appId: com.example.intercomreactnative -tags: - - android - - help-center ---- -- launchApp -- assertVisible: - text: "Login as an Unidentified User" - enabled: true -- tapOn: "Login as an Unidentified User" -- assertVisible: - text: "Present Help Center" - enabled: true -- tapOn: "Present Help Center" -- assertVisible: "Untitled collection" -- tapOn: "Untitled collection" diff --git a/example/e2e/maestro/android/open-messenger.yaml b/example/e2e/maestro/android/open-messenger.yaml deleted file mode 100644 index 40239be1..00000000 --- a/example/e2e/maestro/android/open-messenger.yaml +++ /dev/null @@ -1,15 +0,0 @@ -appId: com.example.intercomreactnative -tags: - - android - - messenger ---- -- launchApp -- tapOn: "Login as an Unidentified User" -- assertVisible: - text: "Present Intercom" - enabled: true -- tapOn: "Present Intercom" -- assertVisible: - text: "Messages" -- tapOn: "Messages" - diff --git a/example/e2e/maestro/ios/open-help-center.yaml b/example/e2e/maestro/ios/open-help-center.yaml deleted file mode 100644 index ddf1cc99..00000000 --- a/example/e2e/maestro/ios/open-help-center.yaml +++ /dev/null @@ -1,15 +0,0 @@ -appId: com.example.intercomreactnative -tags: - - ios - - help-center ---- -- launchApp -- tapOn: "Login as an Unidentified User" -- assertVisible: - text: "Present Help Center" - enabled: true -- tapOn: "Present Help Center" -- assertVisible: "Untitled collection" -- tapOn: "Untitled collection" - - diff --git a/example/e2e/maestro/ios/open-messenger.yaml b/example/e2e/maestro/ios/open-messenger.yaml deleted file mode 100644 index 78a38393..00000000 --- a/example/e2e/maestro/ios/open-messenger.yaml +++ /dev/null @@ -1,13 +0,0 @@ -appId: com.example.intercomreactnative -tags: - - ios - - messenger ---- -- launchApp -- tapOn: "Login as an Unidentified User" -- assertVisible: - text: "Present Intercom" - enabled: true -- tapOn: "Present Intercom" -- tapOn: "Messenger apps" - diff --git a/example/test/maestro/android/open-help-center.yaml b/example/test/maestro/android/open-help-center.yaml index 68001e49..8c1ddd84 100644 --- a/example/test/maestro/android/open-help-center.yaml +++ b/example/test/maestro/android/open-help-center.yaml @@ -5,6 +5,9 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Help Center" + enabled: true - tapOn: "Present Help Center" - assertVisible: "Help" - assertVisible: "Untitled Collection" diff --git a/example/test/maestro/android/open-messenger.yaml b/example/test/maestro/android/open-messenger.yaml index 62ee64fb..ee5ebda9 100644 --- a/example/test/maestro/android/open-messenger.yaml +++ b/example/test/maestro/android/open-messenger.yaml @@ -1,4 +1,4 @@ -git appId: com.example.intercomreactnative +appId: com.example.intercomreactnative tags: - android - messenger diff --git a/example/test/maestro/ios/open-help-center.yaml b/example/test/maestro/ios/open-help-center.yaml index 82622cdc..7a4f045e 100644 --- a/example/test/maestro/ios/open-help-center.yaml +++ b/example/test/maestro/ios/open-help-center.yaml @@ -5,7 +5,9 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Help Center" + enabled: true - tapOn: "Present Help Center" -- assertVisible: "Help" - assertVisible: "Untitled collection" - tapOn: "Untitled collection" diff --git a/example/test/maestro/ios/open-messenger.yaml b/example/test/maestro/ios/open-messenger.yaml index 5a351f1b..941ba181 100644 --- a/example/test/maestro/ios/open-messenger.yaml +++ b/example/test/maestro/ios/open-messenger.yaml @@ -5,6 +5,8 @@ tags: --- - launchApp - tapOn: "Login as an Unidentified User" +- assertVisible: + text: "Present Intercom" + enabled: true - tapOn: "Present Intercom" - tapOn: "Messenger apps" - diff --git a/example/test/package.json b/example/test/package.json new file mode 100644 index 00000000..a4e6594e --- /dev/null +++ b/example/test/package.json @@ -0,0 +1,15 @@ +{ + "name": "intercom-react-native-example-e2e-tests", + "description": "Running", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "build:android": "../android/gradlew assembleRelease -Pfoss -p ../android", + "build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build", + "test:android": "maestro test ./maestro/android/*.yaml", + "test:ios": "maestro test ./maestro/ios/*.yaml" + }, + "keywords": [], + "author": "", + "license": "ISC" +} From 1e1b66718cca438cd30d0487304a79fd08397bf3 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 15:01:33 +0100 Subject: [PATCH 38/41] none: restored original e2e package.json, since it has been moved into test folder --- .circleci/config.yml | 3 +-- example/e2e/package.json | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d85018c..c4ac4118 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,3 @@ - version: 2.1 # Default VM config to be used for macOS builds @@ -134,7 +133,7 @@ jobs: - run: working_directory: example/test name: Build android - command: npm run build:android + command: npm run build:android - android/create-avd: avd-name: Android_29 diff --git a/example/e2e/package.json b/example/e2e/package.json index 43349557..afeac650 100644 --- a/example/e2e/package.json +++ b/example/e2e/package.json @@ -4,11 +4,10 @@ "description": "", "main": "index.js", "scripts": { - "build:android": "../android/gradlew assembleRelease -p ../android", + "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": "maestro test ./maestro/android/*.yaml", - "test:ios": "maestro test ./maestro/ios/*.yaml", - "maestro:install": "curl -Ls \"https://get.maestro.mobile.dev\" | bash" + "test:android": "npx wdio ./wdio.android.conf.ts", + "test:ios": "npx wdio ./wdio.ios.conf.ts" }, "keywords": [], "author": "", From 6d157c50a1435b1d0eadca4261a3740432efcb67 Mon Sep 17 00:00:00 2001 From: kilian-tennyson Date: Thu, 26 Jun 2025 15:48:16 +0100 Subject: [PATCH 39/41] test: testing on debug app --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4ac4118..0dec8796 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,7 +148,7 @@ jobs: - run: name: Install app on emulator command: | - adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk + adb install -r ~/project/example/android/app/build/outputs/apk/debug/app-debug.apk - run: working_directory: example/test From 7a2c72331c74c02a4fe33fb8cc470c2630df2f80 Mon Sep 17 00:00:00 2001 From: Uddish Verma Date: Thu, 26 Jun 2025 10:37:40 -0500 Subject: [PATCH 40/41] add logging --- .circleci/config.yml | 60 +++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dec8796..7c6deb31 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,6 @@ run_on_release: &run_on_release branches: ignore: /.*/ - commands: attach_project: steps: @@ -140,15 +139,41 @@ jobs: system-image: system-images;android-29;default;x86 install: true - - android/start-emulator: + - android/start-emulator: avd-name: Android_29 no-window: true post-emulator-launch-assemble-command: echo Emulator Started + - run: + name: Wait for emulator to finish booting + command: | + echo "⏳ Waiting for emulator to boot..." + adb wait-for-device + boot_completed="" + until [[ "$boot_completed" == "1" ]]; do + boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r') + echo "boot_completed=$boot_completed" + sleep 5 + done + echo "✅ Emulator boot complete" + + - run: + name: Log emulator + Intercom info + command: | + echo "🛰 Connected ADB devices:" + adb devices + + echo "📱 Installed packages:" + adb shell pm list packages | grep intercom || true + + echo "📜 Last 100 lines of logcat:" + adb logcat -d | tail -n 100 || true + - run: name: Install app on emulator command: | - adb install -r ~/project/example/android/app/build/outputs/apk/debug/app-debug.apk + adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk + - run: working_directory: example/test @@ -236,7 +261,6 @@ jobs: name: Publish the package command: npm publish - workflows: version: 2.1 build-and-test: @@ -260,21 +284,21 @@ workflows: requires: - install-dependencies - android-e2e-test: - <<: *run_always - requires: - - install-dependencies - - lint - - typescript - - unit-tests - - build-package + <<: *run_always + requires: + - install-dependencies + - lint + - typescript + - unit-tests + - build-package - ios-e2e-test: - <<: *run_always - requires: - - install-dependencies - - lint - - typescript - - unit-tests - - build-package + <<: *run_always + requires: + - install-dependencies + - lint + - typescript + - unit-tests + - build-package - release-to-npm: <<: *run_on_release From 7b3463c8d774d8b913eb660330d256cc905b2302 Mon Sep 17 00:00:00 2001 From: Uddish Verma Date: Thu, 26 Jun 2025 10:41:41 -0500 Subject: [PATCH 41/41] fix syntax --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c6deb31..867d2311 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -139,7 +139,7 @@ jobs: system-image: system-images;android-29;default;x86 install: true - - android/start-emulator: + - android/start-emulator: avd-name: Android_29 no-window: true post-emulator-launch-assemble-command: echo Emulator Started @@ -174,7 +174,6 @@ jobs: command: | adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk - - run: working_directory: example/test name: Run UI Tests