Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7a70292
Add iOS Navigation Tests workflow to GitHub Actions
StuartFerguson Jun 24, 2025
d949942
fix to ios workflow
StuartFerguson Jun 24, 2025
4057da0
Upgrade macOS version for navigation tests
StuartFerguson Jun 24, 2025
79248ba
Update iOS test configurations for new platform version
StuartFerguson Jun 24, 2025
efa069e
Add Xcode setup steps to iOS navigation tests workflow
StuartFerguson Jun 24, 2025
5783e9a
Update iOS navigation tests to use dotnet publish
StuartFerguson Jun 24, 2025
e7ef03b
:|
StuartFerguson Jun 24, 2025
558b8dc
:|
StuartFerguson Jun 24, 2025
e62e15f
:|
StuartFerguson Jun 24, 2025
38ccc63
:|
StuartFerguson Jun 24, 2025
f0fa03a
:|
StuartFerguson Jun 24, 2025
1c3b929
:|
StuartFerguson Jun 24, 2025
f15c869
oops
StuartFerguson Jun 24, 2025
99dce9c
:|
StuartFerguson Jun 24, 2025
8930ba9
debugging
StuartFerguson Jun 24, 2025
bbf9b4b
swirtch to nunit console
StuartFerguson Jun 24, 2025
906d5a0
:|
StuartFerguson Jun 24, 2025
7f8c9f4
:|A
StuartFerguson Jun 24, 2025
6155b17
:|
StuartFerguson Jun 24, 2025
0750f9c
:|
StuartFerguson Jun 24, 2025
e9a5c46
:|
StuartFerguson Jun 24, 2025
badbf66
...
StuartFerguson Jun 24, 2025
d54b28c
:|
StuartFerguson Jun 24, 2025
9787557
:|
StuartFerguson Jun 24, 2025
e5fdfb0
:|
StuartFerguson Jun 24, 2025
9b28eb3
debug step
StuartFerguson Jun 24, 2025
6faa897
:|
StuartFerguson Jun 24, 2025
1c3d470
:|
StuartFerguson Jun 24, 2025
c83fbc3
:|
StuartFerguson Jun 24, 2025
2df1dc0
:|
StuartFerguson Jun 24, 2025
3aa5add
:|
StuartFerguson Jun 24, 2025
1e6ef03
:|
StuartFerguson Jun 24, 2025
1ef83da
:|
StuartFerguson Jun 25, 2025
73b51b1
:|
StuartFerguson Jun 25, 2025
2b550aa
:|
StuartFerguson Jun 25, 2025
bc36aba
:|
StuartFerguson Jun 25, 2025
e49d5a5
:|
StuartFerguson Jun 25, 2025
e9bf172
:|
StuartFerguson Jun 25, 2025
6b2abef
:|
StuartFerguson Jun 25, 2025
da09fd4
:|
StuartFerguson Jun 25, 2025
cee3c3d
oops
StuartFerguson Jun 25, 2025
037df02
:|
StuartFerguson Jun 25, 2025
d28e7e7
:|
StuartFerguson Jun 25, 2025
6f93f82
:|
StuartFerguson Jun 25, 2025
aeb504b
:|
StuartFerguson Jun 25, 2025
126cff3
...
StuartFerguson Jun 25, 2025
ed43435
:|
StuartFerguson Jun 25, 2025
eb2f98d
:|
StuartFerguson Jun 25, 2025
d4eb064
:|
StuartFerguson Jun 25, 2025
6348484
:|
StuartFerguson Jun 25, 2025
bda4a1b
:|
StuartFerguson Jun 25, 2025
0d07822
:| another attempt
StuartFerguson Jun 26, 2025
c0c8a60
:/ depressing
StuartFerguson Jun 26, 2025
bd46fe4
:|
StuartFerguson Jun 26, 2025
5d21be9
:|
StuartFerguson Jun 26, 2025
b2ade72
:|
StuartFerguson Jun 26, 2025
5870a95
:|
StuartFerguson Jun 26, 2025
42443c2
:|
StuartFerguson Jun 26, 2025
b40f2ee
:| more debug
StuartFerguson Jun 26, 2025
22b1f84
:|
StuartFerguson Jun 26, 2025
6c86f2e
:|
StuartFerguson Jun 26, 2025
0e337dc
:|
StuartFerguson Jun 26, 2025
5277213
.
StuartFerguson Jun 26, 2025
f2715b9
copilot version
StuartFerguson Jun 26, 2025
90c2e84
:|
StuartFerguson Jun 27, 2025
9bfcf1a
try to fix alert issue on ios
StuartFerguson Jul 2, 2025
ab29862
a new hope....!!
StuartFerguson Jul 2, 2025
5b0affe
:|
StuartFerguson Jul 2, 2025
ed7011a
:|
StuartFerguson Jul 2, 2025
2a3158e
experiment
StuartFerguson Jul 2, 2025
4773821
:|
StuartFerguson Jul 2, 2025
a3b68cc
tweak to workflow
StuartFerguson Jul 2, 2025
bd8e674
..
StuartFerguson Jul 2, 2025
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
207 changes: 207 additions & 0 deletions .github/workflows/ios_navigation_tests - Copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
name: Build and Run iOS Navigation Tests - Self Hosted

