@@ -74,7 +74,7 @@ Locator::contains('div[ * `contenteditable=true]',` 'hello world');
74
74
* `param` $text
75
75
* `return` string
76
76
77
- [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L212 )
77
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L233 )
78
78
79
79
### elementAt
80
80
@@ -100,7 +100,7 @@ Locator::elementAt('table#grind>tr', -2); // previous than last row
100
100
* `param` $position xpath index
101
101
* `return` mixed
102
102
103
- [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L237 )
103
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L258 )
104
104
105
105
### find
106
106
@@ -124,7 +124,7 @@ $I->seeElement(Locator::find('img', ['title' => 'diagram']));
124
124
125
125
* `return` string
126
126
127
- [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L144 )
127
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L151 )
128
128
129
129
### firstElement
130
130
@@ -146,7 +146,7 @@ Locator::firstElement('//table/tr');
146
146
* `param` $element
147
147
* `return` mixed
148
148
149
- [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L266 )
149
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L287 )
150
150
151
151
### href
152
152
@@ -179,18 +179,27 @@ Transforms strict locator, \Facebook\WebDriver\WebDriverBy into a string represe
179
179
* ` param ` $selector
180
180
* ` return ` string
181
181
182
- [ See source] ( https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L297 )
182
+ [ See source] ( https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L318 )
183
183
184
184
### isCSS
185
185
186
186
* static*
187
187
188
188
Checks that provided string is CSS selector
189
189
190
+ {% highlight php %}
191
+
192
+ <? php
193
+ Locator::isCSS('#user .hello') => true
194
+ Locator::isCSS('body') => true
195
+ Locator::isCSS('//body/p/user') => false
196
+
197
+ {% endhighlight %}
198
+
190
199
* `param` $selector
191
200
* `return` bool
192
201
193
- [ See source] ( https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L163 )
202
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L177 )
194
203
195
204
### isID
196
205
@@ -200,18 +209,27 @@ Checks that string and CSS selector for element by ID
200
209
* `param` $id
201
210
* `return` bool
202
211
203
- [ See source] ( https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L191 )
212
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L212 )
204
213
205
214
### isXPath
206
215
207
216
*static*
208
217
209
218
Checks that locator is an XPath
210
219
220
+ {% highlight php %}
221
+
222
+ <? php
223
+ Locator::isCSS('#user .hello') => false
224
+ Locator::isCSS('body') => false
225
+ Locator::isCSS('//body/p/user') => true
226
+
227
+ {% endhighlight %}
228
+
211
229
* `param` $locator
212
230
* `return` bool
213
231
214
- [ See source] ( https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L179 )
232
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L200 )
215
233
216
234
### lastElement
217
235
@@ -233,19 +251,28 @@ Locator::lastElement('//table/tr');
233
251
* `param` $element
234
252
* `return` mixed
235
253
236
- [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L286 )
254
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L307 )
237
255
238
256
### option
239
257
240
258
*static*
241
259
242
- Matches option by text
260
+ Matches option by text:
261
+
262
+ {% highlight php %}
263
+
264
+ <?php
265
+ use Codeception\Util\Locator;
266
+
267
+ $I-> seeElement(Locator::option('Male'), '#select-gender');
268
+
269
+ {% endhighlight %}
243
270
244
271
* `param` $value
245
272
246
273
* `return` string
247
274
248
- [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L109 )
275
+ [See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L116 )
249
276
250
277
### tabIndex
251
278
0 commit comments