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
124 changes: 110 additions & 14 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Functional Tests (Android)
name: Functional Tests

on:
push:
Expand All @@ -11,19 +11,23 @@ on:
- 'release/**'
workflow_dispatch:

env:
BUILD_CONFIGURATION: 'Release'
CI: true
DOTNET_VERSION: '8.0.x'
NODE_VERSION: 'lts/*'

jobs:
android-tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
api-level: [30]
api-level: [32]
target: [google_apis]

env:
BUILD_CONFIGURATION: 'Release'
CI: true
APPIUM_LOG_PATH: '${{ github.workspace }}/appium.log'

steps:
Expand All @@ -33,7 +37,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Enable KVM
run: |
Expand Down Expand Up @@ -74,16 +78,15 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: ${{ env.NODE_VERSION }}

- name: Install Appium
run: npm install -g appium

- name: Install UiAutomator2 driver
run: appium driver install uiautomator2

- name: Install Espresso driver
run: appium driver install espresso
- name: Install Android drivers
run: |
appium driver install uiautomator2
appium driver install espresso

- name: Restore dependencies
run: dotnet restore Appium.Net.sln
Expand Down Expand Up @@ -114,6 +117,7 @@ jobs:
adb devices
dotnet test --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --framework net8.0 --filter "FullyQualifiedName~Android" --logger "trx;LogFileName=android-test-results.trx" --logger "console;verbosity=detailed" ./test/integration/Appium.Net.Integration.Tests.csproj

# Common: Publish results
- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
Expand All @@ -123,9 +127,101 @@ jobs:
reporter: dotnet-trx

- name: Save server output
if: ${{ always() }}
uses: actions/upload-artifact@master
if: always()
uses: actions/upload-artifact@v4
with:
name: appium-android-${{ matrix.api-level }}.log
path: appium*.log
if-no-files-found: ignore

ios-tests:
runs-on: macos-15

env:
APPIUM_LOG_PATH: '${{ github.workspace }}/appium-ios.log'
IOS_DEVICE_NAME: 'iPhone 16'
IOS_VERSION: '18.5'
XCODE_VERSION: '16.4'

steps:
# Common: Checkout and setup
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Disable pasteboard sync
run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Appium
run: npm install -g appium

- name: Install ffmpeg
run: brew install ffmpeg

- name: Install XCUITest driver
run: appium driver install xcuitest

- name: Download prebuilt WDA
run: npx appium driver run xcuitest download-wda-sim --platform=ios --outdir=${{ github.workspace }}/wda

- name: Setup iOS Simulator
uses: futureware-tech/simulator-action@v4
with:
model: ${{ env.IOS_DEVICE_NAME }}
os_version: ${{ env.IOS_VERSION }}
wait_for_boot: true
shutdown_after_job: false

- name: Restore dependencies
run: dotnet restore Appium.Net.sln

- name: Build solution
run: dotnet build Appium.Net.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore

- name: Create test environment file
run: |
cat > ./test/integration/env.json << 'EOF'
{
"DEV": "false",
"isRemoteAppiumServer": "false",
"remoteAppiumServerUri": "http://127.0.0.1:4723"
}
EOF

- name: Run iOS functional tests
env:
LOCAL_PREBUILT_WDA: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
run: |
dotnet test ./test/integration/Appium.Net.Integration.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --framework net8.0 --filter "FullyQualifiedName~IOS" --logger "trx;LogFileName=ios-test-results.trx" --logger "console;verbosity=detailed"

- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: iOS Test Results
path: '**/ios-test-results.trx'
reporter: dotnet-trx

- name: Save server output
if: always()
uses: actions/upload-artifact@v4
with:
name: appium-${{ matrix.api-level }}.log
name: appium-ios.log
path: |
appium*.log
*.log
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: 'lts/*'

- name: Install Appium
run: npm install -g appium
Expand Down
4 changes: 4 additions & 0 deletions test/integration/Android/ActionsChainsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ public void TouchByCoordinatesTestCase()
[Test]
public void ScrollActionTestCase()
{
if (Env.IsCiEnvironment())
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KazuCocoa, Wouldn't it be cleaner approach to skip the tests in the tests steps of the yaml file?

Copy link
Member Author

@KazuCocoa KazuCocoa Jan 4, 2026

Choose a reason for hiding this comment

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

Current way is to help grep with Env.IsCiEnvironment() to find skipped test cases easily, so we can move to CLI arguments later if it is more dotnet's preference way as a followup PR

{
Assert.Ignore("Skipping ScrollActionTestCase test in CI environment");
}
AppiumElement ViewsElem = _driver.FindElement(MobileBy.AccessibilityId("Views"));

ActionBuilder actionBuilder = new ActionBuilder();
Expand Down
13 changes: 10 additions & 3 deletions test/integration/helpers/Caps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using OpenQA.Selenium.Appium;
using System;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Enums;

namespace Appium.Net.Integration.Tests.helpers
Expand All @@ -9,11 +10,17 @@ public static AppiumOptions GetIosCaps(string app)
{
var capabilities = new AppiumOptions();
capabilities.AutomationName = AutomationName.iOSXcuiTest;
capabilities.DeviceName = "iPhone 17";
capabilities.PlatformVersion = "26.0";
capabilities.DeviceName = Environment.GetEnvironmentVariable("IOS_DEVICE_NAME") ?? "iPhone 17";
capabilities.PlatformVersion = Environment.GetEnvironmentVariable("IOS_VERSION") ?? "26.0";
capabilities.App = app;
capabilities.AddAdditionalAppiumOption(IOSMobileCapabilityType.LaunchTimeout, Env.InitTimeoutSec.TotalMilliseconds);

if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("LOCAL_PREBUILT_WDA")))
{
capabilities.AddAdditionalAppiumOption("usePreinstalledWDA", true);
capabilities.AddAdditionalAppiumOption("prebuiltWDAPath", Environment.GetEnvironmentVariable("LOCAL_PREBUILT_WDA"));
}

return capabilities;
}

Expand Down
Loading