This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this we can provide an elegant and concise way of validating page object classes.
It replaces the current per implementation validation (by overriding the isValidClassFor... method in PageObject) with an annotation based approach. The old method was deprecated and will be removed in v1.3.0.
Examples:
@Mapping(tag="div")
Will be evaluated as 'valid' in case the web element has the tag 'div'.@Mapping(tag="select", attribute="multiple")
Will be evaluated as 'valid' in case the web element has the tag 'select' and the 'multiple' attribute is present.@Mapping(tag="select", attribute="!multiple")
Will be evaluated as 'valid' in case the web element has the tag 'select' and the 'multiple' attribute is not present.@Mapping(tag="input", attribute="type", values={"text", "password"})
Will be evaluated as 'valid' in case the web element has the tag 'input' and the 'type' attribute has either the 'text' oder 'password' value.@Mapping(validator=FooValidator.class)
Will create a new instance of the given validator class and use it to evaluate the web element.