File tree 1 file changed +13
-4
lines changed 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,20 @@ cy.getByLabelText('username').should('exist')
131
131
132
132
<!-- END_DOCUSAURUS_CODE_TABS-->
133
133
134
- It will NOT find the input node for label text broken up by elements. For this
135
- case, you can provide a ` selector ` in the options :
134
+ You may also need to filter down the results of the query.
135
+ For that you can use the ` selector ` option :
136
136
137
- ``` html
138
- <label > <span >Username</span > <input /> </label >
137
+ ``` js
138
+ // Label containing multiple elements
139
+ < label>
140
+ < span> Username< / span>
141
+ < input / >
142
+ < / label>
143
+
144
+ // Multiple elements labelled via aria-labelledby
145
+ < label id= " username" > Username< / label>
146
+ < input aria- labelledby= " username" / >
147
+ < span aria- labelledby= " username" > Please enter your username< / span>
139
148
```
140
149
141
150
``` js
You can’t perform that action at this time.
0 commit comments