iOS Tests

Purpose

  • We can execute our tests through Microsoft Azure CI

  • In this example, we will setup jobs for web, android and iOS tests.

  • For mobile tests, we will use simulators on hosted vms

iOS Tests

Set Agent

  • Set Agent as Hosted macOS

  • If using a locally hosted vm, select appropriate agent

Install Node 10.x

  • Add task Node.js tool installer

  • Set version to 10.x

Install Appium

  • Add bash script task

  • Inline script:

  • npm install -g appium

Install MJPEG Consumer

  • Add bash script task

  • Inline script:

  • brew install ffmpeg

Run Appium

  • Add bash script task

  • Inline script:

  • appium --relaxed-security &

Run Tests

  • Add Bash task with maven command to run the tests

  • The script command:

  • mvn clean compile test -DsuiteXmlFile=suites/iosSmokeTests.xml 
  • To add additional configuration parameters, use prefix '-D' to each property value

    • eg.-Dandroid.mobile="test_android_emulator"

    • note: There should be no space in setting the key value combination

  • Inline script:

  • mvn clean compile test -DsuiteXmlFile=suites/iosSmokeTests.xml -Dios.capabilties.platformVersion=10.0 -Dios.mobile="iPhone 6" -Dappium.useExternalAppiumServer=true  -Drecorder.enableRecording=true 

Publish the results

  • Add publish test results task

  • Set Test result files:

  • **/junitreports/TEST-*.xml
  • Set: Fail if there are test failures

Last updated

Was this helpful?