@@ -103,6 +103,8 @@ If link is an image it's found by alt attribute value of image.
103
103
If button is image button is found by it's value
104
104
If link or button can't be found by name they are searched by CSS selector.
105
105
106
+ The second parameter is a context: CSS or XPath locator to narrow the search.
107
+
106
108
Examples:
107
109
108
110
{% highlight php %}
@@ -116,10 +118,13 @@ $I->click('Submit');
116
118
$I->click('#form input[type=submit]');
117
119
// XPath
118
120
$I->click('//form/*[@type=submit]')
121
+ // link in context
122
+ $I->click('Logout', '#nav');
119
123
?>
120
124
121
125
{% endhighlight %}
122
126
* param $link
127
+ * param $context
123
128
124
129
125
130
#### dontSee
@@ -163,6 +168,65 @@ $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user
163
168
* param $checkbox
164
169
165
170
171
+ #### dontSeeCurrentUrlEquals
172
+
173
+
174
+ Checks that current url is not equal to value.
175
+ Unlike `dontSeeInCurrentUrl` performs a strict check.
176
+
177
+ <? php
178
+ // current url is not root
179
+ $I-> dontSeeCurrentUrlEquals('/');
180
+ ?>
181
+
182
+ * param $uri
183
+
184
+
185
+ #### dontSeeCurrentUrlMatches
186
+
187
+
188
+ Checks that current url does not match a RegEx value
189
+
190
+ <? php
191
+ // to match root url
192
+ $I-> dontSeeCurrentUrlMatches('~$/users/(\d+)~');
193
+ ?>
194
+
195
+ * param $uri
196
+
197
+
198
+ #### dontSeeElement
199
+
200
+
201
+ Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
202
+
203
+ {% highlight php %}
204
+
205
+ <? php
206
+ $I-> dontSeeElement('.error');
207
+ $I->dontSeeElement(//form/input[1]);
208
+ ?>
209
+
210
+ {% endhighlight %}
211
+ * param $selector
212
+
213
+
214
+ #### dontSeeInCurrentUrl
215
+
216
+
217
+ Checks that current uri does not contain a value
218
+
219
+ {% highlight php %}
220
+
221
+ <? php
222
+ $I-> dontSeeInCurrentUrl('/users/');
223
+ ?>
224
+
225
+ {% endhighlight %}
226
+
227
+ * param $uri
228
+
229
+
166
230
#### dontSeeInField
167
231
168
232
@@ -220,6 +284,26 @@ Fills a text field or textarea with value.
220
284
__not documented__
221
285
222
286
287
+ #### grabFromCurrentUrl
288
+
289
+
290
+ Takes a parameters from current URI by RegEx.
291
+ If no url provided returns full URI.
292
+
293
+ {% highlight php %}
294
+
295
+ <? php
296
+ $user_id = $I-> grabFromCurrentUrl('~$/user/(\d+)/~');
297
+ $uri = $I->grabFromCurrentUrl();
298
+ ?>
299
+
300
+ {% endhighlight %}
301
+
302
+ * param null $uri
303
+ * internal param $url
304
+ * return mixed
305
+
306
+
223
307
#### grabTextFrom
224
308
225
309
@@ -307,10 +391,64 @@ $I->seeCheckboxIsChecked('//form/input[@type=checkbox and * name=agree]');
307
391
* param $checkbox
308
392
309
393
394
+ #### seeCurrentUrlEquals
395
+
396
+
397
+ Checks that current url is equal to value.
398
+ Unlike `seeInCurrentUrl` performs a strict check.
399
+
400
+ <? php
401
+ // to match root url
402
+ $I-> seeCurrentUrlEquals('/');
403
+ ?>
404
+
405
+ * param $uri
406
+
407
+
408
+ #### seeCurrentUrlMatches
409
+
410
+
411
+ Checks that current url is matches a RegEx value
412
+
413
+ <? php
414
+ // to match root url
415
+ $I-> seeCurrentUrlMatches('~$/users/(\d+)~');
416
+ ?>
417
+
418
+ * param $uri
419
+
420
+
421
+ #### seeElement
422
+
423
+
424
+ Checks if element exists on a page, matching it by CSS or XPath
425
+
426
+ {% highlight php %}
427
+
428
+ <? php
429
+ $I-> seeElement('.error');
430
+ $I->seeElement(//form/input[1]);
431
+ ?>
432
+
433
+ {% endhighlight %}
434
+ * param $selector
435
+
436
+
310
437
#### seeInCurrentUrl
311
438
312
439
313
- Checks that current uri contains value
440
+ Checks that current uri contains a value
441
+
442
+ {% highlight php %}
443
+
444
+ <? php
445
+ // to match: /home/dashboard
446
+ $I-> seeInCurrentUrl('home');
447
+ // to match: /users/1
448
+ $I->seeInCurrentUrl('/users/');
449
+ ?>
450
+
451
+ {% endhighlight %}
314
452
315
453
* param $uri
316
454
@@ -360,6 +498,21 @@ $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
360
498
* param null $url
361
499
362
500
501
+ #### seePageNotFound
502
+
503
+
504
+ Asserts that current page has 404 response status code.
505
+
506
+
507
+ #### seeResponseCodeIs
508
+
509
+
510
+ Checks that response code is equal to value provided.
511
+
512
+ * param $code
513
+ * return mixed
514
+
515
+
363
516
#### selectOption
364
517
365
518
0 commit comments