https://github.com/telefonica/toolium-examples
Set of examples to learn how to use toolium different functionalities
https://github.com/telefonica/toolium-examples
cdco
Last synced: about 1 year ago
JSON representation
Set of examples to learn how to use toolium different functionalities
- Host: GitHub
- URL: https://github.com/telefonica/toolium-examples
- Owner: Telefonica
- License: apache-2.0
- Created: 2015-10-28T18:00:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-07T15:21:57.000Z (about 1 year ago)
- Last Synced: 2025-04-13T05:07:11.317Z (about 1 year ago)
- Topics: cdco
- Language: Python
- Size: 27.1 MB
- Stars: 11
- Watchers: 8
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Toolium Examples
================
Set of examples to learn how to use `Toolium `_ to test web, Android or iOS
applications, in different scenarios.
Getting Started
---------------
Clone `toolium-examples `_ repository and install requirements. It's
highly recommendable to use a virtualenv.
.. code:: console
$ git clone git@github.com:Telefonica/toolium-examples.git
$ cd toolium-examples
$ pip install -r requirements.txt
Running Tests
-------------
Each folder contains a sample project to test web, Android or iOS applications using nose2, behave or pytest to execute
them.
Running web tests using Selenium
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:
.. code:: console
$ behave web_behave
**/web_pytest**
To run web tests with pytest:
.. code:: console
$ cd web_pytest
$ python -m pytest
**/web_nose2**
To run web tests with nose2:
.. code:: console
$ python -m nose2 web_nose2
These web tests can also be executed with pytest:
.. code:: console
$ cd web_nose2
$ python -m pytest
Running web tests using Playwright
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**/web_playwright_behave**
To run behave web tests:
.. code:: console
$ behave web_playwright_behave
**/web_playwright**
To run playwright example web tests without using toolium:
.. code:: console
$ cd web_playwright
# Run playwright test integrated with pytest
$ python -m pytest tests/test_web_playwright_pytest.py --headed --browser chromium
# Run playwright test using sync library mode
$ python -m pytest tests/test_web_playwright_library_sync.py --headed
# Run playwright test using async library mode
$ python tests/test_web_playwright_library_async.py
Running mobile tests
~~~~~~~~~~~~~~~~~~~~
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:
.. code:: console
$ behave android_behave
**/ios_behave**
iOS tests are configured to run on iOS Simulator.
To run behave iOS tests:
.. code:: console
$ 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:
.. code:: console
$ behave mobile_behave -D TOOLIUM_CONFIG_ENVIRONMENT=android
To run behave test in iOS:
.. code:: console
$ 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:
.. code:: console
$ behave web_behave/features/login.feature -D TOOLIUM_CONFIG_ENVIRONMENT=android
To run behave web tests in an iOS device:
.. code:: console
$ behave web_behave/features/login.feature -D TOOLIUM_CONFIG_ENVIRONMENT=ios
**/android_nose2**
To run Android tests with nose2:
.. code:: console
$ python -m nose2 android_nose2
**/ios_nose2**
To run iOS tests with nose2:
.. code:: console
$ python -m nose2 ios_nose2
Contributing
------------
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.