Skip to content

Commit 9bdc4cd

Browse files
a7medevHeshamMegid
authored andcommitted
[MOB-12047] Migrate to Appium 2 (#346)
* Migrate to Appium 2 * Install Appium drivers separately * Choose Appium driver based on platform
1 parent bfbe7d7 commit 9bdc4cd

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

.circleci/config.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,34 @@ commands:
2323
working_directory: example/ios
2424
command: pod install --repo-update
2525
setup_captain:
26+
parameters:
27+
platform:
28+
type: enum
29+
enum:
30+
- ios
31+
- android
2632
steps:
2733
- run:
2834
name: Install Appium
29-
command: npm install -g appium
35+
command: npm install -g appium@next
36+
- when:
37+
condition:
38+
equal:
39+
- <<parameters.platform>>
40+
- ios
41+
steps:
42+
- run:
43+
name: Install XCUITest Driver
44+
command: appium driver install xcuitest
45+
- when:
46+
condition:
47+
equal:
48+
- <<parameters.platform>>
49+
- android
50+
steps:
51+
- run:
52+
name: Install UIAutomator2 Driver
53+
command: appium driver install uiautomator2
3054
- run:
3155
name: Launch Appium
3256
# Enable --relaxed-security for `mobile: shell` command that Captain uses internally.
@@ -43,6 +67,9 @@ commands:
4367
- run:
4468
name: Clone Captain
4569
command: git clone [email protected]:Instabug/Captain.git ../Instabug.Captain
70+
- run:
71+
name: Configure Captain Platform
72+
command: echo 'export CAPTAIN_PLATFORM=<<parameters.platform>>' >> $BASH_ENV
4673

4774
jobs:
4875
danger:
@@ -91,13 +118,14 @@ jobs:
91118
tag: 2022.04.1
92119
steps:
93120
- checkout
94-
- setup_captain
121+
- setup_captain:
122+
platform: android
95123
- setup_flutter
96124
- android/start-emulator-and-run-tests:
97125
system-image: system-images;android-30;google_apis;x86
98126
additional-avd-args: -d "pixel_4"
99127
post-emulator-launch-assemble-command: cd example || true && flutter build apk --debug
100-
test-command: cd e2e || true && CAPTAIN_PLATFORM=android dotnet test
128+
test-command: cd e2e || true && dotnet test
101129

102130
test_ios:
103131
macos:
@@ -122,7 +150,8 @@ jobs:
122150
resource_class: large
123151
steps:
124152
- checkout
125-
- setup_captain
153+
- setup_captain:
154+
platform: ios
126155
- setup_ios
127156
- run:
128157
name: Build Example App
@@ -133,8 +162,6 @@ jobs:
133162
no_output_timeout: 30m
134163
working_directory: e2e
135164
command: dotnet test
136-
environment:
137-
CAPTAIN_PLATFORM: ios
138165

139166
format_flutter:
140167
docker:

0 commit comments

Comments
 (0)