use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa32016Rule060501 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (linksHandler.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
if (emptyLinksHandler.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.PASSED);
return;
}
ElementChecker ec = new ElementPresenceChecker(new ImmutablePair(TestSolution.FAILED, EMPTY_LINK_MSG), new ImmutablePair(TestSolution.PASSED, ""), HREF_ATTR);
ec.check(sspHandler, emptyLinksHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa32016Rule080901 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (linkWithoutTarget.isEmpty() && fieldsetNotWithinForm.isEmpty()) {
sspHandler.getProcessRemarkService().addProcessRemark(TestSolution.NEED_MORE_INFO, RuleCheckHelper.specifyMessageToRule(NO_PATTERN_DETECTED_MSG, this.getTest().getCode()));
testSolutionHandler.addTestSolution(TestSolution.NEED_MORE_INFO);
return;
}
ElementChecker linkWithoutTargetChecker = new ElementPresenceChecker(new ImmutablePair(TestSolution.FAILED, LINK_WITHOUT_TARGET_MSG), new ImmutablePair(TestSolution.PASSED, ""));
linkWithoutTargetChecker.check(sspHandler, linkWithoutTarget, testSolutionHandler);
ElementChecker fieldsetNotWithinFormChecker = new ElementPresenceChecker(new ImmutablePair(TestSolution.NEED_MORE_INFO, FIELDSET_NOT_WITHIN_FORM_MSG), new ImmutablePair(TestSolution.PASSED, ""));
fieldsetNotWithinFormChecker.check(sspHandler, fieldsetNotWithinForm, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa32016Rule100102 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
// Attributes checks
for (Map.Entry<String, ElementHandler> attrElementHandlerMapEntry : attrElementHandlerMap.entrySet()) {
ElementChecker attrEc = new ElementWithAttributePresenceChecker(new ImmutablePair(TestSolution.FAILED, PRESENTATION_ATTR_DETECTED_MSG), new ImmutablePair(TestSolution.PASSED, ""), attrElementHandlerMapEntry.getKey());
attrEc.check(sspHandler, attrElementHandlerMapEntry.getValue(), testSolutionHandler);
}
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class AbstractDecorativeImageEmptyAlternativePageRuleImplementation method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
ElementChecker elementWithEmptyAlternativeWithMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(PASSED, ""), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
elementWithEmptyAlternativeWithMarkerChecker.check(sspHandler, elementWithEmptyAlternativeWithMarkerHandler, testSolutionHandler);
ElementChecker elementWithNotEmptyAlternativeWithMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(FAILED, DECORATIVE_ELEMENT_WITH_NOT_EMPTY_TEXTUAL_ALTERNATIVE_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
elementWithNotEmptyAlternativeWithMarkerChecker.check(sspHandler, elementWithNotEmptyAlternativeWithMarkerHandler, testSolutionHandler);
ElementChecker elementWithNotEmptyAlternativeWithoutMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(NEED_MORE_INFO, CHECK_NATURE_OF_IMAGE_WITH_TEXTUAL_ALTERNATIVE_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
elementWithNotEmptyAlternativeWithoutMarkerChecker.check(sspHandler, elementWithNotEmptyAlternativeWithoutMarkerHandler, testSolutionHandler);
ElementChecker elementWithEmptyAlternativeWithoutMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(NEED_MORE_INFO, CHECK_NATURE_OF_IMAGE_WITHOUT_TEXTUAL_ALTERNATIVE_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
elementWithEmptyAlternativeWithoutMarkerChecker.check(sspHandler, elementWithEmptyAlternativeWithoutMarkerHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Aw22Rule08091 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (linkWithoutTarget.isEmpty() && fieldsetNotWithinForm.isEmpty()) {
sspHandler.getProcessRemarkService().addProcessRemark(TestSolution.NEED_MORE_INFO, RuleCheckHelper.specifyMessageToRule(NO_PATTERN_DETECTED_MSG, this.getTest().getCode()));
testSolutionHandler.addTestSolution(TestSolution.NEED_MORE_INFO);
return;
}
ElementChecker linkWithoutTargetChecker = new ElementPresenceChecker(TestSolution.FAILED, TestSolution.PASSED, LINK_WITHOUT_TARGET_MSG, null);
linkWithoutTargetChecker.check(sspHandler, linkWithoutTarget, testSolutionHandler);
ElementChecker fieldsetNotWithinFormChecker = new ElementPresenceChecker(TestSolution.FAILED, TestSolution.PASSED, FIELDSET_NOT_WITHIN_FORM_MSG, null);
fieldsetNotWithinFormChecker.check(sspHandler, fieldsetNotWithinForm, testSolutionHandler);
}
Aggregations