use of org.asqatasun.rules.elementselector.SimpleElementSelector in project Asqatasun by Asqatasun.
the class AbstractUniqueElementSiteRuleImplementation method extractRelCanonical.
/**
*
* @param sspHandler
* @param prs
* @param remarks
*/
private void extractRelCanonical(SSPHandler sspHandler, ProcessRemarkService prs, Collection<ProcessRemark> remarks) {
ElementSelector relCanonicalSelector = new SimpleElementSelector(CssLikeQueryStore.REL_CANONICAL_CSS_LIKE_QUERY);
ElementHandler<Element> relCan = new ElementHandlerImpl();
relCanonicalSelector.selectElements(sspHandler, relCan);
if (relCan.get().size() != 1) {
return;
}
String relValue = ((Element) relCan.get().iterator().next()).absUrl(AttributeStore.HREF_ATTR);
if (!StringUtils.equalsIgnoreCase(relValue, sspHandler.getSSP().getURI())) {
remarks.add(prs.createConsolidationRemark(TestSolution.PASSED, REL_CAN_VALUE_REMARK_MSG, relValue, sspHandler.getSSP().getURI()));
}
}
use of org.asqatasun.rules.elementselector.SimpleElementSelector in project Asqatasun by Asqatasun.
the class AbstractAriaPageRuleWithSelectorAndCheckerImplementation method select.
/**
* Perform the selection using the {@link ElementSelector}
*
* @param sspHandler
*/
@Override
protected void select(SSPHandler sspHandler) {
ElementSelector es = new SimpleElementSelector("[^aria]");
es.selectElements(sspHandler, ariaElementHandler);
if (ariaElementHandler.isEmpty()) {
return;
}
super.select(sspHandler);
}
use of org.asqatasun.rules.elementselector.SimpleElementSelector in project Asqatasun by Asqatasun.
the class Rgaa30Rule080901 method select.
@Override
protected void select(SSPHandler sspHandler) {
// Selection of all links without target
ElementSelector linkWithoutTargetSelector = new SimpleElementSelector(LINK_WITHOUT_TARGET_CSS_LIKE_QUERY);
linkWithoutTargetSelector.selectElements(sspHandler, linkWithoutTarget);
// Selection of all links without target
ElementSelector fielsetNotWithinFormSelector = new SimpleElementSelector(FIELDSET_NOT_WITHIN_FORM_CSS_LIKE_QUERY);
fielsetNotWithinFormSelector.selectElements(sspHandler, fieldsetNotWithinForm);
totalNumberOfElements = sspHandler.getTotalNumberOfElements();
}
use of org.asqatasun.rules.elementselector.SimpleElementSelector in project Asqatasun by Asqatasun.
the class Rgaa32016Rule060501 method select.
@Override
protected void select(SSPHandler sspHandler) {
ElementSelector elementsSelector = new SimpleElementSelector(NOT_ANCHOR_LINK_CSS_LIKE_QUERY);
elementsSelector.selectElements(sspHandler, linksHandler);
for (Element el : linksHandler.get()) {
if (StringUtils.isBlank(el.text()) && el.getElementsByAttributeValueMatching(ALT_ATTR, "^(?=\\s*\\S).*$").isEmpty()) {
emptyLinksHandler.add(el);
}
}
}
use of org.asqatasun.rules.elementselector.SimpleElementSelector in project Asqatasun by Asqatasun.
the class Rgaa32016Rule080901 method select.
@Override
protected void select(SSPHandler sspHandler) {
// Selection of all links without target
ElementSelector linkWithoutTargetSelector = new SimpleElementSelector(LINK_WITHOUT_TARGET_CSS_LIKE_QUERY);
linkWithoutTargetSelector.selectElements(sspHandler, linkWithoutTarget);
// Selection of all links without target
ElementSelector fielsetNotWithinFormSelector = new SimpleElementSelector(FIELDSET_NOT_WITHIN_FORM_CSS_LIKE_QUERY);
fielsetNotWithinFormSelector.selectElements(sspHandler, fieldsetNotWithinForm);
totalNumberOfElements = sspHandler.getTotalNumberOfElements();
}
Aggregations