Skip to content

Commit 731e540

Browse files
author
Davert
committed
Merge branch 'master' of github.com:Codeception/codeception.github.com
2 parents ec92c7f + e901a29 commit 731e540

10 files changed

+1318
-18
lines changed

codecept.phar

2.33 KB
Binary file not shown.

docs/modules/Kohana.markdown

Lines changed: 154 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ If link is an image it's found by alt attribute value of image.
103103
If button is image button is found by it's value
104104
If link or button can't be found by name they are searched by CSS selector.
105105

106+
The second parameter is a context: CSS or XPath locator to narrow the search.
107+
106108
Examples:
107109

108110
{% highlight php %}
@@ -116,10 +118,13 @@ $I->click('Submit');
116118
$I->click('#form input[type=submit]');
117119
// XPath
118120
$I->click('//form/*[@type=submit]')
121+
// link in context
122+
$I->click('Logout', '#nav');
119123
?>
120124

121125
{% endhighlight %}
122126
* param $link
127+
* param $context
123128

124129

125130
#### dontSee
@@ -163,6 +168,65 @@ $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user
163168
* param $checkbox
164169

165170

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+
166230
#### dontSeeInField
167231

168232

@@ -220,6 +284,26 @@ Fills a text field or textarea with value.
220284
__not documented__
221285

222286

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+
223307
#### grabTextFrom
224308

225309

@@ -307,10 +391,64 @@ $I->seeCheckboxIsChecked('//form/input[@type=checkbox and * name=agree]');
307391
* param $checkbox
308392

309393

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+
310437
#### seeInCurrentUrl
311438

312439

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 %}
314452

315453
* param $uri
316454

@@ -360,6 +498,21 @@ $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
360498
* param null $url
361499

362500

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+
363516
#### selectOption
364517

365518

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy