Skip to content

Commit

Permalink
docs(playwright): update docs to show include/exclude chaining (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zidious authored Nov 1, 2021
1 parent 4b8ab26 commit 9bb0286
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions packages/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,44 @@ new AxeBuilder({ page })
});
```

### AxeBuilder#include(selector: String)
### AxeBuilder#include(selector: String | String[])

Adds a CSS selector to the list of elements to include in analysis

```js
new AxeBuilder({ page }).include('.results-panel');
```

### AxeBuilder#exclude(selector: String)
Method chaining is also available, add multiple CSS selectors to the list of elements to include in analysis

```js
new AxeBuilder({ page })
.include('.selector-one')
.include('.selector-two')
.include('.selector-three');
```

Note: arrays with more than one index when passing multiple CSS selectors are not currently supported example: ` .include(['#foo', '#bar', '#baz'])`

### AxeBuilder#exclude(selector: String | String[])

Add a CSS selector to the list of elements to exclude from analysis

```js
new AxeBuilder({ page }).exclude('.another-element');
```

Method chaining is also available, add multiple CSS selectors to the list of elements to exclude from analysis

```js
new AxeBuilder({ page })
.exclude('.selector-one')
.exclude('.selector-two')
.exclude('.selector-three');
```

Note: arrays with more than one index when passing multiple CSS selectors are not currently supported example: ` .exclude(['#foo', '#bar', '#baz'])`

### AxeBuilder#options(options: [axe.RunOptions](https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter))

Specifies options to be used by `axe.run`. Will override any other configured options. including calls to `AxeBuilder#withRules()` and `AxeBuilder#withTags()`. See [axe-core API documentation](https://github.com/dequelabs/axe-core/blob/master/doc/API.md) for information on its structure.
Expand Down

0 comments on commit 9bb0286

Please sign in to comment.