Webdriver-test-tools

Latest version: v3.2.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

3.2.0

Added `--skip-module`/`-S` argument to `run` and `list` commands, allowing entire test modules to be skipped

Details

`project.cmd.common`:

- Added `--skip-module`/`-S` argument to test parent parser
- Dictionary returned when parsing test args now includes `'skip_module_names'` with modules to skip

`project.test_loader`:

- `load_project_tests()` and `get_test_modules()` now take optional `skip_module_names` argument. Modules matching these names are filtered out before checking `test_module_names`

`project.cmd.list`:

- `list_tests()` now accepts `skip_module_names` and passes to `load_project_tests()`

`project.cmd.run`:

- `run_tests()` now accepts `skip_module_names` and passes to `load_project_tests()`

3.1.0

Hotfix for missing import in `__main__`

3.0.1

Test project and `wtt` commands now set the exit code after execution. This can allow the framework to be integrated with automation tools.

Details

`__main__`:

- `main()` now calls `sys.exit(exit_code)`, where `exit_code` is 0 if command was executed without issue, or 1 if an exception occurred or no command was specified. Exceptions are printed before exiting

`project.test_module`:

- `main()` now calls `sys.exit(exit_code)`, where `exit_code` is 0 if command was executed without issue, or 1 if an exception occurred or the `parse_<command>_args()` function returned a non-zero exit code. Exceptions are printed before exiting

`project.cmd.common`:

- Removed `load_tests()` as its only purpose was to wrap `test_loader.load_project_test()` and catch and print any exceptions, which are now propagated to `test_module.main()`. Functions in `list` and `run` that used this now call `test_loader.load_project_test()` directly

`project.cmd.list`:

- `parse_list_args()` now returns an exit code

`project.cmd.new`:

- `parse_new_args()` now returns an exit code and no longer catches exceptions, letting them propagate to `test_module.main()`

`project.cmd.run`:

- `parse_run_args()` now returns an exit code based on the results of `run_tests()`
- `run_tests()` now captures the results of `test_runner.run()` and returns 0 if all tests passed, or 1 if there were any failures

3.0.0

Various changes, code cleanup, and deprecation for version 3.0.

Most of the changes were related to inline docstrings and code cleanup. The actual code changes are listed below.

Details

* Updated `install_requires` package versions and added upper bound version numbers
* Updated `__about__.py` for 3.0.0-beta
* Moved internal utility method `validate_filename()` from `common.utils` to `common.files`
* Removed `webdriver` import from test case templates (it typically doesn't get used on its own, as driver initialization is handled internally)

Deprecated

`webdriver.actions.form`:

* Removed inputs for filling forms/retrieving form values. These were used internally and have been replaced with methods in `InputObject`. Any code that called these methods directly instead of the deprecated `FormObject.fill_form()` wrapper should be replaced with a corresponding `FormObject`

`pageobject.form.FormObject`:

* Removed `Input` nested class. This shouldn't affect any implementations that declare their own `Input` nested class
* Removed `fill_form()`. Any usages of it should be able to be replaced with `fill_inputs()` without altering parameters or `input_map` syntax

`pageobject.nav.NavObject`:

* Removed `LINK_MAP` and `HOVER_MAP` attribute declarations. This shouldn't affect any implementations that declare their own, but since they are no longer used in any methods changes will likely need to be made anyway
* Removed `click_page_link()` and `hover_over_page_link()`. These have been replaced by `click_link()` and `hover_over_link()`, which take a key into `links` (a dictionary mapping name strings to `InputObject` instances that's populated either by the contents of `YAML_FILE` or `LINK_DICTS`) and return one of a few possible options depending on the click/hover action that's set. See the documentation for details

`pageobject.nav.CollapsibleNavObject`:

* Removed `CollapsibleNavObject`. It should be replaced with a `NavObject` with `COLLAPSIBLE = True`. The only difference in attribute names is that `MENU_CONTAINER_LOCATOR` has been shortened to `MENU_LOCATOR` in `NavObject`. All collapsible-specific methods are the same name in `NavObject`.

`config.webdriver.WebDriverConfig`:

* Removed `IMPLICIT_WAIT` configuration. Selenium warns that implicit and explicit waits should not be mixed ([source](https://www.seleniumhq.org/docs/04_webdriver_advanced.jspexplicit-and-implicit-waits)), and the framework relies heavily on explicit waits

2.13.1

<test_project> list` now displays module names in addition to classes and methods. Additionally, the `--verbose` flag was added, which prints test docstrings and outputs using tree characters e.g.:


home:
└── HomePageTestCase:
Really contrived example test case
├── test_more_information_link
│   Test that the 'More information...' link goes to the correct URL
└── test_page_heading
Ensure that the page heading text is correct


Details

`common.cmd`:

* Added `print_shortened()`, which truncates strings longer than the terminal width

`project.cmd.list`:

* Added `--verbose` flag to `list` command. If used, docstrings for test cases and methods will be printed
* `list` now shows modules in addition to test classes and methods
* Re-worked internals of how list prints stuff

2.13.0

* Added `WebDriverTestCase.is_mobile()`, which returns True if the test is currently running in a mobile browser. This allows tests to handle things differently for mobile browsers
* `NavLinkObject` now accepts `None` for hover/click actions, making for more pythonic code when declaring a non-YAML nav object

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.