on:
pull_request:
branches:
- main

jobs:
software_navigation_tests_self_hosted:
runs-on: [self-hosted, macOS]
#env:
# PLATFORM_VERSION: "18.5"
# DEVICE_NAME: "iPhone 16"
# APP_PATH: "./MyTestApp.app"

steps:
- name: 🧾 Checkout repo
uses: actions/checkout@v4

#- name: 🔧 Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20'

#- name: 🔧 Set up .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: '9.0.x'

#- name: 📦 Install Appium + XCUITest driver
# run: |
# npm install -g appium
# appium driver install xcuitest

#- name: 🧹 Clean DerivedData and WDA cache
# run: |
# rm -rf ~/Library/Developer/Xcode/DerivedData
# rm -rf ~/.appium/node_modules/appium-webdriveragent/Build

#- name: 📱 Create iOS Simulator (if needed)
# run: |
# SIMULATOR_NAME="ci-sim-$RANDOM"
# xcrun simctl create "$SIMULATOR_NAME" "$DEVICE_NAME" "com.apple.CoreSimulator.SimRuntime.iOS-${PLATFORM_VERSION//./-}"
# echo "SIMULATOR_NAME=$SIMULATOR_NAME" >> $GITHUB_ENV

# - name: 🚀 Boot simulator
# run: |
# xcrun simctl boot "iPhone 16"
# SIMULATOR_ID=$(xcrun simctl list | grep 'Booted' | awk -F '[()]' '{print $2}')
# echo "SIMULATOR_ID=$SIMULATOR_ID"
# echo "SIMULATOR_ID=$SIMULATOR_ID" >> $GITHUB_ENV

# # Open the simulator UI so Appium doesn’t force-restart it later
# open -Fn /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

# # Wait a bit to ensure the UI is up
# sleep 5
- name: 🚀 Boot simulator
run: |
SIMULATOR_NAME="iPhone 16"

# Check if the simulator is already booted
BOOTED_ID=$(xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep 'Booted' | awk -F '[()]' '{print $2}')

if [ -n "$BOOTED_ID" ]; then
echo "Simulator '$SIMULATOR_NAME' is already booted with ID: $BOOTED_ID"
SIMULATOR_ID="$BOOTED_ID"
else
echo "Booting simulator '$SIMULATOR_NAME'..."
SIMULATOR_ID=$(xcrun simctl list devices | grep "$SIMULATOR_NAME" | head -n 1 | awk -F '[()]' '{print $2}' | xargs)
xcrun simctl boot "$SIMULATOR_ID"
fi

echo "SIMULATOR_ID=$SIMULATOR_ID"
echo "SIMULATOR_ID=$SIMULATOR_ID" >> $GITHUB_ENV


#- name: List available simulators
# run: |
# xcrun simctl list | grep $SIMULATOR_ID

#- name: Build, verify, and deploy WebDriverAgent
# run: |
# set -euo pipefail

# # Set up vars
# WDA_DIR="/tmp/WebDriverAgent"
# DERIVED_DATA="/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent"
# #SIMULATOR_UDID="${{ env.UDID }}"
# echo "Using simulator $SIMULATOR_ID"

# # Clone WDA
# echo "Cloning WebDriverAgent..."
# git clone https://github.com/appium/WebDriverAgent.git "$WDA_DIR"

# # Build WDA using xcodebuild without signing (safe for CI)
# echo "Building WebDriverAgentRunner..."
# xcodebuild -project "$WDA_DIR/WebDriverAgent.xcodeproj" \
# -scheme WebDriverAgentRunner \
# -destination "id=$SIMULATOR_ID" \
# -derivedDataPath "/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent" \
# CODE_SIGNING_ALLOWED=NO \
# build-for-testing

# # Verify build output
# echo "Looking for WDA build output..."
# WDA_APP=$(find "$DERIVED_DATA" -type d -name "WebDriverAgentRunner-Runner.app" | head -n 1)
# if [ -z "$WDA_APP" ]; then
# echo "::error ::Failed to locate built WebDriverAgentRunner-Runner.app"
# exit 1
# fi
# echo "Found built WDA app at: $WDA_APP"

# # Launch WDA via xcodebuild test-without-building (required for XCTest runners)
# echo "Launching WebDriverAgent test runner on simulator..."
# xcodebuild test-without-building \
# -project "$WDA_DIR/WebDriverAgent.xcodeproj" \
# -scheme WebDriverAgentRunner \
# -destination "id=$SIMULATOR_ID" \
# -derivedDataPath "$DERIVED_DATA" \
# IPHONEOS_DEPLOYMENT_TARGET=18.0 \
# GCC_TREAT_WARNINGS_AS_ERRORS=0 \
# COMPILER_INDEX_STORE_ENABLE=NO \
# > /tmp/wda-launch.log 2>&1 &

# # Wait for WDA to be ready
# echo "Waiting for WDA to be available on http://127.0.0.1:8100/status..."

# for i in {1..30}; do
# if curl --silent --fail http://127.0.0.1:8100/status | grep -q "state"; then
# echo "✅ WDA is up and running."
# exit 0
# fi
# echo "Waiting... ($i)"
# sleep 2
# done

# echo "::error::WDA failed to start within timeout."
# exit 1

# echo "✅ WDA built, verified, installed, and launched successfully."

- name: 🧪 Start Appium Server
run: |
nohup appium --log appium.log &

#- name: Install MAUI Workloads
# run: |
# dotnet workload install ios --ignore-failed-sources
# dotnet workload install maui --ignore-failed-sources

- name: Restore MAUI App for iOS
run: dotnet restore TransactionProcessor.Mobile.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json

#- name: Select Xcode 16.4
# run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer

#- name: Confirm Xcode version
# run: xcodebuild -version

#- name: Accept Xcode license
# run: sudo xcodebuild -license accept

- name: Build Code
#run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net9.0-ios -c Release --no-restore
#run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -c Release -f net9.0-ios -r iossimulator-arm64 /p:EnableAssemblyILStripping=false /p:EnableSymbolStrip=false /p:LinkMode=None
run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -c Release -f net9.0-ios -r iossimulator-arm64 #/p:LinkMode=SdkOnly /p:EnableAssemblyILStripping=true /p:EnableSymbolStrip=true /p:Codesign=false /p:DebugSymbols=false /p:UseInterpreter=true

# - name: List all files with full path
# run: |
# find /Users/runner/work/TransactionMobile/TransactionMobile/TransactionProcessor.Mobile/bin -type f

- name: Run iOS Navigation Tests
run: |
#dotnet build TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj -c Debug --no-restore
dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "Category=PRNavTest" --no-restore
# dotnet tool install --global NUnit.ConsoleRunner.NetCore
# nunit3-console TransactionProcessor.Mobile.UiTests/bin/Release/net9.0/TransactionProcessor.Mobile.UiTests.dll --where "(cat == PRNavTest && cat == iOS)"

