Skip to content

Commit 177aa73

Browse files
committed
auto updated documentation
1 parent a844c9e commit 177aa73

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

docs/reference/Locator.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Locator::contains('div[ * `contenteditable=true]',` 'hello world');
7474
* `param` $text
7575
* `return` string
7676
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)
7878
7979
### elementAt
8080
@@ -100,7 +100,7 @@ Locator::elementAt('table#grind>tr', -2); // previous than last row
100100
* `param` $position xpath index
101101
* `return` mixed
102102

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)
104104

105105
### find
106106

@@ -124,7 +124,7 @@ $I->seeElement(Locator::find('img', ['title' => 'diagram']));
124124

125125
* `return` string
126126

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)
128128

129129
### firstElement
130130

@@ -146,7 +146,7 @@ Locator::firstElement('//table/tr');
146146
* `param` $element
147147
* `return` mixed
148148
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)
150150
151151
### href
152152
@@ -179,18 +179,27 @@ Transforms strict locator, \Facebook\WebDriver\WebDriverBy into a string represe
179179
* `param` $selector
180180
* `return` string
181181

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)
183183

184184
### isCSS
185185

186186
*static*
187187

188188
Checks that provided string is CSS selector
189189

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+
190199
* `param` $selector
191200
* `return` bool
192201

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)
194203

195204
### isID
196205

@@ -200,18 +209,27 @@ Checks that string and CSS selector for element by ID
200209
* `param` $id
201210
* `return` bool
202211

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)
204213

205214
### isXPath
206215

207216
*static*
208217

209218
Checks that locator is an XPath
210219

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+
211229
* `param` $locator
212230
* `return` bool
213231

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)
215233

216234
### lastElement
217235

@@ -233,19 +251,28 @@ Locator::lastElement('//table/tr');
233251
* `param` $element
234252
* `return` mixed
235253
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)
237255
238256
### option
239257
240258
*static*
241259
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 %}
243270

244271
* `param` $value
245272

246273
* `return` string
247274

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)
249276

250277
### tabIndex
251278

0 commit comments

Comments
 (0)