Releases: connordelacruz/webdriver-test-tools
3.2.0: --skip-module argument
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()
andget_test_modules()
now take optionalskip_module_names
argument. Modules matching these names are filtered out before checkingtest_module_names
project.cmd.list
:
list_tests()
now acceptsskip_module_names
and passes toload_project_tests()
project.cmd.run
:
run_tests()
now acceptsskip_module_names
and passes toload_project_tests()
3.1.0
Hotfix for missing import in __main__
3.0.1: Command exit codes
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 callssys.exit(exit_code)
, whereexit_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 callssys.exit(exit_code)
, whereexit_code
is 0 if command was executed without issue, or 1 if an exception occurred or theparse_<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 wraptest_loader.load_project_test()
and catch and print any exceptions, which are now propagated totest_module.main()
. Functions inlist
andrun
that used this now calltest_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 totest_module.main()
project.cmd.run
:
parse_run_args()
now returns an exit code based on the results ofrun_tests()
run_tests()
now captures the results oftest_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()
fromcommon.utils
tocommon.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 deprecatedFormObject.fill_form()
wrapper should be replaced with a correspondingFormObject
pageobject.form.FormObject
:
- Removed
Input
nested class. This shouldn't affect any implementations that declare their ownInput
nested class - Removed
fill_form()
. Any usages of it should be able to be replaced withfill_inputs()
without altering parameters orinput_map
syntax
pageobject.nav.NavObject
:
- Removed
LINK_MAP
andHOVER_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()
andhover_over_page_link()
. These have been replaced byclick_link()
andhover_over_link()
, which take a key intolinks
(a dictionary mapping name strings toInputObject
instances that's populated either by the contents ofYAML_FILE
orLINK_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 aNavObject
withCOLLAPSIBLE = True
. The only difference in attribute names is thatMENU_CONTAINER_LOCATOR
has been shortened toMENU_LOCATOR
inNavObject
. All collapsible-specific methods are the same name inNavObject
.
config.webdriver.WebDriverConfig
:
- Removed
IMPLICIT_WAIT
configuration. Selenium warns that implicit and explicit waits should not be mixed (source), and the framework relies heavily on explicit waits
2.13.1: list command --verbose flag
<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 tolist
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: WebDriverTestCase.is_mobile()
- 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 acceptsNone
for hover/click actions, making for more pythonic code when declaring a non-YAML nav object
2.12.1: Prototype documentation update
No code changes, but added documentation
2.12.0: Collapsible variant of existing YAML nav objects
A collapsible variant of an existing non-collapsible nav object that parses YAML can now be created using a subclass. E.g.:
class PrimaryNav(prototypes.NavObject):
# Path to YAML file representing the object
YAML_FILE = os.path.join(os.path.dirname(__file__), 'primary_nav.yml')
# Used for internal methods (do not modify)
SITE_CONFIG = SiteConfig
class MobilePrimaryNav(PrimaryNav):
COLLAPSIBLE = True
MENU_LOCATOR = (By.ID, 'nav-menu')
EXPAND_BUTTON_LOCATOR = (By.ID, 'navbar-toggle')
Details
NavObject.parse_yaml()
now only retrieves 'menu_locator', 'expand_button_locator', and (optionally) 'collapse_button_locator' if the corresponding attributes aren't explicitly set in the class. This allows code to be reused from a non-collapsible nav to create a collapsible variant
2.11.2: Fixed scrolling to link with fixed navs
fixed scrolling in fixed navs
2.11.1: Normal locator support in non-YAML page object dictionaries
If a tuple is passed to pageobject.utils.yaml.parse_locator_dict()
, it's immediately returned as it's assumed to already be a locator. This allows non-YAML representations of page objects to just use normal locators. (Example documentation to be added in an upcoming docs update)
Details
- Updated
pageobject.utils.yaml.parse_locator_dict()
to handle normal locators in addition to locator dictionaries