-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathazure-pipelines.yml
70 lines (67 loc) · 3.38 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Gradle
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- main
variables:
ANDROID_EMU_NAME: test
ANDROID_EMU_ABI: x86
ANDROID_EMU_TARGET: android-28
ANDROID_EMU_TAG: default
XCODE_VERSION: 14.2
IOS_PLATFORM_VERSION: 16.2
IOS_DEVICE_NAME: iPhone 12
NODE_VERSION: 18.x
JDK_VERSION: 1.8
jobs:
- job: Android_E2E_Tests
pool:
vmImage: 'macOS-latest'
steps:
- template: .azure-template/bootstrap.yml
- script: $NVM_DIR/versions/node/`node --version`/bin/appium driver install uiautomator2
displayName: Install UIA2 driver
- script: |
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;$(ANDROID_EMU_TARGET);$(ANDROID_EMU_TAG);$(ANDROID_EMU_ABI)'
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n "$(ANDROID_EMU_NAME)" -k 'system-images;$(ANDROID_EMU_TARGET);$(ANDROID_EMU_TAG);$(ANDROID_EMU_ABI)' --force
echo $ANDROID_HOME/emulator/emulator -list-avds
echo "Starting emulator"
nohup $ANDROID_HOME/emulator/emulator -avd "$(ANDROID_EMU_NAME)" -no-snapshot -delay-adb > /dev/null 2>&1 & $ANDROID_HOME/platform-tools/adb wait-for-any-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
echo '---'
echo '---'
$ANDROID_HOME/platform-tools/adb wait-for-device
$ANDROID_HOME/platform-tools/adb devices -l
echo "Emulator started"
displayName: Emulator configuration
- script: |
npm ci
$NVM_DIR/versions/node/$(node --version)/bin/appium plugin install --source=local .
nohup $NVM_DIR/versions/node/$(node --version)/bin/appium server -ka 800 --use-plugins=element-wait -pa /wd/hub &
$NVM_DIR/versions/node/$(node --version)/bin/wait-on http://127.0.0.1:4723/wd/hub/status
PLATFORM=android npm run test-e2e
displayName: Android E2E Test
- job: iOS_E2E_Tests
pool:
vmImage: 'macOS-latest'
# timeoutInMinutes: '90'
steps:
- template: .azure-template/bootstrap.yml
- script: |
sudo xcode-select -s /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer
xcrun simctl list
target_sim_id=$(xcrun simctl list devices available | grep "$IOS_DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
open -Fn "/Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer/Applications/Simulator.app"
xcrun simctl bootstatus $target_sim_id -b
displayName: Prepare iOS Simulator
- script: $NVM_DIR/versions/node/$(node --version)/bin/appium driver install xcuitest
displayName: Install XCUITest driver
- script: $NVM_DIR/versions/node/$(node --version)/bin/appium driver run xcuitest build-wda
displayName: Prebuild XCUITest driver
- script: |
npm ci
$NVM_DIR/versions/node/$(node --version)/bin/appium plugin install --source=local .
nohup $NVM_DIR/versions/node/$(node --version)/bin/appium server -ka 800 --use-plugins=element-wait -pa /wd/hub &
$NVM_DIR/versions/node/$(node --version)/bin/wait-on http://127.0.0.1:4723/wd/hub/status
PLATFORM=ios npm run test-e2e
displayName: iOS E2E Test