File tree Expand file tree Collapse file tree
src/platform/packages/shared/kbn-scout/src/playwright/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,19 +15,27 @@ import { AXE_OPTIONS, AXE_IMPACT_LEVELS } from '@kbn/axe-config';
1515import type { KibanaUrl } from '../../..' ;
1616
1717export interface RunA11yScanOptions {
18- /** Optional CSS selectors to exclude from scan */
18+ /** Optional CSS selectors to include in analysis */
19+ include ?: string [ ] ;
20+ /** Optional CSS selectors to exclude from analysis */
1921 exclude ?: string [ ] ;
2022 /** Timeout in ms for the scan (defaults 10000) */
2123 timeoutMs ?: number ;
2224}
2325
2426const runA11yScan = async (
2527 page : Page ,
26- { exclude = [ ] , timeoutMs = 10000 } : RunA11yScanOptions = { }
28+ { include = [ ] , exclude = [ ] , timeoutMs = 10000 } : RunA11yScanOptions = { }
2729) => {
2830 const builder = new AxeBuilder ( { page } ) ;
2931 builder . options ( AXE_OPTIONS ) ;
3032
33+ if ( include ) {
34+ for ( const selector of include ) {
35+ builder . include ( selector ) ;
36+ }
37+ }
38+
3139 if ( exclude ) {
3240 for ( const selector of exclude ) {
3341 builder . exclude ( selector ) ;
You can’t perform that action at this time.
0 commit comments