Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .azure-templates/bootstrap_steps.yml

This file was deleted.

97 changes: 93 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,112 @@ on:
- 'docs/**'
- '*.md'

env:
ANDROID_SDK_VERSION: 28
ANDROID_EMU_NAME: test
XCODE_VERSION: 14.2
IOS_DEVICE_NAME: iPhone 12
IOS_PLATFORM_VERSION: 16.2

jobs:
build:

runs-on: macOS-latest

strategy:
matrix:
java: [ 8, 11, 17 ]
include:
# TODO: add new LTS Java ( 21 ) once it's released
- java: 8
platform: macos-latest
Copy link
Copy Markdown
Contributor

@mykola-mokhnach mykola-mokhnach May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might break in the future because Xcode/simulator versions are tied to macOS version. That is why it makes sense to keep them as constants in the same group, so one could update their values in a single shot. Also put a specific OS version instead of the latest

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for iOS tests (see java 11 + macOS 12)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add the explanation comment below why mac os version for ios tests must not be set to latest

e2e-tests: android
- java: 11
# Need to use specific (not `-latest`) version of macOS to be sure the required version of Xcode/simulator is available
platform: macos-12
e2e-tests: ios
- java: 17
platform: ubuntu-latest
fail-fast: false

runs-on: ${{ matrix.platform }}

name: JDK ${{ matrix.java }}
name: JDK ${{ matrix.java }} - ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'gradle'

- name: Build with Gradle
run: ./gradlew clean build

- name: Install Node.js
if: ${{ matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios' }}
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install Appium
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
run: npm install -g appium@next

- name: Install UIA2 driver
if: matrix.e2e-tests == 'android'
run: appium driver install uiautomator2

- name: AVD cache
if: matrix.e2e-tests == 'android'
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.ANDROID_SDK_VERSION }}

- name: Generate AVD snapshot for caching
if: matrix.e2e-tests == 'android' && steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_SDK_VERSION }}
avd-name: ${{ env.ANDROID_EMU_NAME }}
force-avd-creation: false
script: echo "Generated AVD snapshot for caching."

- name: Run Android E2E tests
if: matrix.e2e-tests == 'android'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_SDK_VERSION }}
avd-name: ${{ env.ANDROID_EMU_NAME }}
force-avd-creation: false
emulator-options: -no-snapshot -delay-adb
script: ./gradlew uiAutomationTest

- name: Select Xcode
if: matrix.e2e-tests == 'ios'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "${{ env.XCODE_VERSION }}"

- name: Install XCUITest driver
if: matrix.e2e-tests == 'ios'
run: appium driver install xcuitest

- name: Prebuild XCUITest driver
if: matrix.e2e-tests == 'ios'
run: appium driver run xcuitest build-wda

- name: Prepare iOS simulator
if: matrix.e2e-tests == 'ios'
run: |
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

- name: Run iOS E2E tests
if: matrix.e2e-tests == 'ios'
run: ./gradlew xcuiTest
69 changes: 0 additions & 69 deletions azure-pipelines.yml

This file was deleted.

1 change: 1 addition & 0 deletions src/test/java/io/appium/java_client/ios/BaseIOSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static AppiumDriverLocalService startAppiumServer() {
service = new AppiumServiceBuilder()
.withIPAddress("127.0.0.1")
.usingPort(PORT)
.withTimeout(Duration.ofSeconds(40))
.build();
service.start();
return service;
Expand Down