Skip to content

Commit 4e35b3e

Browse files
authored
Merge pull request #26 from Codeception/TavoNiievez-features
TavoNiievez features
2 parents c1280aa + f7449fb commit 4e35b3e

File tree

2 files changed

+356
-4
lines changed

2 files changed

+356
-4
lines changed

documentation.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,21 @@ Authenticates user for HTTP_AUTH
220220
* `param` $password
221221

222222

223+
### amOnAction
224+
225+
Opens web page by action name
226+
227+
``` php
228+
<?php
229+
$I->amOnAction('PostController::index');
230+
$I->amOnAction('HomeController');
231+
$I->amOnAction('ArticleController', ['slug' => 'lorem-ipsum']);
232+
```
233+
234+
* `param string` $action
235+
* `param array` $params
236+
237+
223238
### amOnPage
224239

225240
Opens the page for the given relative URI.
@@ -361,6 +376,20 @@ For checking the raw source code, use `seeInSource()`.
361376
* `param array|string` $selector optional
362377

363378

379+
### dontSeeAuthentication
380+
381+
Check that user is not authenticated.
382+
You can specify whether users logged in with the 'remember me' option should be ignored by passing 'false' as a parameter.
383+
384+
```php
385+
<?php
386+
$I->dontSeeAuthentication();
387+
$I->dontSeeAuthentication(false);
388+
```
389+
390+
* `param bool` $remembered
391+
392+
364393
### dontSeeCheckboxIsChecked
365394

366395
Check that the specified checkbox is unchecked.
@@ -747,6 +776,15 @@ $I->haveHttpHeader('Client&#95;Id', 'Codeception');
747776
Invalidate previously cached routes.
748777
749778
779+
### logout
780+
781+
Invalidate the current session.
782+
```php
783+
<?php
784+
$I->logout();
785+
```
786+
787+
750788
### makeHtmlSnapshot
751789
752790
Saves current page's HTML into a temprary file.
@@ -866,6 +904,20 @@ For checking the raw source code, use `seeInSource()`.
866904
* `param array|string` $selector optional
867905

868906

907+
### seeAuthentication
908+
909+
Checks that a user is authenticated.
910+
You can check users logged in with the option 'remember me' passing true as parameter.
911+
912+
```php
913+
<?php
914+
$I->seeAuthentication();
915+
$I->seeAuthentication(true);
916+
```
917+
918+
* `param bool` $remembered
919+
920+
869921
### seeCheckboxIsChecked
870922

871923
Checks that the specified checkbox is checked.
@@ -896,6 +948,19 @@ $I->seeCookie('PHPSESSID');
896948
* `param array` $params
897949

898950

951+
### seeCurrentActionIs
952+
953+
Checks that current page matches action
954+
955+
``` php
956+
<?php
957+
$I->seeCurrentActionIs('PostController::index');
958+
$I->seeCurrentActionIs('HomeController');
959+
```
960+
961+
* `param string` $action
962+
963+
899964
### seeCurrentRouteIs
900965

901966
Checks that current url matches route.
@@ -1092,6 +1157,21 @@ $I->seeInFormFields('//form[@id=my-form]', $form);
10921157
* `param` $params
10931158

10941159

1160+
### seeInSession
1161+
1162+
Assert that a session attribute exists.
1163+
1164+
```php
1165+
<?php
1166+
$I->seeInSession('attrib');
1167+
$I->seeInSession('attrib', 'value');
1168+
```
1169+
1170+
* `param string` $attrib
1171+
* `param mixed|null` $value
1172+
* `return` void
1173+
1174+
10951175
### seeInSource
10961176

10971177
Checks that the current page contains the given string in its
@@ -1228,6 +1308,18 @@ Checks that the response code is 5xx
12281308
Checks that the response code 2xx
12291309

12301310

1311+
### seeUserHasRole
1312+
1313+
Check that the current user has a role
1314+
1315+
```php
1316+
<?php
1317+
$I->seeUserHasRole('ROLE_ADMIN');
1318+
```
1319+
1320+
* `param string` $role
1321+
1322+
12311323
### selectOption
12321324

12331325
Selects an option in a select tag or in radio button group.

0 commit comments

Comments
 (0)