Skip to content

Commit ae37806

Browse files
refactor: moving tests to test folder and updating config
1 parent b0b26a8 commit ae37806

File tree

10 files changed

+34
-75
lines changed

10 files changed

+34
-75
lines changed

.circleci/config.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
version: 2.1
23

34
# Default VM config to be used for macOS builds
@@ -56,17 +57,13 @@ jobs:
5657
command: |
5758
corepack enable
5859
yarn install --cwd example
59-
yarn install --cwd example/e2e
6060
yarn install
6161
- save_cache:
6262
key: dependencies-{{ checksum "package.json" }}
6363
paths: node_modules
6464
- save_cache:
6565
key: dependencies-example-{{ checksum "example/package.json" }}
6666
paths: example/node_modules
67-
- save_cache:
68-
key: dependencies-example-e2e-{{ checksum "example/package.json" }}
69-
paths: example/e2e/node_modules
7067
- persist_to_workspace:
7168
root: .
7269
paths: .
@@ -131,14 +128,13 @@ jobs:
131128
- <<: *setup_env_file
132129

133130
- run:
134-
working_directory: example/e2e
135131
name: Install Maestro
136-
command: npm run maestro:install
132+
command: curl -Ls "https://get.maestro.mobile.dev" | bash
137133

138134
- run:
139-
working_directory: example/e2e
135+
working_directory: example/test
140136
name: Build android
141-
command: npm run build:android
137+
command: npm run build:android
142138

143139
- android/create-avd:
144140
avd-name: Android_29
@@ -156,7 +152,7 @@ jobs:
156152
adb install -r ~/project/example/android/app/build/outputs/apk/release/app-release.apk
157153
158154
- run:
159-
working_directory: example/e2e
155+
working_directory: example/test
160156
name: Run UI Tests
161157
command: npm run test:android
162158

@@ -177,7 +173,7 @@ jobs:
177173
- run:
178174
working_directory: example/e2e
179175
name: Install Maestro
180-
command: npm run maestro:install
176+
command: curl -Ls "https://get.maestro.mobile.dev" | bash
181177

182178
- restore_cache:
183179
keys:
@@ -193,7 +189,7 @@ jobs:
193189
- ~/project/example/ios/Pods
194190

195191
- run:
196-
working_directory: example/e2e
192+
working_directory: example/test
197193
name: Build
198194
command: npm run build:ios
199195

@@ -207,10 +203,10 @@ jobs:
207203
- run:
208204
name: Install app on simulator
209205
command: |
210-
xcrun simctl install booted ~/project/example/e2e/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app
206+
xcrun simctl install booted ~/project/example/test/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app
211207
212208
- run:
213-
working_directory: example/e2e
209+
working_directory: example/test
214210
name: Run UI Tests
215211
command: npm run test:ios
216212

example/e2e/maestro/android/open-help-center.yaml

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

example/e2e/maestro/android/open-messenger.yaml

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

example/e2e/maestro/ios/open-help-center.yaml

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

example/e2e/maestro/ios/open-messenger.yaml

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

example/test/maestro/android/open-help-center.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ tags:
55
---
66
- launchApp
77
- tapOn: "Login as an Unidentified User"
8+
- assertVisible:
9+
text: "Present Help Center"
10+
enabled: true
811
- tapOn: "Present Help Center"
912
- assertVisible: "Help"
1013
- assertVisible: "Untitled Collection"

example/test/maestro/android/open-messenger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
git appId: com.example.intercomreactnative
1+
appId: com.example.intercomreactnative
22
tags:
33
- android
44
- messenger

example/test/maestro/ios/open-help-center.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ tags:
55
---
66
- launchApp
77
- tapOn: "Login as an Unidentified User"
8+
- assertVisible:
9+
text: "Present Help Center"
10+
enabled: true
811
- tapOn: "Present Help Center"
9-
- assertVisible: "Help"
1012
- assertVisible: "Untitled collection"
1113
- tapOn: "Untitled collection"

example/test/maestro/ios/open-messenger.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ tags:
55
---
66
- launchApp
77
- tapOn: "Login as an Unidentified User"
8+
- assertVisible:
9+
text: "Present Intercom"
10+
enabled: true
811
- tapOn: "Present Intercom"
912
- tapOn: "Messenger apps"
10-

example/test/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "intercom-react-native-example-e2e-tests",
3+
"description": "Running",
4+
"version": "1.0.0",
5+
"main": "index.js",
6+
"scripts": {
7+
"build:android": "../android/gradlew assembleRelease -Pfoss -p ../android",
8+
"build:ios": "xcodebuild build -workspace ../ios/IntercomReactNativeExample.xcworkspace -scheme IntercomReactNativeExampleUI -configuration Release -sdk iphonesimulator -derivedDataPath ./build",
9+
"test:android": "maestro test ./maestro/android/*.yaml",
10+
"test:ios": "maestro test ./maestro/ios/*.yaml"
11+
},
12+
"keywords": [],
13+
"author": "",
14+
"license": "ISC"
15+
}

0 commit comments

Comments
 (0)