Toolium
Toolium is a Python wrapper tool of Selenium, Playwright and Appium libraries to test web and mobile applications in a single project. It provides a way of choosing and configuring the driver through a configuration file, implements a Page Object pattern and includes a simple visual testing solution.
Getting Started
Run pip install toolium to install the latest version from PyPi. It’s
highly recommended to use a virtualenv.
The main dependencies are:
Selenium: to test web applications in major browsers (Firefox, Chrome, Internet Explorer, Edge or Safari)
Playwright: to test web applications in major browsers (Firefox, Chrome, Edge or Safari) as an alternative to Selenium (Beta integration in toolium)
Appium-Python-Client: to test mobile applications (native, hybrid or web) in Android or iOS devices/emulators.
requests: to test APIs
You might need to adjust the Selenium and Appium-Python-Client versions in your project. In that case, follow the compatibility matrix
Using toolium-template
The easiest way to get started is to clone toolium-template project, run the example test and add your own tests and configuration.
$ git clone git@github.com:Telefonica/toolium-template.git
$ cd toolium-template
$ pip install -r requirements.txt
Now, just follow the toolium-template instructions to know how to start your testing project.
Running toolium-examples
You can also clone toolium-examples to get more examples about how to use the library to test web, Android or iOS applications, in different scenarios.
$ git clone git@github.com:Telefonica/toolium-examples.git
$ cd toolium-examples
$ pip install -r requirements.txt
Now, just follow the toolium-examples instructions to run the test examples.
Contributing
If you want to collaborate in Toolium development, feel free to fork it and create a pull request.
Then clone the repository and install the dependencies in your virtualenv:
$ git clone git@github.com:<your_github_user>/toolium.git
$ cd toolium
$ pip install -r requirements.txt
$ pip install -r requirements_dev.txt
Before submitting your changes, make sure the code follows the project’s style by running Ruff:
$ ruff check --fix . # Fix linting issues
$ ruff format . # Format code
Then run the unit tests:
$ python -m pytest
Finally, before accepting your contribution, we need you to sign our Contributor License Agreement and send it to ruben.gonzalezalonso@telefonica.com.
Main Features
Library Reference
- toolium packages
- toolium modules
- config_driver
- config_files
- config_parser
ExtendedConfigParserExtendedConfigParser.deepcopy()ExtendedConfigParser.get()ExtendedConfigParser.get_config_from_file()ExtendedConfigParser.get_optional()ExtendedConfigParser.getboolean_optional()ExtendedConfigParser.has_option()ExtendedConfigParser.items()ExtendedConfigParser.options()ExtendedConfigParser.optionxform()ExtendedConfigParser.remove_option()ExtendedConfigParser.set()ExtendedConfigParser.translate_config_variables()ExtendedConfigParser.update_properties()ExtendedConfigParser.update_toolium_system_properties()
- driver_wrapper
- driver_wrappers_pool
DriverWrappersPoolDriverWrappersPool.add_wrapper()DriverWrappersPool.capture_screenshots()DriverWrappersPool.close_drivers()DriverWrappersPool.config_directoryDriverWrappersPool.configure_common_directories()DriverWrappersPool.configure_visual_directories()DriverWrappersPool.connect_default_driver_wrapper()DriverWrappersPool.download_videos()DriverWrappersPool.driver_wrappersDriverWrappersPool.get_configured_value()DriverWrappersPool.get_default_config_directory()DriverWrappersPool.get_default_wrapper()DriverWrappersPool.initialize_config_files()DriverWrappersPool.is_empty()DriverWrappersPool.logs_directoryDriverWrappersPool.output_directoryDriverWrappersPool.remove_drivers()DriverWrappersPool.save_all_ggr_logs()DriverWrappersPool.save_all_webdriver_logs()DriverWrappersPool.save_all_webdriver_or_ggr_logs()DriverWrappersPool.screenshots_directoryDriverWrappersPool.screenshots_numberDriverWrappersPool.stop_drivers()DriverWrappersPool.videos_directoryDriverWrappersPool.videos_numberDriverWrappersPool.visual_baseline_directoryDriverWrappersPool.visual_numberDriverWrappersPool.visual_output_directory
- jira
- pytest_fixtures
- selenoid
- test_cases
- visual_test