use of org.asqatasun.rules.elementselector.LinkElementSelector in project Asqatasun by Asqatasun.
the class AbstractLinkRuleImplementation method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
LinkElementSelector linkElementSelector = getLinkElementSelector();
if (linkElementSelector.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
if (!linkElementSelector.getDecidableElements().isEmpty()) {
setServicesToChecker(decidableElementsChecker);
decidableElementsChecker.check(sspHandler, linkElementSelector.getDecidableElements(), testSolutionHandler);
}
if (!linkElementSelector.getNotDecidableElements().isEmpty()) {
setServicesToChecker(notDecidableElementsChecker);
notDecidableElementsChecker.check(sspHandler, linkElementSelector.getNotDecidableElements(), testSolutionHandler);
}
}
use of org.asqatasun.rules.elementselector.LinkElementSelector in project Asqatasun by Asqatasun.
the class Rgaa22Rule06021 method select.
@Override
protected void select(SSPHandler sspHandler) {
ElementHandler<Element> tmpElHandler = new ElementHandlerImpl();
/* the image link element selector */
LinkElementSelector linkElementSelector = new LinkElementSelector(false);
linkElementSelector.selectElements(sspHandler, tmpElHandler);
for (Element el : linkElementSelector.getDecidableElements().get()) {
if (doesElementHaveRequestedTargetAttribute(el)) {
imageLinks.add(el);
}
}
LinkElementSelector compositeLinkElementSelector = new CompositeLinkElementSelector(false, false);
tmpElHandler.clean();
compositeLinkElementSelector.selectElements(sspHandler, tmpElHandler);
for (Element el : compositeLinkElementSelector.getDecidableElements().get()) {
if (doesElementHaveRequestedTargetAttribute(el)) {
imageLinks.add(el);
}
}
linkSelected = imageLinks.get().size();
ElementSelector formElementSelector = new SimpleElementSelector(HtmlElementStore.FORM_ELEMENT);
tmpElHandler.clean();
formElementSelector.selectElements(sspHandler, tmpElHandler);
for (Element el : tmpElHandler.get()) {
if (doesElementHaveRequestedTargetAttribute(el)) {
formWithTargetHandler.add(el);
}
}
}
use of org.asqatasun.rules.elementselector.LinkElementSelector in project Asqatasun by Asqatasun.
the class Rgaa22Rule06031 method select.
@Override
protected void select(SSPHandler sspHandler) {
/* the image link element selector */
LinkElementSelector compositeLinkElementSelector = new CompositeLinkElementSelector(false, true);
ElementHandler<Element> elHandler = new ElementHandlerImpl();
compositeLinkElementSelector.selectElements(sspHandler, elHandler);
for (Element el : compositeLinkElementSelector.getDecidableElements().get()) {
if (doesElementHaveRequestedTargetAttribute(el)) {
compositeLinks.add(el);
}
}
LinkElementSelector areaLinkElementSelector = new AreaLinkElementSelector(false);
elHandler.clean();
areaLinkElementSelector.selectElements(sspHandler, elHandler);
for (Element el : areaLinkElementSelector.getDecidableElements().get()) {
if (doesElementHaveRequestedTargetAttribute(el)) {
compositeLinks.add(el);
}
}
}
Aggregations