Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Mapping based validation #31

Merged
merged 2 commits into from
Feb 23, 2016
Merged

Mapping based validation #31

merged 2 commits into from
Feb 23, 2016

Conversation

slu-it
Copy link
Member

@slu-it slu-it commented Feb 5, 2016

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.

Review on Reviewable

@slu-it slu-it added this to the 1.2.0 milestone Feb 5, 2016
slu-it added a commit that referenced this pull request Feb 23, 2016
@slu-it slu-it merged commit 6083c87 into testIT-WebTester:master Feb 23, 2016
@slu-it slu-it deleted the mapping-based-validation branch February 25, 2016 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants