Set of examples to learn how to use Toolium to test web, Android or iOS applications, in different scenarios.
Clone toolium-examples repository and install requirements. It's highly recommendable to use a virtualenv.
$ git clone git@github.com:Telefonica/toolium-examples.git
$ cd toolium-examples
$ pip install -r requirements.txt
Each folder contains a sample project to test web, Android or iOS applications using nose2, behave or pytest to execute them.
By default, web tests are configured to run in chrome locally, so chrome must be installed in your machine. Selenium 4 will download chrome driver automatically when tests are executed.
/web_behave
To run behave web tests:
$ behave web_behave
/web_pytest
To run web tests with pytest:
$ cd web_pytest
$ python -m pytest
/web_nose2
To run web tests with nose2:
$ python -m nose2 web_nose2
These web tests can also be executed with pytest:
$ cd web_nose2
$ python -m pytest
By default, mobile tests are configured to run against a local Appium server, so Appium must be installed, configured and started before executing tests.
/android_behave
Android tests need an Android Emulator or a plugged Android device.
To run behave Android tests:
$ behave android_behave
/ios_behave
iOS tests are configured to run on iOS Simulator.
To run behave iOS tests:
$ behave ios_behave
/mobile_behave
This folder contains a behave test that could be executed either in Android or iOS depending on TOOLIUM_CONFIG_ENVIRONMENT behave user property. This is shown just for illustrative purposes, as currently the app in the example does not work with new versions of Android or iOS.
To run behave test in Android:
$ behave mobile_behave -D TOOLIUM_CONFIG_ENVIRONMENT=android
To run behave test in iOS:
$ behave mobile_behave -D TOOLIUM_CONFIG_ENVIRONMENT=ios
/web_behave
The same /web_behave tests already run in a browser could also be executed in an Android or iOS device using different configuration files per environment.
To run behave web tests in an Android device:
$ behave web_behave/features/login.feature -D TOOLIUM_CONFIG_ENVIRONMENT=android
To run behave web tests in an iOS device:
$ behave web_behave/features/login.feature -D TOOLIUM_CONFIG_ENVIRONMENT=ios
/android_nose2
To run Android tests with nose2:
$ python -m nose2 android_nose2
/ios_nose2
To run iOS tests with nose2:
$ python -m nose2 ios_nose2
If you want to collaborate in Toolium-examples development, feel free of forking it and asking for a pull request.
Finally, before accepting your contribution, we need you to sign our Contributor License Agreement and send it to ruben.gonzalezalonso@telefonica.com.