File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -530,15 +530,18 @@ cy.getByDisplayValue('Alaska').should('exist')
530
530
``` typescript
531
531
getByRole (
532
532
container : HTMLElement ,
533
- text : TextMatch ,
533
+ role : TextMatch ,
534
534
options ?: {
535
535
exact?: boolean = true ,
536
536
normalizer?: NormalizerFn ,
537
537
}): HTMLElement
538
538
```
539
539
540
- A shortcut to `` container.querySelector(`[role="${yourRole}"]`) `` (and it also
541
- accepts a [ ` TextMatch ` ] ( #textmatch ) ).
540
+ Queries for elements with the given role (and it also
541
+ accepts a [ ` TextMatch ` ] ( #textmatch ) ). Default roles are taken
542
+ into consideration e.g. ` <button /> ` has the ` button ` role without
543
+ explicitly setting the ` role ` attribute. The [ W3C HTML recommendation] ( https://www.w3.org/TR/html5/index.html#contents )
544
+ lists all HTML elements with their default aria roles.
542
545
543
546
``` html
544
547
<div role =" dialog" >...</div >
You can’t perform that action at this time.
0 commit comments