Class PageReportBuilder
Classes for generating HTML report from given Axe-Core results
Inheritance
Namespace: AxaFrance.AxeExtended.HtmlReport
Assembly: AxaFrance.AxeExtended.HtmlReport.dll
Syntax
public class PageReportBuilder
Constructors
| Edit this page View SourcePageReportBuilder()
Initializes a new instance of the PageReportBuilder class using default options.
Declaration
public PageReportBuilder()
PageReportBuilder(PageReportOptions)
Initializes a new instance of the PageReportBuilder class using the specified options.
Declaration
public PageReportBuilder(PageReportOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| PageReportOptions | options |
Properties
| Edit this page View SourceAnalyze
Delegate to analyze the given context. this function should be implemented according to test framework. such as using Selenium.
Declaration
public PageReportBuilder.AnalyzeDelegate Analyze { get; }
Property Value
| Type | Description |
|---|---|
| PageReportBuilder.AnalyzeDelegate |
CanGetScreenshot
Indicate whether Screenshot is available in the currenct context. Internally, it means GetScreenshot delegate is provided.
Declaration
public bool CanGetScreenshot { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Config
Provide a custom axe configure (https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure). If provided, the configuration will be used. If not provided, the default axe configuration will be used.
Declaration
public JObject Config { get; set; }
Property Value
| Type | Description |
|---|---|
| JObject |
GetScreenshot
Delegate to get screenshot of the given node. this function should be implemented according to test framework. such as Selenium.
Declaration
public PageReportBuilder.GetScreenshotDelegate GetScreenshot { get; }
Property Value
| Type | Description |
|---|---|
| PageReportBuilder.GetScreenshotDelegate |
Options
Options for the page report.
Declaration
public PageReportOptions Options { get; set; }
Property Value
| Type | Description |
|---|---|
| PageReportOptions |
Result
Test result of the page.
Declaration
public AxePageResult Result { get; }
Property Value
| Type | Description |
|---|---|
| AxePageResult |
Methods
| Edit this page View SourceBuild()
Analyze and Build the test report of the given context.
Declaration
public PageReportBuilder Build()
Returns
| Type | Description |
|---|---|
| PageReportBuilder |
Build(AxeResult)
Converts the given Axe-Core results to HTML report using actual configuration.
Declaration
public PageReportBuilder Build(AxeResult result)
Parameters
| Type | Name | Description |
|---|---|---|
| AxeResult | result | The AxeResult to be converted. |
Returns
| Type | Description |
|---|---|
| PageReportBuilder |
Export(string)
Export Enhanced AxeResult (with Screenshots) to expected format.
Declaration
public string Export(string fileName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The filename of the exported report. Default value is "index.html" |
Returns
| Type | Description |
|---|---|
| string | absolute path of the exported test report. |
WithConfig(JObject)
Initilaize axe-core engine with custom configuration.
Declaration
public PageReportBuilder WithConfig(JObject config)
Parameters
| Type | Name | Description |
|---|---|---|
| JObject | config | axe costom configuration object |
Returns
| Type | Description |
|---|---|
| PageReportBuilder |
WithConfig(string)
Initilaize axe-core engine with customed configuration
Declaration
public PageReportBuilder WithConfig(string configFile)
Parameters
| Type | Name | Description |
|---|---|---|
| string | configFile | axe core configuration file (in json format) |
Returns
| Type | Description |
|---|---|
| PageReportBuilder |
WithOptions(PageReportOptions)
Provide a custom test options
Declaration
public PageReportBuilder WithOptions(PageReportOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| PageReportOptions | options | Options |
Returns
| Type | Description |
|---|---|
| PageReportBuilder | ReportBuilder with updated options |
WithRgaaExtension()
Initilaize axe-core engine with customed RGAA rules.
Declaration
public PageReportBuilder WithRgaaExtension()
Returns
| Type | Description |
|---|---|
| PageReportBuilder |
Remarks
This method is not compatible with other WithConfig(JObject) method.