# - name: Run iOS Navigation Tests
# run: |
# # Install NUnit Console Runner tool
# dotnet tool install --global NUnit.ConsoleRunner.NetCore

# # Ensure the tool path is available in this step
# export PATH="$PATH:$HOME/.dotnet/tools"

# # Optional: clean + build test project if not already built
# dotnet build TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj -c Release --no-restore

# # Run the tests filtered by categories
# nunit TransactionProcessor.Mobile.UiTests/bin/Release/net9.0/TransactionProcessor.Mobile.UiTests.dll --where "cat == PRNavTest && cat == iOS" --labels=All --result=TestResult-iOS.xml

- name: Upload Appium Logs on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ios-software_navigation_tests_appium
path: appium.log

# - name: Upload NUnit Test Results
# uses: actions/upload-artifact@v4
# with:
# name: iOS-Test-Results
# path: TestResult-iOS.xml


189 changes: 189 additions & 0 deletions .github/workflows/ios_navigation_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Build and Run iOS Navigation Tests

on:
pull_request:
branches:
- main

jobs:
software_navigation_tests:
runs-on: macos-15
env:
PLATFORM_VERSION: "18.5"
DEVICE_NAME: "iPhone 16"
APP_PATH: "./MyTestApp.app"

steps:
- name: 🧾 Checkout repo
uses: actions/checkout@v4

- name: 🔧 Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: 🔧 Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: 📦 Install Appium + XCUITest driver
run: |
npm install -g appium
appium driver install xcuitest

#- name: 🧹 Clean DerivedData and WDA cache
# run: |
# rm -rf ~/Library/Developer/Xcode/DerivedData
# rm -rf ~/.appium/node_modules/appium-webdriveragent/Build

- name: 📱 Create iOS Simulator (if needed)
run: |
SIMULATOR_NAME="ci-sim-$RANDOM"
xcrun simctl create "$SIMULATOR_NAME" "$DEVICE_NAME" "com.apple.CoreSimulator.SimRuntime.iOS-${PLATFORM_VERSION//./-}"
echo "SIMULATOR_NAME=$SIMULATOR_NAME" >> $GITHUB_ENV

- name: 🚀 Boot simulator
run: |
xcrun simctl boot "$SIMULATOR_NAME"
SIMULATOR_ID=$(xcrun simctl list | grep 'Booted' | awk -F '[()]' '{print $2}')
echo "SIMULATOR_ID=$SIMULATOR_ID"
echo "SIMULATOR_ID=$SIMULATOR_ID" >> $GITHUB_ENV

# Open the simulator UI so Appium doesn’t force-restart it later
open -Fn /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

# Wait a bit to ensure the UI is up
sleep 5


- name: List available simulators
run: |
xcrun simctl list | grep $SIMULATOR_ID

#- name: Build, verify, and deploy WebDriverAgent
# run: |
# set -euo pipefail

# # Set up vars
# WDA_DIR="/tmp/WebDriverAgent"
# DERIVED_DATA="/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent"
# #SIMULATOR_UDID="${{ env.UDID }}"
# echo "Using simulator $SIMULATOR_ID"

# # Clone WDA
# echo "Cloning WebDriverAgent..."
# git clone https://github.com/appium/WebDriverAgent.git "$WDA_DIR"

# # Build WDA using xcodebuild without signing (safe for CI)
# echo "Building WebDriverAgentRunner..."
# xcodebuild -project "$WDA_DIR/WebDriverAgent.xcodeproj" \
# -scheme WebDriverAgentRunner \
# -destination "id=$SIMULATOR_ID" \
# -derivedDataPath "/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent" \
# CODE_SIGNING_ALLOWED=NO \
# build-for-testing

