use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa40Rule081002 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (dirAttributeWithAllowedValue.isEmpty() && dirAttributeWithNotAllowedValue.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
totalNumberOfElements = 0;
return;
}
// Tags with dir attribute (with not allowed value)
ElementChecker dirAttributeWithNotAllowedValueChecker = new ElementPresenceChecker(new ImmutablePair(TestSolution.FAILED, DIR_ATTRIBUTE_WITH_NOT_ALLOWED_VALUE_MSG), new ImmutablePair(TestSolution.PASSED, ""), DIR_ATTR, TEXT_ELEMENT2);
dirAttributeWithNotAllowedValueChecker.check(sspHandler, dirAttributeWithNotAllowedValue, testSolutionHandler);
// Tags with dir attribute (with allowed value)
ElementChecker dirAttributeWithAllowedValueChecker = new ElementPresenceChecker(new ImmutablePair(TestSolution.NEED_MORE_INFO, DIR_ATTRIBUTE_WITH_ALLOWED_VALUE_MSG), new ImmutablePair(TestSolution.PASSED, ""), DIR_ATTR, TEXT_ELEMENT2);
dirAttributeWithAllowedValueChecker.check(sspHandler, dirAttributeWithAllowedValue, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa40Rule010202 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
ElementChecker passedOnPresenceChecker = new ElementPresenceChecker(new ImmutablePair<>(PASSED, ""), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
passedOnPresenceChecker.check(sspHandler, areaAriaHiddenWithMarkerHandler, testSolutionHandler);
ElementChecker areaWithNotEmptyAlternativeWithMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(FAILED, DECORATIVE_ELEMENT_WITH_NOT_EMPTY_TEXTUAL_ALTERNATIVE_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
areaWithNotEmptyAlternativeWithMarkerChecker.check(sspHandler, areaWithNotEmptyAlternativeWithMarkerHandler, testSolutionHandler);
passedOnPresenceChecker.check(sspHandler, areaWithEmptyAlternativeWithMarkerHandler, testSolutionHandler);
ElementChecker areaWithNotEmptyAlternativeWithoutMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(NEED_MORE_INFO, CHECK_NATURE_OF_IMAGE_WITH_TEXTUAL_ALTERNATIVE_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
areaWithNotEmptyAlternativeWithoutMarkerChecker.check(sspHandler, areaWithNotEmptyAlternativeWithoutMarkerHandler, testSolutionHandler);
ElementChecker areaAriaHiddenWithoutMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(NEED_MORE_INFO, CHECK_NATURE_OF_IMAGE_HIDDEN_WITH_ARIA_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
areaAriaHiddenWithoutMarkerChecker.check(sspHandler, areaAriaHiddenWithoutMarkerHandler, testSolutionHandler);
ElementChecker areaWithEmptyAlternativeWithoutMarkerChecker = new ElementPresenceChecker(new ImmutablePair<>(NEED_MORE_INFO, CHECK_NATURE_OF_IMAGE_WITHOUT_TEXTUAL_ALTERNATIVE_MSG), new ImmutablePair<>(NOT_APPLICABLE, ""), eeList);
areaWithEmptyAlternativeWithoutMarkerChecker.check(sspHandler, areaWithEmptyAlternativeWithoutMarkerHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Aw22Rule05081 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
super.check(sspHandler, testSolutionHandler);
ElementChecker ec;
if (!notIdentifiedTableWithoutDataTableMarkup.isEmpty()) {
ec = new ElementPresenceChecker(// nmi when element is found
TestSolution.NEED_MORE_INFO, // na when element is not found
TestSolution.NOT_APPLICABLE, // message associated when element is found
CHECK_TABLE_IS_PRESENTATION_TABLE_MSG, // no message created when child element is not found
null);
ec.check(sspHandler, notIdentifiedTableWithoutDataTableMarkup, testSolutionHandler);
}
if (!presentationTableWithoutDataTableMarkup.isEmpty()) {
ec = new ElementPresenceChecker(TestSolution.PASSED, // na when element is not found
TestSolution.NOT_APPLICABLE, // message associated when element is found
null, // no message created when child element is not found
null);
ec.check(sspHandler, presentationTableWithoutDataTableMarkup, testSolutionHandler);
}
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa22Rule06141 method checkButtonSelection.
@Override
protected void checkButtonSelection(SSPHandler sspHandler, ElementHandler formButtonHandler, TestSolutionHandler testSolutionHandler) {
if (formButtonHandler.isEmpty()) {
return;
}
// checker used to create remark on form elements
ElementChecker ec = new ElementPresenceChecker(// nmi when element is found
TestSolution.NEED_MORE_INFO, // na when element is not found
TestSolution.NOT_APPLICABLE, // message associated with each found form element
CHECK_BUTTON_TITLE_PERTINENCE_MSG, null, TEXT_ELEMENT2, VALUE_ATTR);
ec.check(sspHandler, formButtonHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.ElementChecker in project Asqatasun by Asqatasun.
the class Rgaa22Rule06161 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (getElements().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);
}
Aggregations