use of org.asqatasun.rules.elementchecker.element.ElementPresenceChecker in project Asqatasun by Asqatasun.
the class Aw22Rule06061 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(TestSolution.FAILED, TestSolution.PASSED, EMPTY_LINK_MSG, null, HREF_ATTR);
ec.check(sspHandler, emptyLinksHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.element.ElementPresenceChecker in project Asqatasun by Asqatasun.
the class Rgaa22Rule07081 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
// Tags check
ElementChecker ec = new ElementPresenceChecker(TestSolution.FAILED, TestSolution.PASSED, PRESENTATION_TAG_DETECTED_MSG, null);
ec.check(sspHandler, deprecatedElementHandler, 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.element.ElementPresenceChecker in project Asqatasun by Asqatasun.
the class Rgaa22Rule07091 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);
}
use of org.asqatasun.rules.elementchecker.element.ElementPresenceChecker in project Asqatasun by Asqatasun.
the class Rgaa22Rule06021 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (imageLinks.isEmpty() && formWithTargetHandler.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
ElementPresenceChecker epc = new ElementPresenceChecker(TestSolution.NEED_MORE_INFO, TestSolution.NOT_APPLICABLE, CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, null, TEXT_ELEMENT2, TITLE_ATTR);
epc.setTextElementBuilder(new LinkTextElementBuilder());
epc.check(sspHandler, imageLinks, testSolutionHandler);
epc = new ElementPresenceChecker(TestSolution.NEED_MORE_INFO, TestSolution.NOT_APPLICABLE, CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, null);
epc.check(sspHandler, formWithTargetHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.element.ElementPresenceChecker in project Asqatasun by Asqatasun.
the class Rgaa22Rule06031 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (compositeLinks.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
ElementPresenceChecker epc = new ElementPresenceChecker(TestSolution.NEED_MORE_INFO, TestSolution.NOT_APPLICABLE, CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, null, TEXT_ELEMENT2, TITLE_ATTR);
epc.setTextElementBuilder(new LinkTextElementBuilder());
epc.check(sspHandler, compositeLinks, testSolutionHandler);
}
Aggregations