API Reference for Cucumber
API reference for the AxeWorld class in Axe DevTools for Web Java
This document is a reference for types provided by the cucumber package. Unlike the Selenium and Hamcrest packages, the Cucumber package has no builder or matcher class for scoping and rule configuration. Those options are instead expressed directly in the Gherkin step text, as described in Write Cucumber Tests. The AxeWorld class only holds the state and configuration that Gherkin steps can't express, such as the page to check, analytics settings, custom reporting options, and the axe-core timeout.
com.deque.html.axedevtools.cucumber.AxeWorld
Holds the page and configuration used by the Cucumber accessibility steps when checking accessibility.
public StepDefinitions(AxeWorld axeWorld) {
this.axeWorld = axeWorld;
}
@Before
public void setup() throws IOException {
webDriver = new ChromeDriver();
axeWorld.setPage(new AxeDriver(webDriver));
}AxeWorld()
Create a new AxeWorld.
AxeDriver getPage()
Gets the page set to the world.
Returns the page set to the world.
void setPage(final AxeDriver page)
Define the page to perform an accessibility check against.
page: the page to perform an accessibility check against.
void enableAnalytics(final boolean state)
Set whether or not to send analytics data.
state: whether or not to send analytics data.
void setAnalyticsUrl(final String url)
Set the URL to send analytics data to.
url: URL to send analytics data to.
void setAnalyticsDistinctId(final String did)
Set the distinct id to use when sending analytics data.
did: distinct id to use when sending data.
void setAnalyticsComponentName(final String name)
Set the name of the project for analytics.
name: name of project for analytics.
void setReportingOptions(final AxeReportingOptions reportingOptions)
Set the options to use when generating reports.
reportingOptions: options to use when generating reports.
void setTimeout(final int timeout)
Set the timeout for execution of axe-core.
timeout: how long axe-core analyzes a page before timing out.
