Skip to content

Commit c0f3050

Browse files
authored
Update README.md
1 parent 1de1c84 commit c0f3050

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
# queryByRole
22
This is a implementation of `queryByRole` for browser.
3+
4+
## Usage
5+
6+
You'll get the button whose accessible name is "Click!" from window with the following code.
7+
```ts
8+
const targetWindow = createTargetWindow(window);
9+
const buttonRoleElements = targetWindow.queryByRole("button", {
10+
name: "Click!",
11+
});
12+
console.log(buttonRoleElements); // -> [button]
13+
```

0 commit comments

Comments
 (0)