# # Verify build output
# echo "Looking for WDA build output..."
# WDA_APP=$(find "$DERIVED_DATA" -type d -name "WebDriverAgentRunner-Runner.app" | head -n 1)
# if [ -z "$WDA_APP" ]; then
# echo "::error ::Failed to locate built WebDriverAgentRunner-Runner.app"
# exit 1
# fi
# echo "Found built WDA app at: $WDA_APP"

# # Launch WDA via xcodebuild test-without-building (required for XCTest runners)
# echo "Launching WebDriverAgent test runner on simulator..."
# xcodebuild test-without-building \
# -project "$WDA_DIR/WebDriverAgent.xcodeproj" \
# -scheme WebDriverAgentRunner \
# -destination "id=$SIMULATOR_ID" \
# -derivedDataPath "$DERIVED_DATA" \
# IPHONEOS_DEPLOYMENT_TARGET=18.0 \
# GCC_TREAT_WARNINGS_AS_ERRORS=0 \
# COMPILER_INDEX_STORE_ENABLE=NO \
# > /tmp/wda-launch.log 2>&1 &

# # Wait for WDA to be ready
# echo "Waiting for WDA to be available on http://127.0.0.1:8100/status..."

# for i in {1..30}; do
# if curl --silent --fail http://127.0.0.1:8100/status | grep -q "state"; then
# echo "✅ WDA is up and running."
# exit 0
# fi
# echo "Waiting... ($i)"
# sleep 2
# done

# echo "::error::WDA failed to start within timeout."
# exit 1

# echo "✅ WDA built, verified, installed, and launched successfully."

- name: 🧪 Start Appium Server
run: |
nohup appium --log appium.log &

- name: Install MAUI Workloads
run: |
dotnet workload install ios --ignore-failed-sources
dotnet workload install maui --ignore-failed-sources

- name: Restore MAUI App for iOS
run: dotnet restore TransactionProcessor.Mobile.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json

- name: Select Xcode 16.4
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer

- name: Confirm Xcode version
run: xcodebuild -version

- name: Accept Xcode license
run: sudo xcodebuild -license accept

- name: Build Code
#run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net9.0-ios -c Release --no-restore
#run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -c Release -f net9.0-ios -r iossimulator-arm64 /p:EnableAssemblyILStripping=false /p:EnableSymbolStrip=false /p:LinkMode=None
run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -c Release -f net9.0-ios -r iossimulator-arm64 #/p:LinkMode=SdkOnly /p:EnableAssemblyILStripping=true /p:EnableSymbolStrip=true /p:Codesign=false /p:DebugSymbols=false /p:UseInterpreter=true

# - name: List all files with full path
# run: |
# find /Users/runner/work/TransactionMobile/TransactionMobile/TransactionProcessor.Mobile/bin -type f

- name: Run iOS Navigation Tests
run: |
#dotnet build TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj -c Debug --no-restore
dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "Category=PRNavTest" --no-restore
# dotnet tool install --global NUnit.ConsoleRunner.NetCore
# nunit3-console TransactionProcessor.Mobile.UiTests/bin/Release/net9.0/TransactionProcessor.Mobile.UiTests.dll --where "(cat == PRNavTest && cat == iOS)"

# - name: Run iOS Navigation Tests
# run: |
# # Install NUnit Console Runner tool
# dotnet tool install --global NUnit.ConsoleRunner.NetCore

# # Ensure the tool path is available in this step
# export PATH="$PATH:$HOME/.dotnet/tools"

# # Optional: clean + build test project if not already built
# dotnet build TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj -c Release --no-restore

# # Run the tests filtered by categories
# nunit TransactionProcessor.Mobile.UiTests/bin/Release/net9.0/TransactionProcessor.Mobile.UiTests.dll --where "cat == PRNavTest && cat == iOS" --labels=All --result=TestResult-iOS.xml

- name: Upload Appium Logs on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ios-software_navigation_tests_appium
path: appium.log

# - name: Upload NUnit Test Results
# uses: actions/upload-artifact@v4
# with:
# name: iOS-Test-Results
# path: TestResult-iOS.xml


Loading
Loading