If you need to test your website on mobile devices with Appium, you have 5 choices.
- Chrome on Android Device on Sauce Labs Real Device Cloud
- Safari on iOS Device on Sauce Labs Real Device Cloud
- Chrome on Emulator in Sauce Labs Virtual Device Cloud
- Safari on Simulator in Sauce Labs Virtual Device Cloud
- Chrome Mobile Emulation
Setup Instructions and Contribution Information can be found on the Main README.
The Website being tested is Swag Labs.
-
After cloning this repo from instructions, change to this subdirectory:
$ cd appium/mobile-web -
Run the following command to update any package dependencies:
$ mvn dependency:resolve -
Then run the following command to compile your test code:
$ mvn test-compile -
Finally, run the following test to see if you've properly configured the test environment:
$ mvn clean testSee passing tests on GitHub Actions
This code allows toggling what cloud the tests will target. The capabilities for these configurations can be copied from the Platform Configurator, and can be viewed in the Test Configurations file.
Tests will execute on an Android Emulator:
$ mvn clean test -Dsauce.browser=chrome -Dsauce.cloud=vdc
Tests will execute on an iOS Simulator:
$ mvn clean test -Dsauce.browser=safari -Dsauce.cloud=vdc
Tests will execute on a real Android device:
$ mvn clean test -Dsauce.browser=chrome -Dsauce.cloud=rdc
Tests will execute on a real iOS device:
$ mvn clean test -Dsauce.browser=safari -Dsauce.cloud=rdc
The code in these scripts is provided on an "AS-IS" basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. These scripts are provided for educational and demonstration purposes only and should not be used in production. Issues regarding these scripts should be submitted through GitHub. These scripts are maintained by the Technical Services team at Sauce Labs.
Some examples in this repository, such as
appium-example,parallel-testing, andheadless, may require a different account tier beyond free trial. Please contact the Sauce Labs Sales Team for support and information.