Absolutely Glamorous Custom Admin - Version 5.7.1

Version Description

  • Added General Options tests
Download this release

Release Info

Developer argonius
Plugin Icon 128x128 Absolutely Glamorous Custom Admin
Version 5.7.1
Comparing to
See all releases

Code changes from version 5.7 to 5.7.1

codeception.yml CHANGED
@@ -16,9 +16,10 @@ modules:
16
  enabled: [Filesystem, Asserts]
17
  config:
18
  WebDriver: #run: phantomjs --webdriver=4444
19
- url: 'http://wp47.
20
- dev/'
21
  browser: phantomjs
 
 
22
  capabilities:
23
  webStorageEnabled: true
24
  PhpBrowser:
16
  enabled: [Filesystem, Asserts]
17
  config:
18
  WebDriver: #run: phantomjs --webdriver=4444
19
+ url: 'http://wp47.dev/'
 
20
  browser: phantomjs
21
+ window_size: 1024x768
22
+ debug: true
23
  capabilities:
24
  webStorageEnabled: true
25
  PhpBrowser:
plugin.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: WAP
7
- Version: 5.7
8
  Text Domain: ag-custom-admin
9
  Domain Path: /languages
10
  Author URI: http://www.wordpressadminpanel.com/
@@ -73,7 +73,7 @@ class AGCA{
73
  /*Initialize properties*/
74
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
75
 
76
- $this->agca_version = "5.7";
77
 
78
  //TODO:upload images programmatically
79
  }
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: WAP
7
+ Version: 5.7.1
8
  Text Domain: ag-custom-admin
9
  Domain Path: /languages
10
  Author URI: http://www.wordpressadminpanel.com/
73
  /*Initialize properties*/
74
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
75
 
76
+ $this->agca_version = "5.7.1";
77
 
78
  //TODO:upload images programmatically
79
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
  Tested up to: 4.7
7
- Stable tag: 5.7
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
@@ -152,6 +152,9 @@ If you have the latest WordPress and plugin versions and you still experience so
152
 
153
  == Change Log ==
154
 
 
 
 
155
  = 5.7 =
156
  * Added Save button on top
157
  * Resolved blank page issue on first time install
@@ -520,6 +523,9 @@ If you have the latest WordPress and plugin versions and you still experience so
520
 
521
  == Upgrade Notice ==
522
 
 
 
 
523
  = 5.7 =
524
  * Bug fixes. Ready for WordPress 4.7.
525
 
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
  Tested up to: 4.7
7
+ Stable tag: 5.7.1
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
152
 
153
  == Change Log ==
154
 
155
+ = 5.7.1 =
156
+ * Added General Options tests
157
+
158
  = 5.7 =
159
  * Added Save button on top
160
  * Resolved blank page issue on first time install
523
 
524
  == Upgrade Notice ==
525
 
526
+ = 5.7.1 =
527
+ * Added tests.
528
+
529
  = 5.7 =
530
  * Bug fixes. Ready for WordPress 4.7.
531
 
tests/_bootstrap.php CHANGED
@@ -2,3 +2,7 @@
2
  define('AGCA_SITE_URL','http://wp47.dev');
3
  define('AGCA_SITE_USERNAME','admin');
4
  define('AGCA_SITE_PASSWORD','admin');
 
 
 
 
2
  define('AGCA_SITE_URL','http://wp47.dev');
3
  define('AGCA_SITE_USERNAME','admin');
4
  define('AGCA_SITE_PASSWORD','admin');
5
+ define('AGCA_SITE_SUBSCRIBER_USERNAME','subscriber');
6
+ define('AGCA_SITE_SUBSCRIBER_PASSWORD','subscriber');
7
+ define('AGCA_SITE_EDITOR_USERNAME','editor');
8
+ define('AGCA_SITE_EDITOR_PASSWORD','editor');
tests/_support/AcceptanceTester.php CHANGED
@@ -15,25 +15,95 @@
15
  * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16
  *
17
  * @SuppressWarnings(PHPMD)
18
- */
19
  class AcceptanceTester extends \Codeception\Actor
20
  {
21
  use _generated\AcceptanceTesterActions;
22
 
23
- public function login()
24
  {
25
  $I = $this;
26
  $I->amOnPage('/wp-login.php');
27
  $I->see('Username or Email Address');
 
28
  $I->submitForm('#loginform', [
29
- 'log' => AGCA_SITE_USERNAME,
30
- 'pwd' => AGCA_SITE_PASSWORD
31
  ]);
32
 
33
  //TODO: Make it work/
34
  //$I->saveSessionSnapshot('login');
35
  //$I->loadSessionSnapshot('login');
36
 
 
 
37
  $I->see('Dashboard');
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
15
  * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16
  *
17
  * @SuppressWarnings(PHPMD)
18
+ */
19
  class AcceptanceTester extends \Codeception\Actor
20
  {
21
  use _generated\AcceptanceTesterActions;
22
 
23
+ private function login($username = AGCA_SITE_USERNAME, $password = AGCA_SITE_PASSWORD)
24
  {
25
  $I = $this;
26
  $I->amOnPage('/wp-login.php');
27
  $I->see('Username or Email Address');
28
+
29
  $I->submitForm('#loginform', [
30
+ 'log' => $username,
31
+ 'pwd' => $password
32
  ]);
33
 
34
  //TODO: Make it work/
35
  //$I->saveSessionSnapshot('login');
36
  //$I->loadSessionSnapshot('login');
37
 
38
+ $I->wait(1);
39
+
40
  $I->see('Dashboard');
41
  }
42
+
43
+ public function loginAsAdmin()
44
+ {
45
+ $this->login();
46
+ return $this;
47
+ }
48
+
49
+ public function loginAsSubscriber()
50
+ {
51
+ $this->login(
52
+ AGCA_SITE_SUBSCRIBER_USERNAME,
53
+ AGCA_SITE_SUBSCRIBER_PASSWORD
54
+ );
55
+ return $this;
56
+ }
57
+
58
+ public function loginAsEditor()
59
+ {
60
+ $this->login(
61
+ AGCA_SITE_EDITOR_USERNAME,
62
+ AGCA_SITE_EDITOR_PASSWORD
63
+ );
64
+ return $this;
65
+ }
66
+
67
+ public function logOut(){
68
+ $logOutLink = $this->executeJS('return jQuery("#wp-admin-bar-logout a").attr("href");');
69
+ $this->amOnUrl($logOutLink);
70
+ return $this;
71
+ }
72
+
73
+ public function checkAgcaOption($name)
74
+ {
75
+ try {
76
+ if(!$this->isAgcaOptionChecked($name)){
77
+ $this->click("#agca_form input.agca-checkbox[name=$name]:not(:checked) + div");
78
+ }
79
+ } catch (Exception $e) {
80
+ }
81
+ }
82
+
83
+ public function isAgcaOptionChecked($name)
84
+ {
85
+ return (bool)$this->executeJS(
86
+ 'return jQuery("#agca_form input.agca-checkbox[name=' . $name . ']:checked").size()'
87
+ );
88
+ }
89
+
90
+ public function uncheckAgcaOption($name)
91
+ {
92
+ try {
93
+ if($this->isAgcaOptionChecked($name)){
94
+ $this->click("#agca_form input.agca-checkbox[name=$name]:checked + div");
95
+ }
96
+ } catch (Exception $e) {
97
+ }
98
+ }
99
+
100
+ public function getAGCAOptionLabel($name)
101
+ {
102
+ return $this->executeJS("return jQuery(\"label[for=$name]\").text();");
103
+ }
104
+
105
+ public function changeAgcaSelectOption($selector, $value)
106
+ {
107
+ $this->executeJS("jQuery(\"#agca_form $selector\").val('$value');");
108
+ }
109
  }
tests/_support/Page/AGCAPage.php CHANGED
@@ -7,6 +7,7 @@ class AGCAPage
7
  {
8
  // include url of current page
9
  public static $URL = '/wp-admin/tools.php?page=ag-custom-admin/plugin.php#general-settings';
 
10
 
11
  /**
12
  * @var AcceptanceTester
@@ -38,22 +39,86 @@ class AGCAPage
38
  */
39
  public function seeMenu($text){
40
  $this->I->see($text, '#ag_main_menu li.normal a');
 
41
  }
42
 
43
  public function selectedMenu($text){
44
  $this->I->see($text, '#ag_main_menu li.selected a');
 
45
  }
46
 
47
- public function amOnGeneralPage(){
48
  $this->I->amOnPage($this::$URL);
49
- $this->I->see('General Settings');
 
50
  }
51
 
52
  public function seeArea($text){
53
  $this->I->see($text, '#agca_form .ag_table_heading h3');
 
54
  }
55
 
56
  public function saveSettings(){
57
  $this->I->submitForm('#agca_form', []);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
  }
7
  {
8
  // include url of current page
9
  public static $URL = '/wp-admin/tools.php?page=ag-custom-admin/plugin.php#general-settings';
10
+ public static $PAGE_TITLE = 'General Settings';
11
 
12
  /**
13
  * @var AcceptanceTester
39
  */
40
  public function seeMenu($text){
41
  $this->I->see($text, '#ag_main_menu li.normal a');
42
+ return $this;
43
  }
44
 
45
  public function selectedMenu($text){
46
  $this->I->see($text, '#ag_main_menu li.selected a');
47
+ return $this;
48
  }
49
 
50
+ public function visit(){
51
  $this->I->amOnPage($this::$URL);
52
+ $this->I->see($this::$PAGE_TITLE);
53
+ return $this;
54
  }
55
 
56
  public function seeArea($text){
57
  $this->I->see($text, '#agca_form .ag_table_heading h3');
58
+ return $this;
59
  }
60
 
61
  public function saveSettings(){
62
  $this->I->submitForm('#agca_form', []);
63
+ return $this;
64
+ }
65
+
66
+ public function agcaOptionChecked($name){
67
+ return $this->I->executeJS("return jQuery('[name=$name]:checked').size()");
68
+ }
69
+
70
+ public function getAgcaSelectedOption($selector){
71
+ return $this->I->executeJS("return jQuery(\"#agca_form $selector\").val();");
72
+ }
73
+
74
+ /**
75
+ * Prepares options before testing and persists them in database
76
+ * @param array $options
77
+ */
78
+ public function prepareAgcaOptions($options = []){
79
+ $I = $this->I;
80
+
81
+ foreach($options as $key=>$option){
82
+ if(is_array($option)){ //selectbox or something else
83
+ switch($option['type']){
84
+ case 'select':
85
+ $I->changeAgcaSelectOption($key, $option['value']);
86
+ default:;
87
+ }
88
+ }else if(is_bool($option)){ //checkbox
89
+ if($option){
90
+ $I->checkAgcaOption($key);
91
+ }else{
92
+ $I->uncheckAgcaOption($key);
93
+ }
94
+ }else{ //text
95
+ //TODO: Implement text options
96
+ }
97
+ }
98
+
99
+ $this->saveSettings()->visit();
100
+
101
+ //Check if options are persisted correctly
102
+ foreach($options as $key=>$option){
103
+ if(is_array($option)){ //select or something else
104
+ switch($option['type']){
105
+ case 'select':
106
+ $I->assertEquals(
107
+ $option['value'],
108
+ $this->getAgcaSelectedOption($key)
109
+ );
110
+ default:;
111
+ }
112
+ }else if(is_bool($option)){ //checkbox
113
+ $isOptionChecked = $I->isAgcaOptionChecked($key);
114
+ if($option){
115
+ $I->assertTrue($isOptionChecked);
116
+ }else{
117
+ $I->assertFalse($isOptionChecked);
118
+ }
119
+ }else{ //text
120
+ //TODO: Implement text options
121
+ }
122
+ }
123
  }
124
  }
tests/_support/Page/GeneralPage.php CHANGED
@@ -3,7 +3,18 @@ namespace Page;
3
 
4
  class GeneralPage extends AGCAPage
5
  {
6
- public static $capabilityField = '#agca_form select#agca_admin_capability';
 
 
 
 
 
 
7
  public static $capabilityLabel = 'AGCA admin capability:';
8
- public static $capabilitySelected = '#agca_form #agca_admin_capability [selected]';
 
 
 
 
 
9
  }
3
 
4
  class GeneralPage extends AGCAPage
5
  {
6
+ public static $helpMenuOption = 'agca_help_menu';
7
+ public static $helpMenuOptionLabel = '"Help" menu';
8
+
9
+ public static $screenOption = 'agca_screen_options_menu';
10
+ public static $screenOptionLabel = '"Screen Options" menu';
11
+
12
+ public static $capabilityField = 'select#agca_admin_capability';
13
  public static $capabilityLabel = 'AGCA admin capability:';
14
+ public static $capabilityEditDashboard = 'edit_dashboard';
15
+ public static $capabilityCreateUsers = 'create_users';
16
+ public static $capabilityEditPosts = 'edit_posts';
17
+
18
+ public static $excludeAdministratorOption = 'agca_role_allbutadmin';
19
+ public static $excludeAdministratorOptionLabel = 'Exclude AGCA admin from customizations';
20
  }
tests/_support/Page/WPDashboardPage.php CHANGED
@@ -33,14 +33,21 @@ class WPDashboardPage
33
  return static::$URL.$param;
34
  }
35
 
36
- public function amOnDashboardPage(){
37
  $this->I->amOnPage($this::$URL);
38
  $this->I->see('Dashboard', 'body h1:nth-child(1)');
 
39
  }
40
 
41
  public function canSeeScreenOptions($shouldSee = true){
42
- $text = 'Screen Options';
43
- $selector = '#show-settings-link';
 
 
 
 
 
 
44
  if($shouldSee){
45
  $this->I->canSee($text, $selector);
46
  }else{
33
  return static::$URL.$param;
34
  }
35
 
36
+ public function visit(){
37
  $this->I->amOnPage($this::$URL);
38
  $this->I->see('Dashboard', 'body h1:nth-child(1)');
39
+ return $this;
40
  }
41
 
42
  public function canSeeScreenOptions($shouldSee = true){
43
+ $this->canSeeTopRightDropdown('Screen Options', '#show-settings-link', $shouldSee);
44
+ }
45
+
46
+ public function canSeeHelpOptions($shouldSee = true){
47
+ $this->canSeeTopRightDropdown('Help', '#contextual-help-link', $shouldSee);
48
+ }
49
+
50
+ private function canSeeTopRightDropdown($text, $selector, $shouldSee = true){
51
  if($shouldSee){
52
  $this->I->canSee($text, $selector);
53
  }else{
tests/_support/_generated/AcceptanceTesterActions.php CHANGED
@@ -1,15 +1,14 @@
1
- <?php //[STAMP] b98a92315b61d8d3c1b09b583ff094b7
2
  namespace _generated;
3
 
4
  // This class was automatically generated by build task
5
  // You should not change it manually as it will be overwritten on next build
6
  // @codingStandardsIgnoreFile
7
 
8
- use Codeception\Module\PhpBrowser;
9
- use Codeception\Module\Db;
10
- use Helper\Acceptance;
11
  use Codeception\Module\Filesystem;
12
  use Codeception\Module\Asserts;
 
13
 
14
  trait AcceptanceTesterActions
15
  {
@@ -22,210 +21,253 @@ trait AcceptanceTesterActions
22
  /**
23
  * [!] Method is generated. Documentation taken from corresponding module.
24
  *
25
- * Alias to `haveHttpHeader`
26
- *
27
- * @param $name
28
- * @param $value
29
- * @see \Codeception\Module\PhpBrowser::setHeader()
30
  */
31
- public function setHeader($name, $value) {
32
- return $this->getScenario()->runStep(new \Codeception\Step\Action('setHeader', func_get_args()));
33
  }
34
 
35
 
36
  /**
37
  * [!] Method is generated. Documentation taken from corresponding module.
38
  *
39
- * Authenticates user for HTTP_AUTH
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  *
41
- * @param $username
42
- * @param $password
43
- * @see \Codeception\Module\PhpBrowser::amHttpAuthenticated()
44
  */
45
- public function amHttpAuthenticated($username, $password) {
46
- return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args()));
47
  }
48
 
49
 
50
  /**
51
  * [!] Method is generated. Documentation taken from corresponding module.
52
  *
53
- * Open web page at the given absolute URL and sets its hostname as the base host.
54
  *
55
  * ``` php
56
  * <?php
57
- * $I->amOnUrl('http://codeception.com');
58
- * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
 
59
  * ?>
60
  * ```
61
- * @see \Codeception\Module\PhpBrowser::amOnUrl()
 
 
62
  */
63
- public function amOnUrl($url) {
64
- return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args()));
65
  }
66
 
67
 
68
  /**
69
  * [!] Method is generated. Documentation taken from corresponding module.
70
  *
71
- * Changes the subdomain for the 'url' configuration parameter.
72
- * Does not open a page; use `amOnPage` for that.
73
  *
74
  * ``` php
75
  * <?php
76
- * // If config is: 'http://mysite.com'
77
- * // or config is: 'http://www.mysite.com'
78
- * // or config is: 'http://company.mysite.com'
79
  *
80
- * $I->amOnSubdomain('user');
81
- * $I->amOnPage('/');
82
- * // moves to http://user.mysite.com/
83
- * ?>
84
  * ```
85
  *
86
- * @param $subdomain
87
- *
88
- * @return mixed
89
- * @see \Codeception\Module\PhpBrowser::amOnSubdomain()
90
  */
91
- public function amOnSubdomain($subdomain) {
92
- return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
93
  }
94
 
95
 
96
  /**
97
  * [!] Method is generated. Documentation taken from corresponding module.
98
  *
99
- * Low-level API method.
100
- * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly
101
- *
102
- * Example:
103
  *
104
  * ``` php
105
  * <?php
106
- * $I->executeInGuzzle(function (\GuzzleHttp\Client $client) {
107
- * $client->get('/get', ['query' => ['foo' => 'bar']]);
108
- * });
109
  * ?>
110
  * ```
111
  *
112
- * It is not recommended to use this command on a regular basis.
113
- * If Codeception lacks important Guzzle Client methods, implement them and submit patches.
114
- *
115
- * @param callable $function
116
- * @see \Codeception\Module\PhpBrowser::executeInGuzzle()
117
  */
118
- public function executeInGuzzle($function) {
119
- return $this->getScenario()->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args()));
120
  }
121
-
122
-
123
  /**
124
  * [!] Method is generated. Documentation taken from corresponding module.
125
  *
126
- * Sets the HTTP header to the passed value - which is used on
127
- * subsequent HTTP requests through PhpBrowser.
128
  *
129
- * Example:
130
- * ```php
131
  * <?php
132
- * $I->setHeader('X-Requested-With', 'Codeception');
133
- * $I->amOnPage('test-headers.php');
134
  * ?>
135
  * ```
136
  *
137
- * @param string $name the name of the request header
138
- * @param string $value the value to set it to for subsequent
139
- * requests
140
- * @see \Codeception\Lib\InnerBrowser::haveHttpHeader()
141
  */
142
- public function haveHttpHeader($name, $value) {
143
- return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args()));
144
  }
145
 
146
 
147
  /**
148
  * [!] Method is generated. Documentation taken from corresponding module.
149
  *
150
- * Deletes the header with the passed name. Subsequent requests
151
- * will not have the deleted header in its request.
152
  *
153
- * Example:
154
- * ```php
155
- * <?php
156
- * $I->haveHttpHeader('X-Requested-With', 'Codeception');
157
- * $I->amOnPage('test-headers.php');
158
- * // ...
159
- * $I->deleteHeader('X-Requested-With');
160
- * $I->amOnPage('some-other-page.php');
161
- * ?>
162
- * ```
 
 
 
 
 
 
 
163
  *
164
- * @param string $name the name of the header to delete.
165
- * @see \Codeception\Lib\InnerBrowser::deleteHeader()
 
166
  */
167
- public function deleteHeader($name) {
168
- return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args()));
169
  }
170
 
171
 
172
  /**
173
  * [!] Method is generated. Documentation taken from corresponding module.
174
  *
175
- * Opens the page for the given relative URI.
 
176
  *
177
  * ``` php
178
  * <?php
179
- * // opens front page
180
- * $I->amOnPage('/');
181
- * // opens /register page
182
- * $I->amOnPage('/register');
183
  * ```
184
  *
185
- * @param $page
186
- * @see \Codeception\Lib\InnerBrowser::amOnPage()
 
 
 
 
187
  */
188
- public function amOnPage($page) {
189
- return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
190
  }
191
 
192
 
193
  /**
194
  * [!] Method is generated. Documentation taken from corresponding module.
195
  *
196
- * Perform a click on a link or a button, given by a locator.
197
- * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
198
- * For buttons, the "value" attribute, "name" attribute, and inner text are searched.
199
- * For links, the link text is searched.
200
- * For images, the "alt" attribute and inner text of any parent links are searched.
201
  *
202
- * The second parameter is a context (CSS or XPath locator) to narrow the search.
203
  *
204
- * Note that if the locator matches a button of type `submit`, the form will be submitted.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  *
206
  * ``` php
207
  * <?php
208
- * // simple link
209
- * $I->click('Logout');
210
- * // button of form
211
- * $I->click('Submit');
212
- * // CSS button
213
- * $I->click('#form input[type=submit]');
214
- * // XPath
215
- * $I->click('//form/*[@type=submit]');
216
- * // link in context
217
- * $I->click('Logout', '#nav');
218
- * // using strict locator
219
- * $I->click(['link' => 'Login']);
220
  * ?>
221
  * ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  *
223
- * @param $link
224
- * @param $context
225
- * @see \Codeception\Lib\InnerBrowser::click()
226
  */
227
- public function click($link, $context = null) {
228
- return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args()));
229
  }
230
 
231
 
@@ -261,7 +303,7 @@ trait AcceptanceTesterActions
261
  * @param $text
262
  * @param null $selector
263
  * Conditional Assertion: Test won't be stopped on fail
264
- * @see \Codeception\Lib\InnerBrowser::see()
265
  */
266
  public function canSee($text, $selector = null) {
267
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
@@ -297,7 +339,7 @@ trait AcceptanceTesterActions
297
  *
298
  * @param $text
299
  * @param null $selector
300
- * @see \Codeception\Lib\InnerBrowser::see()
301
  */
302
  public function see($text, $selector = null) {
303
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
@@ -334,7 +376,7 @@ trait AcceptanceTesterActions
334
  * @param $text
335
  * @param null $selector
336
  * Conditional Assertion: Test won't be stopped on fail
337
- * @see \Codeception\Lib\InnerBrowser::dontSee()
338
  */
339
  public function cantSee($text, $selector = null) {
340
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
@@ -368,7 +410,7 @@ trait AcceptanceTesterActions
368
  *
369
  * @param $text
370
  * @param null $selector
371
- * @see \Codeception\Lib\InnerBrowser::dontSee()
372
  */
373
  public function dontSee($text, $selector = null) {
374
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
@@ -388,7 +430,7 @@ trait AcceptanceTesterActions
388
  *
389
  * @param $raw
390
  * Conditional Assertion: Test won't be stopped on fail
391
- * @see \Codeception\Lib\InnerBrowser::seeInSource()
392
  */
393
  public function canSeeInSource($raw) {
394
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args()));
@@ -405,7 +447,7 @@ trait AcceptanceTesterActions
405
  * ```
406
  *
407
  * @param $raw
408
- * @see \Codeception\Lib\InnerBrowser::seeInSource()
409
  */
410
  public function seeInSource($raw) {
411
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args()));
@@ -425,7 +467,7 @@ trait AcceptanceTesterActions
425
  *
426
  * @param $raw
427
  * Conditional Assertion: Test won't be stopped on fail
428
- * @see \Codeception\Lib\InnerBrowser::dontSeeInSource()
429
  */
430
  public function cantSeeInSource($raw) {
431
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args()));
@@ -442,7 +484,7 @@ trait AcceptanceTesterActions
442
  * ```
443
  *
444
  * @param $raw
445
- * @see \Codeception\Lib\InnerBrowser::dontSeeInSource()
446
  */
447
  public function dontSeeInSource($raw) {
448
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args()));
@@ -452,106 +494,205 @@ trait AcceptanceTesterActions
452
  /**
453
  * [!] Method is generated. Documentation taken from corresponding module.
454
  *
455
- * Checks that there's a link with the specified text.
456
- * Give a full URL as the second parameter to match links with that exact URL.
457
  *
458
- * ``` php
459
  * <?php
460
- * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
461
- * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
462
- * ?>
463
  * ```
464
  *
465
- * @param $text
466
- * @param null $url
467
  * Conditional Assertion: Test won't be stopped on fail
468
- * @see \Codeception\Lib\InnerBrowser::seeLink()
469
  */
470
- public function canSeeLink($text, $url = null) {
471
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
472
  }
473
  /**
474
  * [!] Method is generated. Documentation taken from corresponding module.
475
  *
476
- * Checks that there's a link with the specified text.
477
- * Give a full URL as the second parameter to match links with that exact URL.
478
  *
479
- * ``` php
480
  * <?php
481
- * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
482
- * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
483
- * ?>
484
  * ```
485
  *
486
- * @param $text
487
- * @param null $url
488
- * @see \Codeception\Lib\InnerBrowser::seeLink()
489
  */
490
- public function seeLink($text, $url = null) {
491
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
492
  }
493
 
494
 
495
  /**
496
  * [!] Method is generated. Documentation taken from corresponding module.
497
  *
498
- * Checks that the page doesn't contain a link with the given string.
499
- * If the second parameter is given, only links with a matching "href" attribute will be checked.
500
- *
501
- * ``` php
502
- * <?php
503
- * $I->dontSeeLink('Logout'); // I suppose user is not logged in
504
- * $I->dontSeeLink('Checkout now', '/store/cart.php');
505
- * ?>
506
- * ```
507
  *
508
  * @param $text
509
- * @param null $url
510
  * Conditional Assertion: Test won't be stopped on fail
511
- * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
512
  */
513
- public function cantSeeLink($text, $url = null) {
514
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
515
  }
516
  /**
517
  * [!] Method is generated. Documentation taken from corresponding module.
518
  *
519
- * Checks that the page doesn't contain a link with the given string.
520
- * If the second parameter is given, only links with a matching "href" attribute will be checked.
521
- *
522
- * ``` php
523
- * <?php
524
- * $I->dontSeeLink('Logout'); // I suppose user is not logged in
525
- * $I->dontSeeLink('Checkout now', '/store/cart.php');
526
- * ?>
527
- * ```
528
  *
529
  * @param $text
530
- * @param null $url
531
- * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
532
  */
533
- public function dontSeeLink($text, $url = null) {
534
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
535
  }
536
 
537
 
538
  /**
539
  * [!] Method is generated. Documentation taken from corresponding module.
540
  *
541
- * Checks that current URI contains the given string.
 
 
 
 
 
 
 
 
542
  *
543
  * ``` php
544
  * <?php
545
- * // to match: /home/dashboard
546
- * $I->seeInCurrentUrl('home');
547
- * // to match: /users/1
548
- * $I->seeInCurrentUrl('/users/');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  * ?>
550
  * ```
551
  *
552
  * @param $uri
553
  * Conditional Assertion: Test won't be stopped on fail
554
- * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
555
  */
556
  public function canSeeInCurrentUrl($uri) {
557
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
@@ -571,7 +712,7 @@ trait AcceptanceTesterActions
571
  * ```
572
  *
573
  * @param $uri
574
- * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
575
  */
576
  public function seeInCurrentUrl($uri) {
577
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
@@ -581,158 +722,158 @@ trait AcceptanceTesterActions
581
  /**
582
  * [!] Method is generated. Documentation taken from corresponding module.
583
  *
584
- * Checks that the current URI doesn't contain the given string.
 
585
  *
586
  * ``` php
587
  * <?php
588
- * $I->dontSeeInCurrentUrl('/users/');
 
589
  * ?>
590
  * ```
591
  *
592
  * @param $uri
593
  * Conditional Assertion: Test won't be stopped on fail
594
- * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
595
  */
596
- public function cantSeeInCurrentUrl($uri) {
597
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
598
  }
599
  /**
600
  * [!] Method is generated. Documentation taken from corresponding module.
601
  *
602
- * Checks that the current URI doesn't contain the given string.
 
603
  *
604
  * ``` php
605
  * <?php
606
- * $I->dontSeeInCurrentUrl('/users/');
 
607
  * ?>
608
  * ```
609
  *
610
  * @param $uri
611
- * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
612
  */
613
- public function dontSeeInCurrentUrl($uri) {
614
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
615
  }
616
 
617
 
618
  /**
619
  * [!] Method is generated. Documentation taken from corresponding module.
620
  *
621
- * Checks that the current URL is equal to the given string.
622
- * Unlike `seeInCurrentUrl`, this only matches the full URL.
623
  *
624
  * ``` php
625
  * <?php
626
  * // to match root url
627
- * $I->seeCurrentUrlEquals('/');
628
  * ?>
629
  * ```
630
  *
631
  * @param $uri
632
  * Conditional Assertion: Test won't be stopped on fail
633
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
634
  */
635
- public function canSeeCurrentUrlEquals($uri) {
636
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
637
  }
638
  /**
639
  * [!] Method is generated. Documentation taken from corresponding module.
640
  *
641
- * Checks that the current URL is equal to the given string.
642
- * Unlike `seeInCurrentUrl`, this only matches the full URL.
643
  *
644
  * ``` php
645
  * <?php
646
  * // to match root url
647
- * $I->seeCurrentUrlEquals('/');
648
  * ?>
649
  * ```
650
  *
651
  * @param $uri
652
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
653
  */
654
- public function seeCurrentUrlEquals($uri) {
655
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
656
  }
657
 
658
 
659
  /**
660
  * [!] Method is generated. Documentation taken from corresponding module.
661
  *
662
- * Checks that the current URL doesn't equal the given string.
663
- * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
664
  *
665
  * ``` php
666
  * <?php
667
- * // current url is not root
668
- * $I->dontSeeCurrentUrlEquals('/');
669
  * ?>
670
  * ```
671
  *
672
  * @param $uri
673
  * Conditional Assertion: Test won't be stopped on fail
674
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
675
  */
676
- public function cantSeeCurrentUrlEquals($uri) {
677
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
678
  }
679
  /**
680
  * [!] Method is generated. Documentation taken from corresponding module.
681
  *
682
- * Checks that the current URL doesn't equal the given string.
683
- * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
684
  *
685
  * ``` php
686
  * <?php
687
- * // current url is not root
688
- * $I->dontSeeCurrentUrlEquals('/');
689
  * ?>
690
  * ```
691
  *
692
  * @param $uri
693
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
694
  */
695
- public function dontSeeCurrentUrlEquals($uri) {
696
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
697
  }
698
 
699
 
700
  /**
701
  * [!] Method is generated. Documentation taken from corresponding module.
702
  *
703
- * Checks that the current URL matches the given regular expression.
 
704
  *
705
  * ``` php
706
  * <?php
707
- * // to match root url
708
- * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
709
  * ?>
710
  * ```
711
  *
712
  * @param $uri
713
  * Conditional Assertion: Test won't be stopped on fail
714
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
715
  */
716
- public function canSeeCurrentUrlMatches($uri) {
717
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
718
  }
719
  /**
720
  * [!] Method is generated. Documentation taken from corresponding module.
721
  *
722
- * Checks that the current URL matches the given regular expression.
 
723
  *
724
  * ``` php
725
  * <?php
726
- * // to match root url
727
- * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
728
  * ?>
729
  * ```
730
  *
731
  * @param $uri
732
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
733
  */
734
- public function seeCurrentUrlMatches($uri) {
735
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
736
  }
737
 
738
 
@@ -750,7 +891,7 @@ trait AcceptanceTesterActions
750
  *
751
  * @param $uri
752
  * Conditional Assertion: Test won't be stopped on fail
753
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
754
  */
755
  public function cantSeeCurrentUrlMatches($uri) {
756
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
@@ -768,7 +909,7 @@ trait AcceptanceTesterActions
768
  * ```
769
  *
770
  * @param $uri
771
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
772
  */
773
  public function dontSeeCurrentUrlMatches($uri) {
774
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
@@ -791,7 +932,7 @@ trait AcceptanceTesterActions
791
  * @param null $uri
792
  *
793
  * @return mixed
794
- * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
795
  */
796
  public function grabFromCurrentUrl($uri = null) {
797
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
@@ -813,7 +954,7 @@ trait AcceptanceTesterActions
813
  *
814
  * @param $checkbox
815
  * Conditional Assertion: Test won't be stopped on fail
816
- * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
817
  */
818
  public function canSeeCheckboxIsChecked($checkbox) {
819
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
@@ -832,7 +973,7 @@ trait AcceptanceTesterActions
832
  * ```
833
  *
834
  * @param $checkbox
835
- * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
836
  */
837
  public function seeCheckboxIsChecked($checkbox) {
838
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
@@ -853,7 +994,7 @@ trait AcceptanceTesterActions
853
  *
854
  * @param $checkbox
855
  * Conditional Assertion: Test won't be stopped on fail
856
- * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
857
  */
858
  public function cantSeeCheckboxIsChecked($checkbox) {
859
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
@@ -871,7 +1012,7 @@ trait AcceptanceTesterActions
871
  * ```
872
  *
873
  * @param $checkbox
874
- * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
875
  */
876
  public function dontSeeCheckboxIsChecked($checkbox) {
877
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
@@ -898,7 +1039,7 @@ trait AcceptanceTesterActions
898
  * @param $field
899
  * @param $value
900
  * Conditional Assertion: Test won't be stopped on fail
901
- * @see \Codeception\Lib\InnerBrowser::seeInField()
902
  */
903
  public function canSeeInField($field, $value) {
904
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
@@ -922,7 +1063,7 @@ trait AcceptanceTesterActions
922
  *
923
  * @param $field
924
  * @param $value
925
- * @see \Codeception\Lib\InnerBrowser::seeInField()
926
  */
927
  public function seeInField($field, $value) {
928
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
@@ -949,7 +1090,7 @@ trait AcceptanceTesterActions
949
  * @param $field
950
  * @param $value
951
  * Conditional Assertion: Test won't be stopped on fail
952
- * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
953
  */
954
  public function cantSeeInField($field, $value) {
955
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
@@ -973,7 +1114,7 @@ trait AcceptanceTesterActions
973
  *
974
  * @param $field
975
  * @param $value
976
- * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
977
  */
978
  public function dontSeeInField($field, $value) {
979
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
@@ -1043,7 +1184,7 @@ trait AcceptanceTesterActions
1043
  * @param $formSelector
1044
  * @param $params
1045
  * Conditional Assertion: Test won't be stopped on fail
1046
- * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
1047
  */
1048
  public function canSeeInFormFields($formSelector, $params) {
1049
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
@@ -1110,7 +1251,7 @@ trait AcceptanceTesterActions
1110
  *
1111
  * @param $formSelector
1112
  * @param $params
1113
- * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
1114
  */
1115
  public function seeInFormFields($formSelector, $params) {
1116
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
@@ -1160,7 +1301,7 @@ trait AcceptanceTesterActions
1160
  * @param $formSelector
1161
  * @param $params
1162
  * Conditional Assertion: Test won't be stopped on fail
1163
- * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
1164
  */
1165
  public function cantSeeInFormFields($formSelector, $params) {
1166
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
@@ -1207,7 +1348,7 @@ trait AcceptanceTesterActions
1207
  *
1208
  * @param $formSelector
1209
  * @param $params
1210
- * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
1211
  */
1212
  public function dontSeeInFormFields($formSelector, $params) {
1213
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args()));
@@ -1217,239 +1358,50 @@ trait AcceptanceTesterActions
1217
  /**
1218
  * [!] Method is generated. Documentation taken from corresponding module.
1219
  *
1220
- * Submits the given form on the page, optionally with the given form
1221
- * values. Pass the form field's values as an array in the second
1222
- * parameter.
1223
- *
1224
- * Although this function can be used as a short-hand version of
1225
- * `fillField()`, `selectOption()`, `click()` etc. it has some important
1226
- * differences:
1227
- *
1228
- * * Only field *names* may be used, not CSS/XPath selectors nor field labels
1229
- * * If a field is sent to this function that does *not* exist on the page,
1230
- * it will silently be added to the HTTP request. This is helpful for testing
1231
- * some types of forms, but be aware that you will *not* get an exception
1232
- * like you would if you called `fillField()` or `selectOption()` with
1233
- * a missing field.
1234
- *
1235
- * Fields that are not provided will be filled by their values from the page,
1236
- * or from any previous calls to `fillField()`, `selectOption()` etc.
1237
- * You don't need to click the 'Submit' button afterwards.
1238
- * This command itself triggers the request to form's action.
1239
- *
1240
- * You can optionally specify which button's value to include
1241
- * in the request with the last parameter (as an alternative to
1242
- * explicitly setting its value in the second parameter), as
1243
- * button values are not otherwise included in the request.
1244
- *
1245
- * Examples:
1246
  *
1247
  * ``` php
1248
  * <?php
1249
- * $I->submitForm('#login', [
1250
- * 'login' => 'davert',
1251
- * 'password' => '123456'
1252
- * ]);
1253
- * // or
1254
- * $I->submitForm('#login', [
1255
- * 'login' => 'davert',
1256
- * 'password' => '123456'
1257
- * ], 'submitButtonName');
1258
- *
1259
- * ```
1260
- *
1261
- * For example, given this sample "Sign Up" form:
1262
- *
1263
- * ``` html
1264
- * <form action="/sign_up">
1265
- * Login:
1266
- * <input type="text" name="user[login]" /><br/>
1267
- * Password:
1268
- * <input type="password" name="user[password]" /><br/>
1269
- * Do you agree to our terms?
1270
- * <input type="checkbox" name="user[agree]" /><br/>
1271
- * Select pricing plan:
1272
- * <select name="plan">
1273
- * <option value="1">Free</option>
1274
- * <option value="2" selected="selected">Paid</option>
1275
- * </select>
1276
- * <input type="submit" name="submitButton" value="Submit" />
1277
- * </form>
1278
  * ```
1279
  *
1280
- * You could write the following to submit it:
1281
  *
1282
  * ``` php
1283
  * <?php
1284
- * $I->submitForm(
1285
- * '#userForm',
1286
- * [
1287
- * 'user' => [
1288
- * 'login' => 'Davert',
1289
- * 'password' => '123456',
1290
- * 'agree' => true
1291
- * ]
1292
- * ],
1293
- * 'submitButton'
1294
- * );
1295
  * ```
1296
- * Note that "2" will be the submitted value for the "plan" field, as it is
1297
- * the selected option.
1298
  *
1299
- * You can also emulate a JavaScript submission by not specifying any
1300
- * buttons in the third parameter to submitForm.
1301
  *
1302
- * ```php
1303
  * <?php
1304
- * $I->submitForm(
1305
- * '#userForm',
1306
- * [
1307
- * 'user' => [
1308
- * 'login' => 'Davert',
1309
- * 'password' => '123456',
1310
- * 'agree' => true
1311
- * ]
1312
- * ]
1313
- * );
1314
- * ```
1315
- *
1316
- * This function works well when paired with `seeInFormFields()`
1317
- * for quickly testing CRUD interfaces and form validation logic.
1318
- *
1319
- * ``` php
1320
- * <?php
1321
- * $form = [
1322
- * 'field1' => 'value',
1323
- * 'field2' => 'another value',
1324
- * 'checkbox1' => true,
1325
- * // ...
1326
- * ];
1327
- * $I->submitForm('#my-form', $form, 'submitButton');
1328
- * // $I->amOnPage('/path/to/form-page') may be needed
1329
- * $I->seeInFormFields('#my-form', $form);
1330
- * ```
1331
- *
1332
- * Parameter values can be set to arrays for multiple input fields
1333
- * of the same name, or multi-select combo boxes. For checkboxes,
1334
- * you can use either the string value or boolean `true`/`false` which will
1335
- * be replaced by the checkbox's value in the DOM.
1336
- *
1337
- * ``` php
1338
- * <?php
1339
- * $I->submitForm('#my-form', [
1340
- * 'field1' => 'value',
1341
- * 'checkbox' => [
1342
- * 'value of first checkbox',
1343
- * 'value of second checkbox',
1344
- * ],
1345
- * 'otherCheckboxes' => [
1346
- * true,
1347
- * false,
1348
- * false
1349
- * ],
1350
- * 'multiselect' => [
1351
- * 'first option value',
1352
- * 'second option value'
1353
- * ]
1354
- * ]);
1355
- * ```
1356
- *
1357
- * Mixing string and boolean values for a checkbox's value is not supported
1358
- * and may produce unexpected results.
1359
- *
1360
- * Field names ending in `[]` must be passed without the trailing square
1361
- * bracket characters, and must contain an array for its value. This allows
1362
- * submitting multiple values with the same name, consider:
1363
- *
1364
- * ```php
1365
- * <?php
1366
- * // This will NOT work correctly
1367
- * $I->submitForm('#my-form', [
1368
- * 'field[]' => 'value',
1369
- * 'field[]' => 'another value', // 'field[]' is already a defined key
1370
- * ]);
1371
- * ```
1372
- *
1373
- * The solution is to pass an array value:
1374
- *
1375
- * ```php
1376
- * <?php
1377
- * // This way both values are submitted
1378
- * $I->submitForm('#my-form', [
1379
- * 'field' => [
1380
- * 'value',
1381
- * 'another value',
1382
- * ]
1383
- * ]);
1384
- * ```
1385
- *
1386
- * @param $selector
1387
- * @param $params
1388
- * @param $button
1389
- * @see \Codeception\Lib\InnerBrowser::submitForm()
1390
- */
1391
- public function submitForm($selector, $params, $button = null) {
1392
- return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
1393
- }
1394
-
1395
-
1396
- /**
1397
- * [!] Method is generated. Documentation taken from corresponding module.
1398
- *
1399
- * Fills a text field or textarea with the given string.
1400
- *
1401
- * ``` php
1402
- * <?php
1403
- * $I->fillField("//input[@type='text']", "Hello World!");
1404
- * $I->fillField(['name' => 'email'], 'jon@mail.com');
1405
  * ?>
1406
- * ```
1407
  *
1408
- * @param $field
1409
- * @param $value
1410
- * @see \Codeception\Lib\InnerBrowser::fillField()
1411
  */
1412
- public function fillField($field, $value) {
1413
- return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
1414
  }
1415
 
1416
 
1417
  /**
1418
  * [!] Method is generated. Documentation taken from corresponding module.
1419
  *
1420
- * Selects an option in a select tag or in radio button group.
1421
- *
1422
- * ``` php
1423
- * <?php
1424
- * $I->selectOption('form select[name=account]', 'Premium');
1425
- * $I->selectOption('form input[name=payment]', 'Monthly');
1426
- * $I->selectOption('//form/select[@name=account]', 'Monthly');
1427
- * ?>
1428
- * ```
1429
- *
1430
- * Provide an array for the second argument to select multiple options:
1431
- *
1432
- * ``` php
1433
- * <?php
1434
- * $I->selectOption('Which OS do you use?', array('Windows','Linux'));
1435
- * ?>
1436
- * ```
1437
- *
1438
- * Or provide an associative array for the second argument to specifically define which selection method should be used:
1439
- *
1440
- * ``` php
1441
- * <?php
1442
- * $I->selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows'
1443
- * $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows'
1444
- * ?>
1445
- + ```
1446
  *
1447
- * @param $select
1448
- * @param $option
1449
- * @see \Codeception\Lib\InnerBrowser::selectOption()
1450
  */
1451
- public function selectOption($select, $option) {
1452
- return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
1453
  }
1454
 
1455
 
@@ -1465,7 +1417,7 @@ trait AcceptanceTesterActions
1465
  * ```
1466
  *
1467
  * @param $option
1468
- * @see \Codeception\Lib\InnerBrowser::checkOption()
1469
  */
1470
  public function checkOption($option) {
1471
  return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
@@ -1484,7 +1436,7 @@ trait AcceptanceTesterActions
1484
  * ```
1485
  *
1486
  * @param $option
1487
- * @see \Codeception\Lib\InnerBrowser::uncheckOption()
1488
  */
1489
  public function uncheckOption($option) {
1490
  return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
@@ -1494,92 +1446,55 @@ trait AcceptanceTesterActions
1494
  /**
1495
  * [!] Method is generated. Documentation taken from corresponding module.
1496
  *
1497
- * Attaches a file relative to the Codeception data directory to the given file upload field.
1498
  *
1499
  * ``` php
1500
  * <?php
1501
- * // file is stored in 'tests/_data/prices.xls'
1502
- * $I->attachFile('input[@type="file"]', 'prices.xls');
1503
  * ?>
1504
  * ```
1505
  *
1506
  * @param $field
1507
- * @param $filename
1508
- * @see \Codeception\Lib\InnerBrowser::attachFile()
1509
- */
1510
- public function attachFile($field, $filename) {
1511
- return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
1512
- }
1513
-
1514
-
1515
- /**
1516
- * [!] Method is generated. Documentation taken from corresponding module.
1517
- *
1518
- * If your page triggers an ajax request, you can perform it manually.
1519
- * This action sends a GET ajax request with specified params.
1520
- *
1521
- * See ->sendAjaxPostRequest for examples.
1522
- *
1523
- * @param $uri
1524
- * @param $params
1525
- * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
1526
  */
1527
- public function sendAjaxGetRequest($uri, $params = null) {
1528
- return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
1529
  }
1530
 
1531
 
1532
  /**
1533
  * [!] Method is generated. Documentation taken from corresponding module.
1534
  *
1535
- * If your page triggers an ajax request, you can perform it manually.
1536
- * This action sends a POST ajax request with specified params.
1537
- * Additional params can be passed as array.
1538
- *
1539
- * Example:
1540
- *
1541
- * Imagine that by clicking checkbox you trigger ajax request which updates user settings.
1542
- * We emulate that click by running this ajax request manually.
1543
  *
1544
  * ``` php
1545
  * <?php
1546
- * $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
1547
- * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
1548
- *
1549
  * ```
1550
  *
1551
- * @param $uri
1552
- * @param $params
1553
- * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
1554
  */
1555
- public function sendAjaxPostRequest($uri, $params = null) {
1556
- return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
1557
  }
1558
 
1559
 
1560
  /**
1561
  * [!] Method is generated. Documentation taken from corresponding module.
1562
  *
1563
- * If your page triggers an ajax request, you can perform it manually.
1564
- * This action sends an ajax request with specified method and params.
1565
- *
1566
- * Example:
1567
- *
1568
- * You need to perform an ajax request specifying the HTTP method.
1569
- *
1570
- * ``` php
1571
- * <?php
1572
- * $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
1573
- *
1574
- * ```
1575
  *
1576
- * @param $method
1577
- * @param $uri
1578
- * @param $params
1579
- * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
1580
  */
1581
- public function sendAjaxRequest($method, $uri, $params = null) {
1582
- return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
1583
  }
1584
 
1585
 
@@ -1601,7 +1516,7 @@ trait AcceptanceTesterActions
1601
  * @param $cssOrXPathOrRegex
1602
  *
1603
  * @return mixed
1604
- * @see \Codeception\Lib\InnerBrowser::grabTextFrom()
1605
  */
1606
  public function grabTextFrom($cssOrXPathOrRegex) {
1607
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
@@ -1625,13 +1540,38 @@ trait AcceptanceTesterActions
1625
  * @param $attribute
1626
  *
1627
  * @return mixed
1628
- * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom()
1629
  */
1630
  public function grabAttributeFrom($cssOrXpath, $attribute) {
1631
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
1632
  }
1633
 
1634
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1635
  /**
1636
  * [!] Method is generated. Documentation taken from corresponding module.
1637
  *
@@ -1657,7 +1597,7 @@ trait AcceptanceTesterActions
1657
  * @param $cssOrXpath
1658
  * @param $attribute
1659
  * @return string[]
1660
- * @see \Codeception\Lib\InnerBrowser::grabMultiple()
1661
  */
1662
  public function grabMultiple($cssOrXpath, $attribute = null) {
1663
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args()));
@@ -1667,774 +1607,1119 @@ trait AcceptanceTesterActions
1667
  /**
1668
  * [!] Method is generated. Documentation taken from corresponding module.
1669
  *
1670
- * @param $field
1671
- *
1672
- * @return array|mixed|null|string
1673
- * @see \Codeception\Lib\InnerBrowser::grabValueFrom()
1674
- */
1675
- public function grabValueFrom($field) {
1676
- return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
1677
- }
1678
-
1679
-
1680
- /**
1681
- * [!] Method is generated. Documentation taken from corresponding module.
1682
- *
1683
- * Sets a cookie with the given name and value.
1684
- * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument.
1685
  *
1686
  * ``` php
1687
  * <?php
1688
- * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
 
 
 
 
 
 
1689
  * ?>
1690
  * ```
1691
  *
1692
- * @param $name
1693
- * @param $val
1694
- * @param array $params
1695
- *
1696
- * @return mixed
1697
- * @see \Codeception\Lib\InnerBrowser::setCookie()
1698
  */
1699
- public function setCookie($name, $val, $params = null) {
1700
- return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
1701
  }
1702
-
1703
-
1704
  /**
1705
  * [!] Method is generated. Documentation taken from corresponding module.
1706
  *
1707
- * Grabs a cookie value.
1708
- * You can set additional cookie params like `domain`, `path` in array passed as last argument.
1709
  *
1710
- * @param $cookie
 
 
 
 
 
1711
  *
1712
- * @param array $params
1713
- * @return mixed
1714
- * @see \Codeception\Lib\InnerBrowser::grabCookie()
 
 
 
 
 
 
1715
  */
1716
- public function grabCookie($cookie, $params = null) {
1717
- return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
1718
  }
1719
 
1720
 
1721
  /**
1722
  * [!] Method is generated. Documentation taken from corresponding module.
1723
  *
1724
- * Checks that a cookie with the given name is set.
1725
- * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1726
  *
1727
  * ``` php
1728
  * <?php
1729
- * $I->seeCookie('PHPSESSID');
1730
- * ?>
1731
- * ```
 
 
 
1732
  *
1733
- * @param $cookie
1734
- * @param array $params
1735
- * @return mixed
1736
  * Conditional Assertion: Test won't be stopped on fail
1737
- * @see \Codeception\Lib\InnerBrowser::seeCookie()
1738
  */
1739
- public function canSeeCookie($cookie, $params = null) {
1740
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
1741
  }
1742
  /**
1743
  * [!] Method is generated. Documentation taken from corresponding module.
1744
  *
1745
- * Checks that a cookie with the given name is set.
1746
- * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1747
  *
1748
  * ``` php
1749
  * <?php
1750
- * $I->seeCookie('PHPSESSID');
 
 
 
1751
  * ?>
1752
  * ```
1753
  *
1754
- * @param $cookie
1755
- * @param array $params
1756
- * @return mixed
1757
- * @see \Codeception\Lib\InnerBrowser::seeCookie()
1758
  */
1759
- public function seeCookie($cookie, $params = null) {
1760
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
1761
  }
1762
 
1763
 
1764
  /**
1765
  * [!] Method is generated. Documentation taken from corresponding module.
1766
  *
1767
- * Checks that there isn't a cookie with the given name.
1768
- * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1769
  *
1770
- * @param $cookie
 
 
 
 
1771
  *
1772
- * @param array $params
1773
- * @return mixed
1774
  * Conditional Assertion: Test won't be stopped on fail
1775
- * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
1776
  */
1777
- public function cantSeeCookie($cookie, $params = null) {
1778
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
1779
  }
1780
  /**
1781
  * [!] Method is generated. Documentation taken from corresponding module.
1782
  *
1783
- * Checks that there isn't a cookie with the given name.
1784
- * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1785
  *
1786
- * @param $cookie
 
 
 
 
1787
  *
1788
- * @param array $params
1789
- * @return mixed
1790
- * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
1791
  */
1792
- public function dontSeeCookie($cookie, $params = null) {
1793
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
1794
  }
1795
 
1796
 
1797
  /**
1798
  * [!] Method is generated. Documentation taken from corresponding module.
1799
  *
1800
- * Unsets cookie with the given name.
1801
- * You can set additional cookie params like `domain`, `path` in array passed as last argument.
1802
  *
1803
- * @param $cookie
 
 
 
 
 
 
 
 
1804
  *
1805
- * @param array $params
1806
- * @return mixed
1807
- * @see \Codeception\Lib\InnerBrowser::resetCookie()
 
1808
  */
1809
- public function resetCookie($name, $params = null) {
1810
- return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
1811
  }
1812
 
1813
 
1814
  /**
1815
  * [!] Method is generated. Documentation taken from corresponding module.
1816
  *
1817
- * Checks that the given element exists on the page and is visible.
1818
- * You can also specify expected attributes of this element.
1819
  *
1820
  * ``` php
1821
  * <?php
1822
- * $I->seeElement('.error');
1823
- * $I->seeElement('//form/input[1]');
1824
- * $I->seeElement('input', ['name' => 'login']);
1825
- * $I->seeElement('input', ['value' => '123456']);
 
 
 
 
 
 
 
 
 
 
 
 
1826
  *
1827
- * // strict locator in first arg, attributes in second
1828
- * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1829
  * ?>
1830
  * ```
1831
  *
1832
  * @param $selector
1833
- * @param array $attributes
1834
- * @return
 
1835
  * Conditional Assertion: Test won't be stopped on fail
1836
- * @see \Codeception\Lib\InnerBrowser::seeElement()
1837
  */
1838
- public function canSeeElement($selector, $attributes = null) {
1839
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
1840
  }
1841
  /**
1842
  * [!] Method is generated. Documentation taken from corresponding module.
1843
  *
1844
- * Checks that the given element exists on the page and is visible.
1845
- * You can also specify expected attributes of this element.
1846
  *
1847
  * ``` php
1848
  * <?php
1849
- * $I->seeElement('.error');
1850
- * $I->seeElement('//form/input[1]');
1851
- * $I->seeElement('input', ['name' => 'login']);
1852
- * $I->seeElement('input', ['value' => '123456']);
1853
  *
1854
- * // strict locator in first arg, attributes in second
1855
- * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1856
  * ?>
1857
  * ```
1858
  *
1859
  * @param $selector
1860
- * @param array $attributes
1861
- * @return
1862
- * @see \Codeception\Lib\InnerBrowser::seeElement()
 
 
1863
  */
1864
- public function seeElement($selector, $attributes = null) {
1865
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1866
  }
1867
 
1868
 
1869
  /**
1870
  * [!] Method is generated. Documentation taken from corresponding module.
1871
  *
1872
- * Checks that the given element is invisible or not present on the page.
1873
- * You can also specify expected attributes of this element.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1874
  *
1875
- * ``` php
1876
- * <?php
1877
- * $I->dontSeeElement('.error');
1878
- * $I->dontSeeElement('//form/input[1]');
1879
- * $I->dontSeeElement('input', ['name' => 'login']);
1880
- * $I->dontSeeElement('input', ['value' => '123456']);
1881
- * ?>
1882
  * ```
1883
  *
 
 
 
 
 
1884
  * @param $selector
1885
- * @param array $attributes
1886
- * Conditional Assertion: Test won't be stopped on fail
1887
- * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
1888
  */
1889
- public function cantSeeElement($selector, $attributes = null) {
1890
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
1891
  }
 
 
1892
  /**
1893
  * [!] Method is generated. Documentation taken from corresponding module.
1894
  *
1895
- * Checks that the given element is invisible or not present on the page.
1896
- * You can also specify expected attributes of this element.
 
1897
  *
1898
  * ``` php
1899
  * <?php
1900
- * $I->dontSeeElement('.error');
1901
- * $I->dontSeeElement('//form/input[1]');
1902
- * $I->dontSeeElement('input', ['name' => 'login']);
1903
- * $I->dontSeeElement('input', ['value' => '123456']);
1904
  * ?>
1905
  * ```
1906
  *
1907
- * @param $selector
1908
- * @param array $attributes
1909
- * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
 
 
1910
  */
1911
- public function dontSeeElement($selector, $attributes = null) {
1912
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
1913
  }
1914
 
1915
 
1916
  /**
1917
  * [!] Method is generated. Documentation taken from corresponding module.
1918
  *
1919
- * Checks that there are a certain number of elements matched by the given locator on the page.
 
1920
  *
1921
  * ``` php
1922
  * <?php
1923
- * $I->seeNumberOfElements('tr', 10);
1924
- * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
1925
  * ?>
1926
  * ```
1927
- * @param $selector
1928
- * @param mixed $expected :
1929
- * - string: strict number
1930
- * - array: range of numbers [0,10]
1931
- * Conditional Assertion: Test won't be stopped on fail
1932
- * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
1933
  */
1934
- public function canSeeNumberOfElements($selector, $expected) {
1935
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
1936
  }
 
 
1937
  /**
1938
  * [!] Method is generated. Documentation taken from corresponding module.
1939
  *
1940
- * Checks that there are a certain number of elements matched by the given locator on the page.
 
1941
  *
1942
  * ``` php
1943
  * <?php
1944
- * $I->seeNumberOfElements('tr', 10);
1945
- * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
1946
  * ?>
1947
  * ```
1948
- * @param $selector
1949
- * @param mixed $expected :
1950
- * - string: strict number
1951
- * - array: range of numbers [0,10]
1952
- * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
1953
  */
1954
- public function seeNumberOfElements($selector, $expected) {
1955
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
1956
  }
1957
 
1958
 
1959
  /**
1960
  * [!] Method is generated. Documentation taken from corresponding module.
1961
  *
1962
- * Checks that the given option is selected.
 
1963
  *
1964
  * ``` php
1965
  * <?php
1966
- * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
1967
  * ?>
1968
  * ```
1969
  *
1970
- * @param $selector
1971
- * @param $optionText
1972
- *
1973
- * @return mixed
1974
- * Conditional Assertion: Test won't be stopped on fail
1975
- * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
1976
  */
1977
- public function canSeeOptionIsSelected($selector, $optionText) {
1978
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
1979
  }
 
 
1980
  /**
1981
  * [!] Method is generated. Documentation taken from corresponding module.
1982
  *
1983
- * Checks that the given option is selected.
 
 
1984
  *
1985
  * ``` php
1986
  * <?php
1987
- * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
 
1988
  * ?>
1989
  * ```
1990
  *
1991
- * @param $selector
1992
- * @param $optionText
1993
- *
1994
- * @return mixed
1995
- * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
1996
  */
1997
- public function seeOptionIsSelected($selector, $optionText) {
1998
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
1999
  }
2000
 
2001
 
2002
  /**
2003
  * [!] Method is generated. Documentation taken from corresponding module.
2004
  *
2005
- * Checks that the given option is not selected.
2006
- *
2007
- * ``` php
2008
- * <?php
2009
- * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
2010
- * ?>
2011
- * ```
2012
- *
2013
- * @param $selector
2014
- * @param $optionText
2015
  *
2016
- * @return mixed
2017
- * Conditional Assertion: Test won't be stopped on fail
2018
- * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
2019
  */
2020
- public function cantSeeOptionIsSelected($selector, $optionText) {
2021
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
2022
  }
 
 
2023
  /**
2024
  * [!] Method is generated. Documentation taken from corresponding module.
2025
  *
2026
- * Checks that the given option is not selected.
 
2027
  *
2028
  * ``` php
2029
- * <?php
2030
- * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
2031
- * ?>
2032
  * ```
2033
  *
2034
- * @param $selector
2035
- * @param $optionText
 
 
2036
  *
2037
- * @return mixed
2038
- * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
2039
  */
2040
- public function dontSeeOptionIsSelected($selector, $optionText) {
2041
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
2042
  }
2043
 
2044
 
2045
  /**
2046
  * [!] Method is generated. Documentation taken from corresponding module.
2047
  *
2048
- * Asserts that current page has 404 response status code.
2049
- * Conditional Assertion: Test won't be stopped on fail
2050
- * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
2051
- */
2052
- public function canSeePageNotFound() {
2053
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args()));
2054
- }
2055
- /**
2056
- * [!] Method is generated. Documentation taken from corresponding module.
2057
  *
2058
- * Asserts that current page has 404 response status code.
2059
- * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
2060
- */
2061
- public function seePageNotFound() {
2062
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
2063
- }
2064
-
2065
-
2066
- /**
2067
- * [!] Method is generated. Documentation taken from corresponding module.
2068
  *
2069
- * Checks that response code is equal to value provided.
 
 
 
2070
  *
2071
- * ```php
2072
  * <?php
2073
- * $I->seeResponseCodeIs(200);
2074
- *
2075
- * // recommended \Codeception\Util\HttpCode
2076
- * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
 
 
2077
  * ```
2078
  *
2079
- * @param $code
2080
- * Conditional Assertion: Test won't be stopped on fail
2081
- * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
2082
- */
2083
- public function canSeeResponseCodeIs($code) {
2084
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
2085
- }
2086
- /**
2087
- * [!] Method is generated. Documentation taken from corresponding module.
2088
- *
2089
- * Checks that response code is equal to value provided.
2090
  *
2091
- * ```php
2092
  * <?php
2093
- * $I->seeResponseCodeIs(200);
2094
- *
2095
- * // recommended \Codeception\Util\HttpCode
2096
- * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
 
 
2097
  * ```
2098
  *
2099
- * @param $code
2100
- * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
2101
  */
2102
- public function seeResponseCodeIs($code) {
2103
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
2104
  }
2105
 
2106
 
2107
  /**
2108
  * [!] Method is generated. Documentation taken from corresponding module.
2109
  *
2110
- * Checks that response code is equal to value provided.
2111
  *
2112
- * ```php
2113
- * <?php
2114
- * $I->dontSeeResponseCodeIs(200);
2115
  *
2116
- * // recommended \Codeception\Util\HttpCode
2117
- * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK);
2118
  * ```
2119
- * @param $code
2120
- * Conditional Assertion: Test won't be stopped on fail
2121
- * @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs()
2122
- */
2123
- public function cantSeeResponseCodeIs($code) {
2124
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseCodeIs', func_get_args()));
2125
- }
2126
- /**
2127
- * [!] Method is generated. Documentation taken from corresponding module.
2128
- *
2129
- * Checks that response code is equal to value provided.
2130
  *
2131
- * ```php
2132
  * <?php
2133
- * $I->dontSeeResponseCodeIs(200);
 
 
 
2134
  *
2135
- * // recommended \Codeception\Util\HttpCode
2136
- * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK);
2137
  * ```
2138
- * @param $code
2139
- * @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs()
 
2140
  */
2141
- public function dontSeeResponseCodeIs($code) {
2142
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeResponseCodeIs', func_get_args()));
2143
  }
2144
 
2145
 
2146
  /**
2147
  * [!] Method is generated. Documentation taken from corresponding module.
2148
  *
2149
- * Checks that the page title contains the given string.
 
 
2150
  *
2151
  * ``` php
2152
  * <?php
2153
- * $I->seeInTitle('Blog - Post #1');
2154
  * ?>
2155
  * ```
2156
  *
2157
- * @param $title
2158
- *
2159
- * @return mixed
2160
- * Conditional Assertion: Test won't be stopped on fail
2161
- * @see \Codeception\Lib\InnerBrowser::seeInTitle()
2162
  */
2163
- public function canSeeInTitle($title) {
2164
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
2165
  }
 
 
2166
  /**
2167
  * [!] Method is generated. Documentation taken from corresponding module.
2168
  *
2169
- * Checks that the page title contains the given string.
2170
  *
2171
- * ``` php
 
 
2172
  * <?php
2173
- * $I->seeInTitle('Blog - Post #1');
2174
  * ?>
2175
  * ```
2176
  *
2177
- * @param $title
2178
- *
2179
  * @return mixed
2180
- * @see \Codeception\Lib\InnerBrowser::seeInTitle()
2181
  */
2182
- public function seeInTitle($title) {
2183
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
2184
  }
2185
 
2186
 
2187
  /**
2188
  * [!] Method is generated. Documentation taken from corresponding module.
2189
  *
2190
- * Checks that the page title does not contain the given string.
2191
- *
2192
- * @param $title
2193
- *
2194
- * @return mixed
2195
- * Conditional Assertion: Test won't be stopped on fail
2196
- * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
2197
- */
2198
- public function cantSeeInTitle($title) {
2199
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
2200
- }
2201
- /**
2202
- * [!] Method is generated. Documentation taken from corresponding module.
2203
- *
2204
- * Checks that the page title does not contain the given string.
2205
- *
2206
- * @param $title
2207
- *
2208
- * @return mixed
2209
- * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
2210
  */
2211
- public function dontSeeInTitle($title) {
2212
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
2213
  }
2214
 
2215
 
2216
  /**
2217
  * [!] Method is generated. Documentation taken from corresponding module.
2218
  *
2219
- * Switch to iframe or frame on the page.
2220
- *
2221
- * Example:
2222
- * ``` html
2223
- * <iframe name="another_frame" src="http://example.com">
2224
- * ```
2225
  *
2226
  * ``` php
2227
  * <?php
2228
- * # switch to iframe
2229
- * $I->switchToIframe("another_frame");
2230
  * ```
2231
  *
2232
- * @param string $name
2233
- * @see \Codeception\Lib\InnerBrowser::switchToIframe()
2234
- */
2235
- public function switchToIframe($name) {
2236
- return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToIframe', func_get_args()));
2237
- }
2238
-
2239
-
2240
- /**
2241
- * [!] Method is generated. Documentation taken from corresponding module.
2242
- *
2243
- * Moves back in history.
2244
- *
2245
- * @param int $numberOfSteps (default value 1)
2246
- * @see \Codeception\Lib\InnerBrowser::moveBack()
2247
  */
2248
- public function moveBack($numberOfSteps = null) {
2249
- return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args()));
2250
  }
2251
 
2252
 
2253
  /**
2254
  * [!] Method is generated. Documentation taken from corresponding module.
2255
  *
2256
- * Inserts an SQL record into a database. This record will be erased after the test.
 
 
 
2257
  *
2258
- * ```php
2259
  * <?php
2260
- * $I->haveInDatabase('users', array('name' => 'miles', 'email' => 'miles@davis.com'));
2261
  * ?>
2262
  * ```
2263
  *
2264
- * @param string $table
2265
- * @param array $data
 
2266
  *
2267
- * @return integer $id
2268
- * @see \Codeception\Module\Db::haveInDatabase()
2269
  */
2270
- public function haveInDatabase($table, $data) {
2271
- return $this->getScenario()->runStep(new \Codeception\Step\Action('haveInDatabase', func_get_args()));
2272
  }
2273
 
2274
 
2275
  /**
2276
  * [!] Method is generated. Documentation taken from corresponding module.
2277
  *
2278
- * Asserts that a row with the given column values exists.
2279
- * Provide table name and column values.
2280
- *
2281
- * ``` php
2282
- * <?php
2283
- * $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
2284
- * ```
2285
- * Fails if no such user found.
2286
  *
2287
- * @param string $table
2288
- * @param array $criteria
2289
- * Conditional Assertion: Test won't be stopped on fail
2290
- * @see \Codeception\Module\Db::seeInDatabase()
2291
  */
2292
- public function canSeeInDatabase($table, $criteria = null) {
2293
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInDatabase', func_get_args()));
2294
  }
 
 
2295
  /**
2296
  * [!] Method is generated. Documentation taken from corresponding module.
2297
  *
2298
- * Asserts that a row with the given column values exists.
2299
- * Provide table name and column values.
2300
- *
2301
- * ``` php
2302
- * <?php
2303
- * $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
2304
- * ```
2305
- * Fails if no such user found.
2306
  *
2307
- * @param string $table
2308
- * @param array $criteria
2309
- * @see \Codeception\Module\Db::seeInDatabase()
2310
  */
2311
- public function seeInDatabase($table, $criteria = null) {
2312
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInDatabase', func_get_args()));
2313
  }
2314
 
2315
 
2316
  /**
2317
  * [!] Method is generated. Documentation taken from corresponding module.
2318
  *
2319
- * Asserts that the given number of records were found in the database.
2320
- *
2321
- * ```php
2322
- * <?php
2323
- * $I->seeNumRecords(1, 'users', ['name' => 'davert'])
2324
- * ?>
2325
- * ```
2326
  *
2327
- * @param int $expectedNumber Expected number
2328
- * @param string $table Table name
2329
- * @param array $criteria Search criteria [Optional]
2330
- * Conditional Assertion: Test won't be stopped on fail
2331
- * @see \Codeception\Module\Db::seeNumRecords()
2332
  */
2333
- public function canSeeNumRecords($expectedNumber, $table, $criteria = null) {
2334
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumRecords', func_get_args()));
2335
  }
 
 
2336
  /**
2337
  * [!] Method is generated. Documentation taken from corresponding module.
2338
  *
2339
- * Asserts that the given number of records were found in the database.
 
 
 
2340
  *
2341
- * ```php
2342
  * <?php
2343
- * $I->seeNumRecords(1, 'users', ['name' => 'davert'])
 
 
 
 
 
2344
  * ?>
2345
  * ```
2346
  *
2347
- * @param int $expectedNumber Expected number
2348
- * @param string $table Table name
2349
- * @param array $criteria Search criteria [Optional]
2350
- * @see \Codeception\Module\Db::seeNumRecords()
2351
  */
2352
- public function seeNumRecords($expectedNumber, $table, $criteria = null) {
2353
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumRecords', func_get_args()));
2354
  }
2355
 
2356
 
2357
  /**
2358
  * [!] Method is generated. Documentation taken from corresponding module.
2359
  *
2360
- * Effect is opposite to ->seeInDatabase
2361
- *
2362
- * Asserts that there is no record with the given column values in a database.
2363
- * Provide table name and column values.
2364
  *
2365
  * ``` php
2366
  * <?php
2367
- * $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
 
 
2368
  * ```
2369
- * Fails if such user was found.
2370
  *
2371
- * @param string $table
2372
- * @param array $criteria
2373
- * Conditional Assertion: Test won't be stopped on fail
2374
- * @see \Codeception\Module\Db::dontSeeInDatabase()
2375
  */
2376
- public function cantSeeInDatabase($table, $criteria = null) {
2377
- return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInDatabase', func_get_args()));
2378
  }
 
 
2379
  /**
2380
  * [!] Method is generated. Documentation taken from corresponding module.
2381
  *
2382
- * Effect is opposite to ->seeInDatabase
2383
- *
2384
- * Asserts that there is no record with the given column values in a database.
2385
- * Provide table name and column values.
2386
- *
2387
- * ``` php
2388
- * <?php
2389
- * $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
2390
- * ```
2391
- * Fails if such user was found.
2392
- *
2393
- * @param string $table
2394
- * @param array $criteria
2395
- * @see \Codeception\Module\Db::dontSeeInDatabase()
2396
  */
2397
- public function dontSeeInDatabase($table, $criteria = null) {
2398
- return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInDatabase', func_get_args()));
2399
  }
2400
 
2401
 
2402
  /**
2403
  * [!] Method is generated. Documentation taken from corresponding module.
2404
  *
2405
- * Fetches a single column value from a database.
2406
- * Provide table name, desired column and criteria.
2407
- *
2408
- * ``` php
2409
- * <?php
2410
- * $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
2411
- * ```
2412
- *
2413
- * @param string $table
2414
- * @param string $column
2415
- * @param array $criteria
2416
- *
2417
- * @return mixed
2418
- * @see \Codeception\Module\Db::grabFromDatabase()
2419
  */
2420
- public function grabFromDatabase($table, $column, $criteria = null) {
2421
- return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args()));
2422
  }
2423
 
2424
 
2425
  /**
2426
  * [!] Method is generated. Documentation taken from corresponding module.
2427
  *
2428
- * Returns the number of rows in a database
 
 
2429
  *
2430
- * @param string $table Table name
2431
- * @param array $criteria Search criteria [Optional]
 
 
 
2432
  *
2433
- * @return int
2434
- * @see \Codeception\Module\Db::grabNumRecords()
 
 
2435
  */
2436
- public function grabNumRecords($table, $criteria = null) {
2437
- return $this->getScenario()->runStep(new \Codeception\Step\Action('grabNumRecords', func_get_args()));
2438
  }
2439
 
2440
 
1
+ <?php //[STAMP] 186bc11a4a9f361a45ba7515d24bfda6
2
  namespace _generated;
3
 
4
  // This class was automatically generated by build task
5
  // You should not change it manually as it will be overwritten on next build
6
  // @codingStandardsIgnoreFile
7
 
8
+ use Codeception\Module\WebDriver;
 
 
9
  use Codeception\Module\Filesystem;
10
  use Codeception\Module\Asserts;
11
+ use Helper\Acceptance;
12
 
13
  trait AcceptanceTesterActions
14
  {
21
  /**
22
  * [!] Method is generated. Documentation taken from corresponding module.
23
  *
24
+ * Print out latest Selenium Logs in debug mode
25
+ * @see \Codeception\Module\WebDriver::debugWebDriverLogs()
 
 
 
26
  */
27
+ public function debugWebDriverLogs() {
28
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWebDriverLogs', func_get_args()));
29
  }
30
 
31
 
32
  /**
33
  * [!] Method is generated. Documentation taken from corresponding module.
34
  *
35
+ * Changes the subdomain for the 'url' configuration parameter.
36
+ * Does not open a page; use `amOnPage` for that.
37
+ *
38
+ * ``` php
39
+ * <?php
40
+ * // If config is: 'http://mysite.com'
41
+ * // or config is: 'http://www.mysite.com'
42
+ * // or config is: 'http://company.mysite.com'
43
+ *
44
+ * $I->amOnSubdomain('user');
45
+ * $I->amOnPage('/');
46
+ * // moves to http://user.mysite.com/
47
+ * ?>
48
+ * ```
49
+ *
50
+ * @param $subdomain
51
  *
52
+ * @return mixed
53
+ * @see \Codeception\Module\WebDriver::amOnSubdomain()
 
54
  */
55
+ public function amOnSubdomain($subdomain) {
56
+ return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
57
  }
58
 
59
 
60
  /**
61
  * [!] Method is generated. Documentation taken from corresponding module.
62
  *
63
+ * Takes a screenshot of the current window and saves it to `tests/_output/debug`.
64
  *
65
  * ``` php
66
  * <?php
67
+ * $I->amOnPage('/user/edit');
68
+ * $I->makeScreenshot('edit_page');
69
+ * // saved to: tests/_output/debug/edit_page.png
70
  * ?>
71
  * ```
72
+ *
73
+ * @param $name
74
+ * @see \Codeception\Module\WebDriver::makeScreenshot()
75
  */
76
+ public function makeScreenshot($name) {
77
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('makeScreenshot', func_get_args()));
78
  }
79
 
80
 
81
  /**
82
  * [!] Method is generated. Documentation taken from corresponding module.
83
  *
84
+ * Resize the current window.
 
85
  *
86
  * ``` php
87
  * <?php
88
+ * $I->resizeWindow(800, 600);
 
 
89
  *
 
 
 
 
90
  * ```
91
  *
92
+ * @param int $width
93
+ * @param int $height
94
+ * @see \Codeception\Module\WebDriver::resizeWindow()
 
95
  */
96
+ public function resizeWindow($width, $height) {
97
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('resizeWindow', func_get_args()));
98
  }
99
 
100
 
101
  /**
102
  * [!] Method is generated. Documentation taken from corresponding module.
103
  *
104
+ * Checks that a cookie with the given name is set.
105
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
 
 
106
  *
107
  * ``` php
108
  * <?php
109
+ * $I->seeCookie('PHPSESSID');
 
 
110
  * ?>
111
  * ```
112
  *
113
+ * @param $cookie
114
+ * @param array $params
115
+ * @return mixed
116
+ * Conditional Assertion: Test won't be stopped on fail
117
+ * @see \Codeception\Module\WebDriver::seeCookie()
118
  */
119
+ public function canSeeCookie($cookie, $params = null) {
120
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
121
  }
 
 
122
  /**
123
  * [!] Method is generated. Documentation taken from corresponding module.
124
  *
125
+ * Checks that a cookie with the given name is set.
126
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
127
  *
128
+ * ``` php
 
129
  * <?php
130
+ * $I->seeCookie('PHPSESSID');
 
131
  * ?>
132
  * ```
133
  *
134
+ * @param $cookie
135
+ * @param array $params
136
+ * @return mixed
137
+ * @see \Codeception\Module\WebDriver::seeCookie()
138
  */
139
+ public function seeCookie($cookie, $params = null) {
140
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
141
  }
142
 
143
 
144
  /**
145
  * [!] Method is generated. Documentation taken from corresponding module.
146
  *
147
+ * Checks that there isn't a cookie with the given name.
148
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
149
  *
150
+ * @param $cookie
151
+ *
152
+ * @param array $params
153
+ * @return mixed
154
+ * Conditional Assertion: Test won't be stopped on fail
155
+ * @see \Codeception\Module\WebDriver::dontSeeCookie()
156
+ */
157
+ public function cantSeeCookie($cookie, $params = null) {
158
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
159
+ }
160
+ /**
161
+ * [!] Method is generated. Documentation taken from corresponding module.
162
+ *
163
+ * Checks that there isn't a cookie with the given name.
164
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
165
+ *
166
+ * @param $cookie
167
  *
168
+ * @param array $params
169
+ * @return mixed
170
+ * @see \Codeception\Module\WebDriver::dontSeeCookie()
171
  */
172
+ public function dontSeeCookie($cookie, $params = null) {
173
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
174
  }
175
 
176
 
177
  /**
178
  * [!] Method is generated. Documentation taken from corresponding module.
179
  *
180
+ * Sets a cookie with the given name and value.
181
+ * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument.
182
  *
183
  * ``` php
184
  * <?php
185
+ * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
186
+ * ?>
 
 
187
  * ```
188
  *
189
+ * @param $name
190
+ * @param $val
191
+ * @param array $params
192
+ *
193
+ * @return mixed
194
+ * @see \Codeception\Module\WebDriver::setCookie()
195
  */
196
+ public function setCookie($cookie, $value, $params = null) {
197
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
198
  }
199
 
200
 
201
  /**
202
  * [!] Method is generated. Documentation taken from corresponding module.
203
  *
204
+ * Unsets cookie with the given name.
205
+ * You can set additional cookie params like `domain`, `path` in array passed as last argument.
 
 
 
206
  *
207
+ * @param $cookie
208
  *
209
+ * @param array $params
210
+ * @return mixed
211
+ * @see \Codeception\Module\WebDriver::resetCookie()
212
+ */
213
+ public function resetCookie($cookie, $params = null) {
214
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
215
+ }
216
+
217
+
218
+ /**
219
+ * [!] Method is generated. Documentation taken from corresponding module.
220
+ *
221
+ * Grabs a cookie value.
222
+ * You can set additional cookie params like `domain`, `path` in array passed as last argument.
223
+ *
224
+ * @param $cookie
225
+ *
226
+ * @param array $params
227
+ * @return mixed
228
+ * @see \Codeception\Module\WebDriver::grabCookie()
229
+ */
230
+ public function grabCookie($cookie, $params = null) {
231
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
232
+ }
233
+
234
+
235
+ /**
236
+ * [!] Method is generated. Documentation taken from corresponding module.
237
+ *
238
+ * Open web page at the given absolute URL and sets its hostname as the base host.
239
  *
240
  * ``` php
241
  * <?php
242
+ * $I->amOnUrl('http://codeception.com');
243
+ * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
 
 
 
 
 
 
 
 
 
 
244
  * ?>
245
  * ```
246
+ * @see \Codeception\Module\WebDriver::amOnUrl()
247
+ */
248
+ public function amOnUrl($url) {
249
+ return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args()));
250
+ }
251
+
252
+
253
+ /**
254
+ * [!] Method is generated. Documentation taken from corresponding module.
255
+ *
256
+ * Opens the page for the given relative URI.
257
+ *
258
+ * ``` php
259
+ * <?php
260
+ * // opens front page
261
+ * $I->amOnPage('/');
262
+ * // opens /register page
263
+ * $I->amOnPage('/register');
264
+ * ```
265
  *
266
+ * @param $page
267
+ * @see \Codeception\Module\WebDriver::amOnPage()
 
268
  */
269
+ public function amOnPage($page) {
270
+ return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
271
  }
272
 
273
 
303
  * @param $text
304
  * @param null $selector
305
  * Conditional Assertion: Test won't be stopped on fail
306
+ * @see \Codeception\Module\WebDriver::see()
307
  */
308
  public function canSee($text, $selector = null) {
309
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
339
  *
340
  * @param $text
341
  * @param null $selector
342
+ * @see \Codeception\Module\WebDriver::see()
343
  */
344
  public function see($text, $selector = null) {
345
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
376
  * @param $text
377
  * @param null $selector
378
  * Conditional Assertion: Test won't be stopped on fail
379
+ * @see \Codeception\Module\WebDriver::dontSee()
380
  */
381
  public function cantSee($text, $selector = null) {
382
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
410
  *
411
  * @param $text
412
  * @param null $selector
413
+ * @see \Codeception\Module\WebDriver::dontSee()
414
  */
415
  public function dontSee($text, $selector = null) {
416
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
430
  *
431
  * @param $raw
432
  * Conditional Assertion: Test won't be stopped on fail
433
+ * @see \Codeception\Module\WebDriver::seeInSource()
434
  */
435
  public function canSeeInSource($raw) {
436
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args()));
447
  * ```
448
  *
449
  * @param $raw
450
+ * @see \Codeception\Module\WebDriver::seeInSource()
451
  */
452
  public function seeInSource($raw) {
453
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args()));
467
  *
468
  * @param $raw
469
  * Conditional Assertion: Test won't be stopped on fail
470
+ * @see \Codeception\Module\WebDriver::dontSeeInSource()
471
  */
472
  public function cantSeeInSource($raw) {
473
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args()));
484
  * ```
485
  *
486
  * @param $raw
487
+ * @see \Codeception\Module\WebDriver::dontSeeInSource()
488
  */
489
  public function dontSeeInSource($raw) {
490
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args()));
494
  /**
495
  * [!] Method is generated. Documentation taken from corresponding module.
496
  *
497
+ * Checks that the page source contains the given string.
 
498
  *
499
+ * ```php
500
  * <?php
501
+ * $I->seeInPageSource('<link rel="apple-touch-icon"');
 
 
502
  * ```
503
  *
504
+ * @param $text
 
505
  * Conditional Assertion: Test won't be stopped on fail
506
+ * @see \Codeception\Module\WebDriver::seeInPageSource()
507
  */
508
+ public function canSeeInPageSource($text) {
509
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args()));
510
  }
511
  /**
512
  * [!] Method is generated. Documentation taken from corresponding module.
513
  *
514
+ * Checks that the page source contains the given string.
 
515
  *
516
+ * ```php
517
  * <?php
518
+ * $I->seeInPageSource('<link rel="apple-touch-icon"');
 
 
519
  * ```
520
  *
521
+ * @param $text
522
+ * @see \Codeception\Module\WebDriver::seeInPageSource()
 
523
  */
524
+ public function seeInPageSource($text) {
525
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPageSource', func_get_args()));
526
  }
527
 
528
 
529
  /**
530
  * [!] Method is generated. Documentation taken from corresponding module.
531
  *
532
+ * Checks that the page source doesn't contain the given string.
 
 
 
 
 
 
 
 
533
  *
534
  * @param $text
 
535
  * Conditional Assertion: Test won't be stopped on fail
536
+ * @see \Codeception\Module\WebDriver::dontSeeInPageSource()
537
  */
538
+ public function cantSeeInPageSource($text) {
539
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args()));
540
  }
541
  /**
542
  * [!] Method is generated. Documentation taken from corresponding module.
543
  *
544
+ * Checks that the page source doesn't contain the given string.
 
 
 
 
 
 
 
 
545
  *
546
  * @param $text
547
+ * @see \Codeception\Module\WebDriver::dontSeeInPageSource()
 
548
  */
549
+ public function dontSeeInPageSource($text) {
550
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInPageSource', func_get_args()));
551
  }
552
 
553
 
554
  /**
555
  * [!] Method is generated. Documentation taken from corresponding module.
556
  *
557
+ * Perform a click on a link or a button, given by a locator.
558
+ * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
559
+ * For buttons, the "value" attribute, "name" attribute, and inner text are searched.
560
+ * For links, the link text is searched.
561
+ * For images, the "alt" attribute and inner text of any parent links are searched.
562
+ *
563
+ * The second parameter is a context (CSS or XPath locator) to narrow the search.
564
+ *
565
+ * Note that if the locator matches a button of type `submit`, the form will be submitted.
566
  *
567
  * ``` php
568
  * <?php
569
+ * // simple link
570
+ * $I->click('Logout');
571
+ * // button of form
572
+ * $I->click('Submit');
573
+ * // CSS button
574
+ * $I->click('#form input[type=submit]');
575
+ * // XPath
576
+ * $I->click('//form/*[@type=submit]');
577
+ * // link in context
578
+ * $I->click('Logout', '#nav');
579
+ * // using strict locator
580
+ * $I->click(['link' => 'Login']);
581
+ * ?>
582
+ * ```
583
+ *
584
+ * @param $link
585
+ * @param $context
586
+ * @see \Codeception\Module\WebDriver::click()
587
+ */
588
+ public function click($link, $context = null) {
589
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args()));
590
+ }
591
+
592
+
593
+ /**
594
+ * [!] Method is generated. Documentation taken from corresponding module.
595
+ *
596
+ * Checks that there's a link with the specified text.
597
+ * Give a full URL as the second parameter to match links with that exact URL.
598
+ *
599
+ * ``` php
600
+ * <?php
601
+ * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
602
+ * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
603
+ * ?>
604
+ * ```
605
+ *
606
+ * @param $text
607
+ * @param null $url
608
+ * Conditional Assertion: Test won't be stopped on fail
609
+ * @see \Codeception\Module\WebDriver::seeLink()
610
+ */
611
+ public function canSeeLink($text, $url = null) {
612
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
613
+ }
614
+ /**
615
+ * [!] Method is generated. Documentation taken from corresponding module.
616
+ *
617
+ * Checks that there's a link with the specified text.
618
+ * Give a full URL as the second parameter to match links with that exact URL.
619
+ *
620
+ * ``` php
621
+ * <?php
622
+ * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
623
+ * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
624
+ * ?>
625
+ * ```
626
+ *
627
+ * @param $text
628
+ * @param null $url
629
+ * @see \Codeception\Module\WebDriver::seeLink()
630
+ */
631
+ public function seeLink($text, $url = null) {
632
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
633
+ }
634
+
635
+
636
+ /**
637
+ * [!] Method is generated. Documentation taken from corresponding module.
638
+ *
639
+ * Checks that the page doesn't contain a link with the given string.
640
+ * If the second parameter is given, only links with a matching "href" attribute will be checked.
641
+ *
642
+ * ``` php
643
+ * <?php
644
+ * $I->dontSeeLink('Logout'); // I suppose user is not logged in
645
+ * $I->dontSeeLink('Checkout now', '/store/cart.php');
646
+ * ?>
647
+ * ```
648
+ *
649
+ * @param $text
650
+ * @param null $url
651
+ * Conditional Assertion: Test won't be stopped on fail
652
+ * @see \Codeception\Module\WebDriver::dontSeeLink()
653
+ */
654
+ public function cantSeeLink($text, $url = null) {
655
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
656
+ }
657
+ /**
658
+ * [!] Method is generated. Documentation taken from corresponding module.
659
+ *
660
+ * Checks that the page doesn't contain a link with the given string.
661
+ * If the second parameter is given, only links with a matching "href" attribute will be checked.
662
+ *
663
+ * ``` php
664
+ * <?php
665
+ * $I->dontSeeLink('Logout'); // I suppose user is not logged in
666
+ * $I->dontSeeLink('Checkout now', '/store/cart.php');
667
+ * ?>
668
+ * ```
669
+ *
670
+ * @param $text
671
+ * @param null $url
672
+ * @see \Codeception\Module\WebDriver::dontSeeLink()
673
+ */
674
+ public function dontSeeLink($text, $url = null) {
675
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
676
+ }
677
+
678
+
679
+ /**
680
+ * [!] Method is generated. Documentation taken from corresponding module.
681
+ *
682
+ * Checks that current URI contains the given string.
683
+ *
684
+ * ``` php
685
+ * <?php
686
+ * // to match: /home/dashboard
687
+ * $I->seeInCurrentUrl('home');
688
+ * // to match: /users/1
689
+ * $I->seeInCurrentUrl('/users/');
690
  * ?>
691
  * ```
692
  *
693
  * @param $uri
694
  * Conditional Assertion: Test won't be stopped on fail
695
+ * @see \Codeception\Module\WebDriver::seeInCurrentUrl()
696
  */
697
  public function canSeeInCurrentUrl($uri) {
698
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
712
  * ```
713
  *
714
  * @param $uri
715
+ * @see \Codeception\Module\WebDriver::seeInCurrentUrl()
716
  */
717
  public function seeInCurrentUrl($uri) {
718
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
722
  /**
723
  * [!] Method is generated. Documentation taken from corresponding module.
724
  *
725
+ * Checks that the current URL is equal to the given string.
726
+ * Unlike `seeInCurrentUrl`, this only matches the full URL.
727
  *
728
  * ``` php
729
  * <?php
730
+ * // to match root url
731
+ * $I->seeCurrentUrlEquals('/');
732
  * ?>
733
  * ```
734
  *
735
  * @param $uri
736
  * Conditional Assertion: Test won't be stopped on fail
737
+ * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals()
738
  */
739
+ public function canSeeCurrentUrlEquals($uri) {
740
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
741
  }
742
  /**
743
  * [!] Method is generated. Documentation taken from corresponding module.
744
  *
745
+ * Checks that the current URL is equal to the given string.
746
+ * Unlike `seeInCurrentUrl`, this only matches the full URL.
747
  *
748
  * ``` php
749
  * <?php
750
+ * // to match root url
751
+ * $I->seeCurrentUrlEquals('/');
752
  * ?>
753
  * ```
754
  *
755
  * @param $uri
756
+ * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals()
757
  */
758
+ public function seeCurrentUrlEquals($uri) {
759
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
760
  }
761
 
762
 
763
  /**
764
  * [!] Method is generated. Documentation taken from corresponding module.
765
  *
766
+ * Checks that the current URL matches the given regular expression.
 
767
  *
768
  * ``` php
769
  * <?php
770
  * // to match root url
771
+ * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
772
  * ?>
773
  * ```
774
  *
775
  * @param $uri
776
  * Conditional Assertion: Test won't be stopped on fail
777
+ * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches()
778
  */
779
+ public function canSeeCurrentUrlMatches($uri) {
780
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
781
  }
782
  /**
783
  * [!] Method is generated. Documentation taken from corresponding module.
784
  *
785
+ * Checks that the current URL matches the given regular expression.
 
786
  *
787
  * ``` php
788
  * <?php
789
  * // to match root url
790
+ * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
791
  * ?>
792
  * ```
793
  *
794
  * @param $uri
795
+ * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches()
796
  */
797
+ public function seeCurrentUrlMatches($uri) {
798
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
799
  }
800
 
801
 
802
  /**
803
  * [!] Method is generated. Documentation taken from corresponding module.
804
  *
805
+ * Checks that the current URI doesn't contain the given string.
 
806
  *
807
  * ``` php
808
  * <?php
809
+ * $I->dontSeeInCurrentUrl('/users/');
 
810
  * ?>
811
  * ```
812
  *
813
  * @param $uri
814
  * Conditional Assertion: Test won't be stopped on fail
815
+ * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl()
816
  */
817
+ public function cantSeeInCurrentUrl($uri) {
818
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
819
  }
820
  /**
821
  * [!] Method is generated. Documentation taken from corresponding module.
822
  *
823
+ * Checks that the current URI doesn't contain the given string.
 
824
  *
825
  * ``` php
826
  * <?php
827
+ * $I->dontSeeInCurrentUrl('/users/');
 
828
  * ?>
829
  * ```
830
  *
831
  * @param $uri
832
+ * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl()
833
  */
834
+ public function dontSeeInCurrentUrl($uri) {
835
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
836
  }
837
 
838
 
839
  /**
840
  * [!] Method is generated. Documentation taken from corresponding module.
841
  *
842
+ * Checks that the current URL doesn't equal the given string.
843
+ * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
844
  *
845
  * ``` php
846
  * <?php
847
+ * // current url is not root
848
+ * $I->dontSeeCurrentUrlEquals('/');
849
  * ?>
850
  * ```
851
  *
852
  * @param $uri
853
  * Conditional Assertion: Test won't be stopped on fail
854
+ * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals()
855
  */
856
+ public function cantSeeCurrentUrlEquals($uri) {
857
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
858
  }
859
  /**
860
  * [!] Method is generated. Documentation taken from corresponding module.
861
  *
862
+ * Checks that the current URL doesn't equal the given string.
863
+ * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
864
  *
865
  * ``` php
866
  * <?php
867
+ * // current url is not root
868
+ * $I->dontSeeCurrentUrlEquals('/');
869
  * ?>
870
  * ```
871
  *
872
  * @param $uri
873
+ * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals()
874
  */
875
+ public function dontSeeCurrentUrlEquals($uri) {
876
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
877
  }
878
 
879
 
891
  *
892
  * @param $uri
893
  * Conditional Assertion: Test won't be stopped on fail
894
+ * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches()
895
  */
896
  public function cantSeeCurrentUrlMatches($uri) {
897
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
909
  * ```
910
  *
911
  * @param $uri
912
+ * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches()
913
  */
914
  public function dontSeeCurrentUrlMatches($uri) {
915
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
932
  * @param null $uri
933
  *
934
  * @return mixed
935
+ * @see \Codeception\Module\WebDriver::grabFromCurrentUrl()
936
  */
937
  public function grabFromCurrentUrl($uri = null) {
938
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
954
  *
955
  * @param $checkbox
956
  * Conditional Assertion: Test won't be stopped on fail
957
+ * @see \Codeception\Module\WebDriver::seeCheckboxIsChecked()
958
  */
959
  public function canSeeCheckboxIsChecked($checkbox) {
960
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
973
  * ```
974
  *
975
  * @param $checkbox
976
+ * @see \Codeception\Module\WebDriver::seeCheckboxIsChecked()
977
  */
978
  public function seeCheckboxIsChecked($checkbox) {
979
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
994
  *
995
  * @param $checkbox
996
  * Conditional Assertion: Test won't be stopped on fail
997
+ * @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked()
998
  */
999
  public function cantSeeCheckboxIsChecked($checkbox) {
1000
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
1012
  * ```
1013
  *
1014
  * @param $checkbox
1015
+ * @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked()
1016
  */
1017
  public function dontSeeCheckboxIsChecked($checkbox) {
1018
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
1039
  * @param $field
1040
  * @param $value
1041
  * Conditional Assertion: Test won't be stopped on fail
1042
+ * @see \Codeception\Module\WebDriver::seeInField()
1043
  */
1044
  public function canSeeInField($field, $value) {
1045
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
1063
  *
1064
  * @param $field
1065
  * @param $value
1066
+ * @see \Codeception\Module\WebDriver::seeInField()
1067
  */
1068
  public function seeInField($field, $value) {
1069
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
1090
  * @param $field
1091
  * @param $value
1092
  * Conditional Assertion: Test won't be stopped on fail
1093
+ * @see \Codeception\Module\WebDriver::dontSeeInField()
1094
  */
1095
  public function cantSeeInField($field, $value) {
1096
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
1114
  *
1115
  * @param $field
1116
  * @param $value
1117
+ * @see \Codeception\Module\WebDriver::dontSeeInField()
1118
  */
1119
  public function dontSeeInField($field, $value) {
1120
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
1184
  * @param $formSelector
1185
  * @param $params
1186
  * Conditional Assertion: Test won't be stopped on fail
1187
+ * @see \Codeception\Module\WebDriver::seeInFormFields()
1188
  */
1189
  public function canSeeInFormFields($formSelector, $params) {
1190
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
1251
  *
1252
  * @param $formSelector
1253
  * @param $params
1254
+ * @see \Codeception\Module\WebDriver::seeInFormFields()
1255
  */
1256
  public function seeInFormFields($formSelector, $params) {
1257
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
1301
  * @param $formSelector
1302
  * @param $params
1303
  * Conditional Assertion: Test won't be stopped on fail
1304
+ * @see \Codeception\Module\WebDriver::dontSeeInFormFields()
1305
  */
1306
  public function cantSeeInFormFields($formSelector, $params) {
1307
  return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
1348
  *
1349
  * @param $formSelector
1350
  * @param $params
1351
+ * @see \Codeception\Module\WebDriver::dontSeeInFormFields()
1352
  */
1353
  public function dontSeeInFormFields($formSelector, $params) {
1354
  return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args()));
1358
  /**
1359
  * [!] Method is generated. Documentation taken from corresponding module.
1360
  *
1361
+ * Selects an option in a select tag or in radio button group.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1362
  *
1363
  * ``` php
1364
  * <?php
1365
+ * $I->selectOption('form select[name=account]', 'Premium');
1366
+ * $I->selectOption('form input[name=payment]', 'Monthly');
1367
+ * $I->selectOption('//form/select[@name=account]', 'Monthly');
1368
+ * ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1369
  * ```
1370
  *
1371
+ * Provide an array for the second argument to select multiple options:
1372
  *
1373
  * ``` php
1374
  * <?php
1375
+ * $I->selectOption('Which OS do you use?', array('Windows','Linux'));
1376
+ * ?>
 
 
 
 
 
 
 
 
 
1377
  * ```
 
 
1378
  *
1379
+ * Or provide an associative array for the second argument to specifically define which selection method should be used:
 
1380
  *
1381
+ * ``` php
1382
  * <?php
1383
+ * $I->selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows'
1384
+ * $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1385
  * ?>
1386
+ + ```
1387
  *
1388
+ * @param $select
1389
+ * @param $option
1390
+ * @see \Codeception\Module\WebDriver::selectOption()
1391
  */
1392
+ public function selectOption($select, $option) {
1393
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
1394
  }
1395
 
1396
 
1397
  /**
1398
  * [!] Method is generated. Documentation taken from corresponding module.
1399
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1400
  *
1401
+ * @see \Codeception\Module\WebDriver::unselectOption()
 
 
1402
  */
1403
+ public function unselectOption($select, $option) {
1404
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('unselectOption', func_get_args()));
1405
  }
1406
 
1407
 
1417
  * ```
1418
  *
1419
  * @param $option
1420
+ * @see \Codeception\Module\WebDriver::checkOption()
1421
  */
1422
  public function checkOption($option) {
1423
  return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
1436
  * ```
1437
  *
1438
  * @param $option
1439
+ * @see \Codeception\Module\WebDriver::uncheckOption()
1440
  */
1441
  public function uncheckOption($option) {
1442
  return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
1446
  /**
1447
  * [!] Method is generated. Documentation taken from corresponding module.
1448
  *
1449
+ * Fills a text field or textarea with the given string.
1450
  *
1451
  * ``` php
1452
  * <?php
1453
+ * $I->fillField("//input[@type='text']", "Hello World!");
1454
+ * $I->fillField(['name' => 'email'], 'jon@mail.com');
1455
  * ?>
1456
  * ```
1457
  *
1458
  * @param $field
1459
+ * @param $value
1460
+ * @see \Codeception\Module\WebDriver::fillField()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1461
  */
1462
+ public function fillField($field, $value) {
1463
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
1464
  }
1465
 
1466
 
1467
  /**
1468
  * [!] Method is generated. Documentation taken from corresponding module.
1469
  *
1470
+ * Attaches a file relative to the Codeception data directory to the given file upload field.
 
 
 
 
 
 
 
1471
  *
1472
  * ``` php
1473
  * <?php
1474
+ * // file is stored in 'tests/_data/prices.xls'
1475
+ * $I->attachFile('input[@type="file"]', 'prices.xls');
1476
+ * ?>
1477
  * ```
1478
  *
1479
+ * @param $field
1480
+ * @param $filename
1481
+ * @see \Codeception\Module\WebDriver::attachFile()
1482
  */
1483
+ public function attachFile($field, $filename) {
1484
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
1485
  }
1486
 
1487
 
1488
  /**
1489
  * [!] Method is generated. Documentation taken from corresponding module.
1490
  *
1491
+ * Grabs all visible text from the current page.
 
 
 
 
 
 
 
 
 
 
 
1492
  *
1493
+ * @return string
1494
+ * @see \Codeception\Module\WebDriver::getVisibleText()
 
 
1495
  */
1496
+ public function getVisibleText() {
1497
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('getVisibleText', func_get_args()));
1498
  }
1499
 
1500
 
1516
  * @param $cssOrXPathOrRegex
1517
  *
1518
  * @return mixed
1519
+ * @see \Codeception\Module\WebDriver::grabTextFrom()
1520
  */
1521
  public function grabTextFrom($cssOrXPathOrRegex) {
1522
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
1540
  * @param $attribute
1541
  *
1542
  * @return mixed
1543
+ * @see \Codeception\Module\WebDriver::grabAttributeFrom()
1544
  */
1545
  public function grabAttributeFrom($cssOrXpath, $attribute) {
1546
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
1547
  }
1548
 
1549
 
1550
+ /**
1551
+ * [!] Method is generated. Documentation taken from corresponding module.
1552
+ *
1553
+ * Finds the value for the given form field.
1554
+ * If a fuzzy locator is used, the field is found by field name, CSS, and XPath.
1555
+ *
1556
+ * ``` php
1557
+ * <?php
1558
+ * $name = $I->grabValueFrom('Name');
1559
+ * $name = $I->grabValueFrom('input[name=username]');
1560
+ * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
1561
+ * $name = $I->grabValueFrom(['name' => 'username']);
1562
+ * ?>
1563
+ * ```
1564
+ *
1565
+ * @param $field
1566
+ *
1567
+ * @return mixed
1568
+ * @see \Codeception\Module\WebDriver::grabValueFrom()
1569
+ */
1570
+ public function grabValueFrom($field) {
1571
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
1572
+ }
1573
+
1574
+
1575
  /**
1576
  * [!] Method is generated. Documentation taken from corresponding module.
1577
  *
1597
  * @param $cssOrXpath
1598
  * @param $attribute
1599
  * @return string[]
1600
+ * @see \Codeception\Module\WebDriver::grabMultiple()
1601
  */
1602
  public function grabMultiple($cssOrXpath, $attribute = null) {
1603
  return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args()));
1607
  /**
1608
  * [!] Method is generated. Documentation taken from corresponding module.
1609
  *
1610
+ * Checks that the given element exists on the page and is visible.
1611
+ * You can also specify expected attributes of this element.
 
 
 
 
 
 
 
 
 
 
 
 
 
1612
  *
1613
  * ``` php
1614
  * <?php
1615
+ * $I->seeElement('.error');
1616
+ * $I->seeElement('//form/input[1]');
1617
+ * $I->seeElement('input', ['name' => 'login']);
1618
+ * $I->seeElement('input', ['value' => '123456']);
1619
+ *
1620
+ * // strict locator in first arg, attributes in second
1621
+ * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
1622
  * ?>
1623
  * ```
1624
  *
1625
+ * @param $selector
1626
+ * @param array $attributes
1627
+ * @return
1628
+ * Conditional Assertion: Test won't be stopped on fail
1629
+ * @see \Codeception\Module\WebDriver::seeElement()
 
1630
  */
1631
+ public function canSeeElement($selector, $attributes = null) {
1632
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
1633
  }
 
 
1634
  /**
1635
  * [!] Method is generated. Documentation taken from corresponding module.
1636
  *
1637
+ * Checks that the given element exists on the page and is visible.
1638
+ * You can also specify expected attributes of this element.
1639
  *
1640
+ * ``` php
1641
+ * <?php
1642
+ * $I->seeElement('.error');
1643
+ * $I->seeElement('//form/input[1]');
1644
+ * $I->seeElement('input', ['name' => 'login']);
1645
+ * $I->seeElement('input', ['value' => '123456']);
1646
  *
1647
+ * // strict locator in first arg, attributes in second
1648
+ * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
1649
+ * ?>
1650
+ * ```
1651
+ *
1652
+ * @param $selector
1653
+ * @param array $attributes
1654
+ * @return
1655
+ * @see \Codeception\Module\WebDriver::seeElement()
1656
  */
1657
+ public function seeElement($selector, $attributes = null) {
1658
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
1659
  }
1660
 
1661
 
1662
  /**
1663
  * [!] Method is generated. Documentation taken from corresponding module.
1664
  *
1665
+ * Checks that the given element is invisible or not present on the page.
1666
+ * You can also specify expected attributes of this element.
1667
  *
1668
  * ``` php
1669
  * <?php
1670
+ * $I->dontSeeElement('.error');
1671
+ * $I->dontSeeElement('//form/input[1]');
1672
+ * $I->dontSeeElement('input', ['name' => 'login']);
1673
+ * $I->dontSeeElement('input', ['value' => '123456']);
1674
+ * ?>
1675
+ * ```
1676
  *
1677
+ * @param $selector
1678
+ * @param array $attributes
 
1679
  * Conditional Assertion: Test won't be stopped on fail
1680
+ * @see \Codeception\Module\WebDriver::dontSeeElement()
1681
  */
1682
+ public function cantSeeElement($selector, $attributes = null) {
1683
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
1684
  }
1685
  /**
1686
  * [!] Method is generated. Documentation taken from corresponding module.
1687
  *
1688
+ * Checks that the given element is invisible or not present on the page.
1689
+ * You can also specify expected attributes of this element.
1690
  *
1691
  * ``` php
1692
  * <?php
1693
+ * $I->dontSeeElement('.error');
1694
+ * $I->dontSeeElement('//form/input[1]');
1695
+ * $I->dontSeeElement('input', ['name' => 'login']);
1696
+ * $I->dontSeeElement('input', ['value' => '123456']);
1697
  * ?>
1698
  * ```
1699
  *
1700
+ * @param $selector
1701
+ * @param array $attributes
1702
+ * @see \Codeception\Module\WebDriver::dontSeeElement()
 
1703
  */
1704
+ public function dontSeeElement($selector, $attributes = null) {
1705
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
1706
  }
1707
 
1708
 
1709
  /**
1710
  * [!] Method is generated. Documentation taken from corresponding module.
1711
  *
1712
+ * Checks that the given element exists on the page, even it is invisible.
 
1713
  *
1714
+ * ``` php
1715
+ * <?php
1716
+ * $I->seeElementInDOM('//form/input[type=hidden]');
1717
+ * ?>
1718
+ * ```
1719
  *
1720
+ * @param $selector
 
1721
  * Conditional Assertion: Test won't be stopped on fail
1722
+ * @see \Codeception\Module\WebDriver::seeElementInDOM()
1723
  */
1724
+ public function canSeeElementInDOM($selector, $attributes = null) {
1725
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args()));
1726
  }
1727
  /**
1728
  * [!] Method is generated. Documentation taken from corresponding module.
1729
  *
1730
+ * Checks that the given element exists on the page, even it is invisible.
 
1731
  *
1732
+ * ``` php
1733
+ * <?php
1734
+ * $I->seeElementInDOM('//form/input[type=hidden]');
1735
+ * ?>
1736
+ * ```
1737
  *
1738
+ * @param $selector
1739
+ * @see \Codeception\Module\WebDriver::seeElementInDOM()
 
1740
  */
1741
+ public function seeElementInDOM($selector, $attributes = null) {
1742
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args()));
1743
  }
1744
 
1745
 
1746
  /**
1747
  * [!] Method is generated. Documentation taken from corresponding module.
1748
  *
1749
+ * Opposite of `seeElementInDOM`.
 
1750
  *
1751
+ * @param $selector
1752
+ * Conditional Assertion: Test won't be stopped on fail
1753
+ * @see \Codeception\Module\WebDriver::dontSeeElementInDOM()
1754
+ */
1755
+ public function cantSeeElementInDOM($selector, $attributes = null) {
1756
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args()));
1757
+ }
1758
+ /**
1759
+ * [!] Method is generated. Documentation taken from corresponding module.
1760
  *
1761
+ * Opposite of `seeElementInDOM`.
1762
+ *
1763
+ * @param $selector
1764
+ * @see \Codeception\Module\WebDriver::dontSeeElementInDOM()
1765
  */
1766
+ public function dontSeeElementInDOM($selector, $attributes = null) {
1767
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElementInDOM', func_get_args()));
1768
  }
1769
 
1770
 
1771
  /**
1772
  * [!] Method is generated. Documentation taken from corresponding module.
1773
  *
1774
+ * Checks that there are a certain number of elements matched by the given locator on the page.
 
1775
  *
1776
  * ``` php
1777
  * <?php
1778
+ * $I->seeNumberOfElements('tr', 10);
1779
+ * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
1780
+ * ?>
1781
+ * ```
1782
+ * @param $selector
1783
+ * @param mixed $expected :
1784
+ * - string: strict number
1785
+ * - array: range of numbers [0,10]
1786
+ * Conditional Assertion: Test won't be stopped on fail
1787
+ * @see \Codeception\Module\WebDriver::seeNumberOfElements()
1788
+ */
1789
+ public function canSeeNumberOfElements($selector, $expected) {
1790
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
1791
+ }
1792
+ /**
1793
+ * [!] Method is generated. Documentation taken from corresponding module.
1794
  *
1795
+ * Checks that there are a certain number of elements matched by the given locator on the page.
1796
+ *
1797
+ * ``` php
1798
+ * <?php
1799
+ * $I->seeNumberOfElements('tr', 10);
1800
+ * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
1801
+ * ?>
1802
+ * ```
1803
+ * @param $selector
1804
+ * @param mixed $expected :
1805
+ * - string: strict number
1806
+ * - array: range of numbers [0,10]
1807
+ * @see \Codeception\Module\WebDriver::seeNumberOfElements()
1808
+ */
1809
+ public function seeNumberOfElements($selector, $expected) {
1810
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
1811
+ }
1812
+
1813
+
1814
+ /**
1815
+ * [!] Method is generated. Documentation taken from corresponding module.
1816
+ *
1817
+ *
1818
+ * Conditional Assertion: Test won't be stopped on fail
1819
+ * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM()
1820
+ */
1821
+ public function canSeeNumberOfElementsInDOM($selector, $expected) {
1822
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElementsInDOM', func_get_args()));
1823
+ }
1824
+ /**
1825
+ * [!] Method is generated. Documentation taken from corresponding module.
1826
+ *
1827
+ *
1828
+ * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM()
1829
+ */
1830
+ public function seeNumberOfElementsInDOM($selector, $expected) {
1831
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElementsInDOM', func_get_args()));
1832
+ }
1833
+
1834
+
1835
+ /**
1836
+ * [!] Method is generated. Documentation taken from corresponding module.
1837
+ *
1838
+ * Checks that the given option is selected.
1839
+ *
1840
+ * ``` php
1841
+ * <?php
1842
+ * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
1843
  * ?>
1844
  * ```
1845
  *
1846
  * @param $selector
1847
+ * @param $optionText
1848
+ *
1849
+ * @return mixed
1850
  * Conditional Assertion: Test won't be stopped on fail
1851
+ * @see \Codeception\Module\WebDriver::seeOptionIsSelected()
1852
  */
1853
+ public function canSeeOptionIsSelected($selector, $optionText) {
1854
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
1855
  }
1856
  /**
1857
  * [!] Method is generated. Documentation taken from corresponding module.
1858
  *
1859
+ * Checks that the given option is selected.
 
1860
  *
1861
  * ``` php
1862
  * <?php
1863
+ * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
1864
+ * ?>
1865
+ * ```
 
1866
  *
1867
+ * @param $selector
1868
+ * @param $optionText
1869
+ *
1870
+ * @return mixed
1871
+ * @see \Codeception\Module\WebDriver::seeOptionIsSelected()
1872
+ */
1873
+ public function seeOptionIsSelected($selector, $optionText) {
1874
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
1875
+ }
1876
+
1877
+
1878
+ /**
1879
+ * [!] Method is generated. Documentation taken from corresponding module.
1880
+ *
1881
+ * Checks that the given option is not selected.
1882
+ *
1883
+ * ``` php
1884
+ * <?php
1885
+ * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
1886
  * ?>
1887
  * ```
1888
  *
1889
  * @param $selector
1890
+ * @param $optionText
1891
+ *
1892
+ * @return mixed
1893
+ * Conditional Assertion: Test won't be stopped on fail
1894
+ * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected()
1895
  */
1896
+ public function cantSeeOptionIsSelected($selector, $optionText) {
1897
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
1898
+ }
1899
+ /**
1900
+ * [!] Method is generated. Documentation taken from corresponding module.
1901
+ *
1902
+ * Checks that the given option is not selected.
1903
+ *
1904
+ * ``` php
1905
+ * <?php
1906
+ * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
1907
+ * ?>
1908
+ * ```
1909
+ *
1910
+ * @param $selector
1911
+ * @param $optionText
1912
+ *
1913
+ * @return mixed
1914
+ * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected()
1915
+ */
1916
+ public function dontSeeOptionIsSelected($selector, $optionText) {
1917
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
1918
  }
1919
 
1920
 
1921
  /**
1922
  * [!] Method is generated. Documentation taken from corresponding module.
1923
  *
1924
+ * Checks that the page title contains the given string.
1925
+ *
1926
+ * ``` php
1927
+ * <?php
1928
+ * $I->seeInTitle('Blog - Post #1');
1929
+ * ?>
1930
+ * ```
1931
+ *
1932
+ * @param $title
1933
+ *
1934
+ * @return mixed
1935
+ * Conditional Assertion: Test won't be stopped on fail
1936
+ * @see \Codeception\Module\WebDriver::seeInTitle()
1937
+ */
1938
+ public function canSeeInTitle($title) {
1939
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
1940
+ }
1941
+ /**
1942
+ * [!] Method is generated. Documentation taken from corresponding module.
1943
+ *
1944
+ * Checks that the page title contains the given string.
1945
+ *
1946
+ * ``` php
1947
+ * <?php
1948
+ * $I->seeInTitle('Blog - Post #1');
1949
+ * ?>
1950
+ * ```
1951
+ *
1952
+ * @param $title
1953
+ *
1954
+ * @return mixed
1955
+ * @see \Codeception\Module\WebDriver::seeInTitle()
1956
+ */
1957
+ public function seeInTitle($title) {
1958
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
1959
+ }
1960
+
1961
+
1962
+ /**
1963
+ * [!] Method is generated. Documentation taken from corresponding module.
1964
+ *
1965
+ * Checks that the page title does not contain the given string.
1966
+ *
1967
+ * @param $title
1968
+ *
1969
+ * @return mixed
1970
+ * Conditional Assertion: Test won't be stopped on fail
1971
+ * @see \Codeception\Module\WebDriver::dontSeeInTitle()
1972
+ */
1973
+ public function cantSeeInTitle($title) {
1974
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
1975
+ }
1976
+ /**
1977
+ * [!] Method is generated. Documentation taken from corresponding module.
1978
+ *
1979
+ * Checks that the page title does not contain the given string.
1980
+ *
1981
+ * @param $title
1982
+ *
1983
+ * @return mixed
1984
+ * @see \Codeception\Module\WebDriver::dontSeeInTitle()
1985
+ */
1986
+ public function dontSeeInTitle($title) {
1987
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
1988
+ }
1989
+
1990
+
1991
+ /**
1992
+ * [!] Method is generated. Documentation taken from corresponding module.
1993
+ *
1994
+ * Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`.
1995
+ * Don't confuse popups with modal windows,
1996
+ * as created by [various libraries](http://jster.net/category/windows-modals-popups).
1997
+ * @see \Codeception\Module\WebDriver::acceptPopup()
1998
+ */
1999
+ public function acceptPopup() {
2000
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('acceptPopup', func_get_args()));
2001
+ }
2002
+
2003
+
2004
+ /**
2005
+ * [!] Method is generated. Documentation taken from corresponding module.
2006
+ *
2007
+ * Dismisses the active JavaScript popup, as created by `window.alert`|`window.confirm`|`window.prompt`.
2008
+ * @see \Codeception\Module\WebDriver::cancelPopup()
2009
+ */
2010
+ public function cancelPopup() {
2011
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('cancelPopup', func_get_args()));
2012
+ }
2013
+
2014
+
2015
+ /**
2016
+ * [!] Method is generated. Documentation taken from corresponding module.
2017
+ *
2018
+ * Checks that the active JavaScript popup,
2019
+ * as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
2020
+ *
2021
+ * @param $text
2022
+ * Conditional Assertion: Test won't be stopped on fail
2023
+ * @see \Codeception\Module\WebDriver::seeInPopup()
2024
+ */
2025
+ public function canSeeInPopup($text) {
2026
+ return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args()));
2027
+ }
2028
+ /**
2029
+ * [!] Method is generated. Documentation taken from corresponding module.
2030
+ *
2031
+ * Checks that the active JavaScript popup,
2032
+ * as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
2033
+ *
2034
+ * @param $text
2035
+ * @see \Codeception\Module\WebDriver::seeInPopup()
2036
+ */
2037
+ public function seeInPopup($text) {
2038
+ return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args()));
2039
+ }
2040
+
2041
+
2042
+ /**
2043
+ * [!] Method is generated. Documentation taken from corresponding module.
2044
+ *
2045
+ * Enters text into a native JavaScript prompt popup, as created by `window.prompt`.
2046
+ *
2047
+ * @param $keys
2048
+ * @see \Codeception\Module\WebDriver::typeInPopup()
2049
+ */
2050
+ public function typeInPopup($keys) {
2051
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('typeInPopup', func_get_args()));
2052
+ }
2053
+
2054
+
2055
+ /**
2056
+ * [!] Method is generated. Documentation taken from corresponding module.
2057
+ *
2058
+ * Reloads the current page.
2059
+ * @see \Codeception\Module\WebDriver::reloadPage()
2060
+ */
2061
+ public function reloadPage() {
2062
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('reloadPage', func_get_args()));
2063
+ }
2064
+
2065
+
2066
+ /**
2067
+ * [!] Method is generated. Documentation taken from corresponding module.
2068
+ *
2069
+ * Moves back in history.
2070
+ * @see \Codeception\Module\WebDriver::moveBack()
2071
+ */
2072
+ public function moveBack() {
2073
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args()));
2074
+ }
2075
+
2076
+
2077
+ /**
2078
+ * [!] Method is generated. Documentation taken from corresponding module.
2079
+ *
2080
+ * Moves forward in history.
2081
+ * @see \Codeception\Module\WebDriver::moveForward()
2082
+ */
2083
+ public function moveForward() {
2084
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('moveForward', func_get_args()));
2085
+ }
2086
+
2087
+
2088
+ /**
2089
+ * [!] Method is generated. Documentation taken from corresponding module.
2090
+ *
2091
+ * Submits the given form on the page, optionally with the given form
2092
+ * values. Give the form fields values as an array. Note that hidden fields
2093
+ * can't be accessed.
2094
+ *
2095
+ * Skipped fields will be filled by their values from the page.
2096
+ * You don't need to click the 'Submit' button afterwards.
2097
+ * This command itself triggers the request to form's action.
2098
+ *
2099
+ * You can optionally specify what button's value to include
2100
+ * in the request with the last parameter as an alternative to
2101
+ * explicitly setting its value in the second parameter, as
2102
+ * button values are not otherwise included in the request.
2103
+ *
2104
+ * Examples:
2105
+ *
2106
+ * ``` php
2107
+ * <?php
2108
+ * $I->submitForm('#login', [
2109
+ * 'login' => 'davert',
2110
+ * 'password' => '123456'
2111
+ * ]);
2112
+ * // or
2113
+ * $I->submitForm('#login', [
2114
+ * 'login' => 'davert',
2115
+ * 'password' => '123456'
2116
+ * ], 'submitButtonName');
2117
+ *
2118
+ * ```
2119
+ *
2120
+ * For example, given this sample "Sign Up" form:
2121
+ *
2122
+ * ``` html
2123
+ * <form action="/sign_up">
2124
+ * Login:
2125
+ * <input type="text" name="user[login]" /><br/>
2126
+ * Password:
2127
+ * <input type="password" name="user[password]" /><br/>
2128
+ * Do you agree to our terms?
2129
+ * <input type="checkbox" name="user[agree]" /><br/>
2130
+ * Select pricing plan:
2131
+ * <select name="plan">
2132
+ * <option value="1">Free</option>
2133
+ * <option value="2" selected="selected">Paid</option>
2134
+ * </select>
2135
+ * <input type="submit" name="submitButton" value="Submit" />
2136
+ * </form>
2137
+ * ```
2138
+ *
2139
+ * You could write the following to submit it:
2140
+ *
2141
+ * ``` php
2142
+ * <?php
2143
+ * $I->submitForm(
2144
+ * '#userForm',
2145
+ * [
2146
+ * 'user[login]' => 'Davert',
2147
+ * 'user[password]' => '123456',
2148
+ * 'user[agree]' => true
2149
+ * ],
2150
+ * 'submitButton'
2151
+ * );
2152
+ * ```
2153
+ * Note that "2" will be the submitted value for the "plan" field, as it is
2154
+ * the selected option.
2155
+ *
2156
+ * Also note that this differs from PhpBrowser, in that
2157
+ * ```'user' => [ 'login' => 'Davert' ]``` is not supported at the moment.
2158
+ * Named array keys *must* be included in the name as above.
2159
+ *
2160
+ * Pair this with seeInFormFields for quick testing magic.
2161
+ *
2162
+ * ``` php
2163
+ * <?php
2164
+ * $form = [
2165
+ * 'field1' => 'value',
2166
+ * 'field2' => 'another value',
2167
+ * 'checkbox1' => true,
2168
+ * // ...
2169
+ * ];
2170
+ * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
2171
+ * // $I->amOnPage('/path/to/form-page') may be needed
2172
+ * $I->seeInFormFields('//form[@id=my-form]', $form);
2173
+ * ?>
2174
+ * ```
2175
+ *
2176
+ * Parameter values must be set to arrays for multiple input fields
2177
+ * of the same name, or multi-select combo boxes. For checkboxes,
2178
+ * either the string value can be used, or boolean values which will
2179
+ * be replaced by the checkbox's value in the DOM.
2180
+ *
2181
+ * ``` php
2182
+ * <?php
2183
+ * $I->submitForm('#my-form', [
2184
+ * 'field1' => 'value',
2185
+ * 'checkbox' => [
2186
+ * 'value of first checkbox',
2187
+ * 'value of second checkbox,
2188
+ * ],
2189
+ * 'otherCheckboxes' => [
2190
+ * true,
2191
+ * false,
2192
+ * false
2193
+ * ],
2194
+ * 'multiselect' => [
2195
+ * 'first option value',
2196
+ * 'second option value'
2197
+ * ]
2198
+ * ]);
2199
+ * ?>
2200
+ * ```
2201
+ *
2202
+ * Mixing string and boolean values for a checkbox's value is not supported
2203
+ * and may produce unexpected results.
2204
+ *
2205
+ * Field names ending in "[]" must be passed without the trailing square
2206
+ * bracket characters, and must contain an array for its value. This allows
2207
+ * submitting multiple values with the same name, consider:
2208
+ *
2209
+ * ```php
2210
+ * $I->submitForm('#my-form', [
2211
+ * 'field[]' => 'value',
2212
+ * 'field[]' => 'another value', // 'field[]' is already a defined key
2213
+ * ]);
2214
+ * ```
2215
+ *
2216
+ * The solution is to pass an array value:
2217
+ *
2218
+ * ```php
2219
+ * // this way both values are submitted
2220
+ * $I->submitForm('#my-form', [
2221
+ * 'field' => [
2222
+ * 'value',
2223
+ * 'another value',
2224
+ * ]
2225
+ * ]);
2226
+ * ```
2227
+ *
2228
+ * The `$button` parameter can be either a string, an array or an instance
2229
+ * of Facebook\WebDriver\WebDriverBy. When it is a string, the
2230
+ * button will be found by its "name" attribute. If $button is an
2231
+ * array then it will be treated as a strict selector and a WebDriverBy
2232
+ * will be used verbatim.
2233
  *
2234
+ * For example, given the following HTML:
2235
+ *
2236
+ * ``` html
2237
+ * <input type="submit" name="submitButton" value="Submit" />
 
 
 
2238
  * ```
2239
  *
2240
+ * `$button` could be any one of the following:
2241
+ * - 'submitButton'
2242
+ * - ['name' => 'submitButton']
2243
+ * - WebDriverBy::name('submitButton')
2244
+ *
2245
  * @param $selector
2246
+ * @param $params
2247
+ * @param $button
2248
+ * @see \Codeception\Module\WebDriver::submitForm()
2249
  */
2250
+ public function submitForm($selector, $params, $button = null) {
2251
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
2252
  }
2253
+
2254
+
2255
  /**
2256
  * [!] Method is generated. Documentation taken from corresponding module.
2257
  *
2258
+ * Waits up to $timeout seconds for the given element to change.
2259
+ * Element "change" is determined by a callback function which is called repeatedly
2260
+ * until the return value evaluates to true.
2261
  *
2262
  * ``` php
2263
  * <?php
2264
+ * use \Facebook\WebDriver\WebDriverElement
2265
+ * $I->waitForElementChange('#menu', function(WebDriverElement $el) {
2266
+ * return $el->isDisplayed();
2267
+ * }, 100);
2268
  * ?>
2269
  * ```
2270
  *
2271
+ * @param $element
2272
+ * @param \Closure $callback
2273
+ * @param int $timeout seconds
2274
+ * @throws \Codeception\Exception\ElementNotFound
2275
+ * @see \Codeception\Module\WebDriver::waitForElementChange()
2276
  */
2277
+ public function waitForElementChange($element, $callback, $timeout = null) {
2278
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementChange', func_get_args()));
2279
  }
2280
 
2281
 
2282
  /**
2283
  * [!] Method is generated. Documentation taken from corresponding module.
2284
  *
2285
+ * Waits up to $timeout seconds for an element to appear on the page.
2286
+ * If the element doesn't appear, a timeout exception is thrown.
2287
  *
2288
  * ``` php
2289
  * <?php
2290
+ * $I->waitForElement('#agree_button', 30); // secs
2291
+ * $I->click('#agree_button');
2292
  * ?>
2293
  * ```
2294
+ *
2295
+ * @param $element
2296
+ * @param int $timeout seconds
2297
+ * @throws \Exception
2298
+ * @see \Codeception\Module\WebDriver::waitForElement()
 
2299
  */
2300
+ public function waitForElement($element, $timeout = null) {
2301
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElement', func_get_args()));
2302
  }
2303
+
2304
+
2305
  /**
2306
  * [!] Method is generated. Documentation taken from corresponding module.
2307
  *
2308
+ * Waits up to $timeout seconds for the given element to be visible on the page.
2309
+ * If element doesn't appear, a timeout exception is thrown.
2310
  *
2311
  * ``` php
2312
  * <?php
2313
+ * $I->waitForElementVisible('#agree_button', 30); // secs
2314
+ * $I->click('#agree_button');
2315
  * ?>
2316
  * ```
2317
+ *
2318
+ * @param $element
2319
+ * @param int $timeout seconds
2320
+ * @throws \Exception
2321
+ * @see \Codeception\Module\WebDriver::waitForElementVisible()
2322
  */
2323
+ public function waitForElementVisible($element, $timeout = null) {
2324
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementVisible', func_get_args()));
2325
  }
2326
 
2327
 
2328
  /**
2329
  * [!] Method is generated. Documentation taken from corresponding module.
2330
  *
2331
+ * Waits up to $timeout seconds for the given element to become invisible.
2332
+ * If element stays visible, a timeout exception is thrown.
2333
  *
2334
  * ``` php
2335
  * <?php
2336
+ * $I->waitForElementNotVisible('#agree_button', 30); // secs
2337
  * ?>
2338
  * ```
2339
  *
2340
+ * @param $element
2341
+ * @param int $timeout seconds
2342
+ * @throws \Exception
2343
+ * @see \Codeception\Module\WebDriver::waitForElementNotVisible()
 
 
2344
  */
2345
+ public function waitForElementNotVisible($element, $timeout = null) {
2346
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementNotVisible', func_get_args()));
2347
  }
2348
+
2349
+
2350
  /**
2351
  * [!] Method is generated. Documentation taken from corresponding module.
2352
  *
2353
+ * Waits up to $timeout seconds for the given string to appear on the page.
2354
+ * Can also be passed a selector to search in.
2355
+ * If the given text doesn't appear, a timeout exception is thrown.
2356
  *
2357
  * ``` php
2358
  * <?php
2359
+ * $I->waitForText('foo', 30); // secs
2360
+ * $I->waitForText('foo', 30, '.title'); // secs
2361
  * ?>
2362
  * ```
2363
  *
2364
+ * @param string $text
2365
+ * @param int $timeout seconds
2366
+ * @param null $selector
2367
+ * @throws \Exception
2368
+ * @see \Codeception\Module\WebDriver::waitForText()
2369
  */
2370
+ public function waitForText($text, $timeout = null, $selector = null) {
2371
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForText', func_get_args()));
2372
  }
2373
 
2374
 
2375
  /**
2376
  * [!] Method is generated. Documentation taken from corresponding module.
2377
  *
2378
+ * Wait for $timeout seconds.
 
 
 
 
 
 
 
 
 
2379
  *
2380
+ * @param int $timeout secs
2381
+ * @throws \Codeception\Exception\TestRuntimeException
2382
+ * @see \Codeception\Module\WebDriver::wait()
2383
  */
2384
+ public function wait($timeout) {
2385
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('wait', func_get_args()));
2386
  }
2387
+
2388
+
2389
  /**
2390
  * [!] Method is generated. Documentation taken from corresponding module.
2391
  *
2392
+ * Low-level API method.
2393
+ * If Codeception commands are not enough, this allows you to use Selenium WebDriver methods directly:
2394
  *
2395
  * ``` php
2396
+ * $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
2397
+ * $webdriver->get('http://google.com');
2398
+ * });
2399
  * ```
2400
  *
2401
+ * This runs in the context of the
2402
+ * [RemoteWebDriver class](https://github.com/facebook/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php).
2403
+ * Try not to use this command on a regular basis.
2404
+ * If Codeception lacks a feature you need, please implement it and submit a patch.
2405
  *
2406
+ * @param callable $function
2407
+ * @see \Codeception\Module\WebDriver::executeInSelenium()
2408
  */
2409
+ public function executeInSelenium($function) {
2410
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('executeInSelenium', func_get_args()));
2411
  }
2412
 
2413
 
2414
  /**
2415
  * [!] Method is generated. Documentation taken from corresponding module.
2416
  *
2417
+ * Switch to another window identified by name.
 
 
 
 
 
 
 
 
2418
  *
2419
+ * The window can only be identified by name. If the $name parameter is blank, the parent window will be used.
 
 
 
 
 
 
 
 
 
2420
  *
2421
+ * Example:
2422
+ * ``` html
2423
+ * <input type="button" value="Open window" onclick="window.open('http://example.com', 'another_window')">
2424
+ * ```
2425
  *
2426
+ * ``` php
2427
  * <?php
2428
+ * $I->click("Open window");
2429
+ * # switch to another window
2430
+ * $I->switchToWindow("another_window");
2431
+ * # switch to parent window
2432
+ * $I->switchToWindow();
2433
+ * ?>
2434
  * ```
2435
  *
2436
+ * If the window has no name, the only way to access it is via the `executeInSelenium()` method, like so:
 
 
 
 
 
 
 
 
 
 
2437
  *
2438
+ * ``` php
2439
  * <?php
2440
+ * $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
2441
+ * $handles=$webdriver->getWindowHandles();
2442
+ * $last_window = end($handles);
2443
+ * $webdriver->switchTo()->window($last_window);
2444
+ * });
2445
+ * ?>
2446
  * ```
2447
  *
2448
+ * @param string|null $name
2449
+ * @see \Codeception\Module\WebDriver::switchToWindow()
2450
  */
2451
+ public function switchToWindow($name = null) {
2452
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args()));
2453
  }
2454
 
2455
 
2456
  /**
2457
  * [!] Method is generated. Documentation taken from corresponding module.
2458
  *
2459
+ * Switch to another frame on the page.
2460
  *
2461
+ * Example:
2462
+ * ``` html
2463
+ * <iframe name="another_frame" src="http://example.com">
2464
  *
 
 
2465
  * ```
 
 
 
 
 
 
 
 
 
 
 
2466
  *
2467
+ * ``` php
2468
  * <?php
2469
+ * # switch to iframe
2470
+ * $I->switchToIFrame("another_frame");
2471
+ * # switch to parent page
2472
+ * $I->switchToIFrame();
2473
  *
 
 
2474
  * ```
2475
+ *
2476
+ * @param string|null $name
2477
+ * @see \Codeception\Module\WebDriver::switchToIFrame()
2478
  */
2479
+ public function switchToIFrame($name = null) {
2480
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToIFrame', func_get_args()));
2481
  }
2482
 
2483
 
2484
  /**
2485
  * [!] Method is generated. Documentation taken from corresponding module.
2486
  *
2487
+ * Executes JavaScript and waits up to $timeout seconds for it to return true.
2488
+ *
2489
+ * In this example we will wait up to 60 seconds for all jQuery AJAX requests to finish.
2490
  *
2491
  * ``` php
2492
  * <?php
2493
+ * $I->waitForJS("return $.active == 0;", 60);
2494
  * ?>
2495
  * ```
2496
  *
2497
+ * @param string $script
2498
+ * @param int $timeout seconds
2499
+ * @see \Codeception\Module\WebDriver::waitForJS()
 
 
2500
  */
2501
+ public function waitForJS($script, $timeout = null) {
2502
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForJS', func_get_args()));
2503
  }
2504
+
2505
+
2506
  /**
2507
  * [!] Method is generated. Documentation taken from corresponding module.
2508
  *
2509
+ * Executes custom JavaScript.
2510
  *
2511
+ * This example uses jQuery to get a value and assigns that value to a PHP variable:
2512
+ *
2513
+ * ```php
2514
  * <?php
2515
+ * $myVar = $I->executeJS('return $("#myField").val()');
2516
  * ?>
2517
  * ```
2518
  *
2519
+ * @param $script
 
2520
  * @return mixed
2521
+ * @see \Codeception\Module\WebDriver::executeJS()
2522
  */
2523
+ public function executeJS($script) {
2524
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('executeJS', func_get_args()));
2525
  }
2526
 
2527
 
2528
  /**
2529
  * [!] Method is generated. Documentation taken from corresponding module.
2530
  *
2531
+ * Maximizes the current window.
2532
+ * @see \Codeception\Module\WebDriver::maximizeWindow()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2533
  */
2534
+ public function maximizeWindow() {
2535
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('maximizeWindow', func_get_args()));
2536
  }
2537
 
2538
 
2539
  /**
2540
  * [!] Method is generated. Documentation taken from corresponding module.
2541
  *
2542
+ * Performs a simple mouse drag-and-drop operation.
 
 
 
 
 
2543
  *
2544
  * ``` php
2545
  * <?php
2546
+ * $I->dragAndDrop('#drag', '#drop');
2547
+ * ?>
2548
  * ```
2549
  *
2550
+ * @param string $source (CSS ID or XPath)
2551
+ * @param string $target (CSS ID or XPath)
2552
+ * @see \Codeception\Module\WebDriver::dragAndDrop()
 
 
 
 
 
 
 
 
 
 
 
 
2553
  */
2554
+ public function dragAndDrop($source, $target) {
2555
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('dragAndDrop', func_get_args()));
2556
  }
2557
 
2558
 
2559
  /**
2560
  * [!] Method is generated. Documentation taken from corresponding module.
2561
  *
2562
+ * Move mouse over the first element matched by the given locator.
2563
+ * If the second and third parameters are given,
2564
+ * then the mouse is moved to an offset of the element's top-left corner.
2565
+ * Otherwise, the mouse is moved to the center of the element.
2566
  *
2567
+ * ``` php
2568
  * <?php
2569
+ * $I->moveMouseOver(['css' => '.checkout'], 20, 50);
2570
  * ?>
2571
  * ```
2572
  *
2573
+ * @param string $cssOrXPath css or xpath of the web element
2574
+ * @param int $offsetX
2575
+ * @param int $offsetY
2576
  *
2577
+ * @throws \Codeception\Exception\ElementNotFound
2578
+ * @see \Codeception\Module\WebDriver::moveMouseOver()
2579
  */
2580
+ public function moveMouseOver($cssOrXPath, $offsetX = null, $offsetY = null) {
2581
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('moveMouseOver', func_get_args()));
2582
  }
2583
 
2584
 
2585
  /**
2586
  * [!] Method is generated. Documentation taken from corresponding module.
2587
  *
2588
+ * Performs contextual click with the right mouse button on an element.
 
 
 
 
 
 
 
2589
  *
2590
+ * @param $cssOrXPath
2591
+ * @throws \Codeception\Exception\ElementNotFound
2592
+ * @see \Codeception\Module\WebDriver::clickWithRightButton()
 
2593
  */
2594
+ public function clickWithRightButton($cssOrXPath) {
2595
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('clickWithRightButton', func_get_args()));
2596
  }
2597
+
2598
+
2599
  /**
2600
  * [!] Method is generated. Documentation taken from corresponding module.
2601
  *
2602
+ * Pauses test execution in debug mode.
2603
+ * To proceed test press "ENTER" in console.
 
 
 
 
 
 
2604
  *
2605
+ * This method is useful while writing tests,
2606
+ * since it allows you to inspect the current page in the middle of a test case.
2607
+ * @see \Codeception\Module\WebDriver::pauseExecution()
2608
  */
2609
+ public function pauseExecution() {
2610
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('pauseExecution', func_get_args()));
2611
  }
2612
 
2613
 
2614
  /**
2615
  * [!] Method is generated. Documentation taken from corresponding module.
2616
  *
2617
+ * Performs a double-click on an element matched by CSS or XPath.
 
 
 
 
 
 
2618
  *
2619
+ * @param $cssOrXPath
2620
+ * @throws \Codeception\Exception\ElementNotFound
2621
+ * @see \Codeception\Module\WebDriver::doubleClick()
 
 
2622
  */
2623
+ public function doubleClick($cssOrXPath) {
2624
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('doubleClick', func_get_args()));
2625
  }
2626
+
2627
+
2628
  /**
2629
  * [!] Method is generated. Documentation taken from corresponding module.
2630
  *
2631
+ * Presses the given key on the given element.
2632
+ * To specify a character and modifier (e.g. ctrl, alt, shift, meta), pass an array for $char with
2633
+ * the modifier as the first element and the character as the second.
2634
+ * For special keys use key constants from WebDriverKeys class.
2635
  *
2636
+ * ``` php
2637
  * <?php
2638
+ * // <input id="page" value="old" />
2639
+ * $I->pressKey('#page','a'); // => olda
2640
+ * $I->pressKey('#page',array('ctrl','a'),'new'); //=> new
2641
+ * $I->pressKey('#page',array('shift','111'),'1','x'); //=> old!!!1x
2642
+ * $I->pressKey('descendant-or-self::*[@id='page']','u'); //=> oldu
2643
+ * $I->pressKey('#name', array('ctrl', 'a'), \Facebook\WebDriver\WebDriverKeys::DELETE); //=>''
2644
  * ?>
2645
  * ```
2646
  *
2647
+ * @param $element
2648
+ * @param $char string|array Can be char or array with modifier. You can provide several chars.
2649
+ * @throws \Codeception\Exception\ElementNotFound
2650
+ * @see \Codeception\Module\WebDriver::pressKey()
2651
  */
2652
+ public function pressKey($element, $char) {
2653
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('pressKey', func_get_args()));
2654
  }
2655
 
2656
 
2657
  /**
2658
  * [!] Method is generated. Documentation taken from corresponding module.
2659
  *
2660
+ * Append the given text to the given element.
2661
+ * Can also add a selection to a select box.
 
 
2662
  *
2663
  * ``` php
2664
  * <?php
2665
+ * $I->appendField('#mySelectbox', 'SelectValue');
2666
+ * $I->appendField('#myTextField', 'appended');
2667
+ * ?>
2668
  * ```
 
2669
  *
2670
+ * @param string $field
2671
+ * @param string $value
2672
+ * @throws \Codeception\Exception\ElementNotFound
2673
+ * @see \Codeception\Module\WebDriver::appendField()
2674
  */
2675
+ public function appendField($field, $value) {
2676
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('appendField', func_get_args()));
2677
  }
2678
+
2679
+
2680
  /**
2681
  * [!] Method is generated. Documentation taken from corresponding module.
2682
  *
2683
+ * @param string $name
2684
+ * @see \Codeception\Module\WebDriver::saveSessionSnapshot()
 
 
 
 
 
 
 
 
 
 
 
 
2685
  */
2686
+ public function saveSessionSnapshot($name) {
2687
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('saveSessionSnapshot', func_get_args()));
2688
  }
2689
 
2690
 
2691
  /**
2692
  * [!] Method is generated. Documentation taken from corresponding module.
2693
  *
2694
+ * @param string $name
2695
+ * @return bool
2696
+ * @see \Codeception\Module\WebDriver::loadSessionSnapshot()
 
 
 
 
 
 
 
 
 
 
 
2697
  */
2698
+ public function loadSessionSnapshot($name) {
2699
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('loadSessionSnapshot', func_get_args()));
2700
  }
2701
 
2702
 
2703
  /**
2704
  * [!] Method is generated. Documentation taken from corresponding module.
2705
  *
2706
+ * Move to the middle of the given element matched by the given locator.
2707
+ * Extra shift, calculated from the top-left corner of the element,
2708
+ * can be set by passing $offsetX and $offsetY parameters.
2709
  *
2710
+ * ``` php
2711
+ * <?php
2712
+ * $I->scrollTo(['css' => '.checkout'], 20, 50);
2713
+ * ?>
2714
+ * ```
2715
  *
2716
+ * @param $selector
2717
+ * @param int $offsetX
2718
+ * @param int $offsetY
2719
+ * @see \Codeception\Module\WebDriver::scrollTo()
2720
  */
2721
+ public function scrollTo($selector, $offsetX = null, $offsetY = null) {
2722
+ return $this->getScenario()->runStep(new \Codeception\Step\Action('scrollTo', func_get_args()));
2723
  }
2724
 
2725
 
tests/_support/_generated/FunctionalTesterActions.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php //[STAMP] a7998ce43103ddef5d6cac161ff9db5a
2
  namespace _generated;
3
 
4
  // This class was automatically generated by build task
1
+ <?php //[STAMP] 7dd2cdf035d42dcf0bc173bccdf36ccf
2
  namespace _generated;
3
 
4
  // This class was automatically generated by build task
tests/_support/_generated/UnitTesterActions.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php //[STAMP] 1b9cb8153c8526a40d058947abb70f53
2
  namespace _generated;
3
 
4
  // This class was automatically generated by build task
1
+ <?php //[STAMP] f97468566553c9d95719fa284099d4c1
2
  namespace _generated;
3
 
4
  // This class was automatically generated by build task
tests/acceptance.suite.yml CHANGED
@@ -7,7 +7,10 @@
7
  class_name: AcceptanceTester
8
  modules:
9
  enabled:
10
- - PhpBrowser:
11
- #- WebDriver:
12
- - Db:
 
 
 
13
  - \Helper\Acceptance
7
  class_name: AcceptanceTester
8
  modules:
9
  enabled:
10
+ #- PhpBrowser:
11
+ - WebDriver:
12
+ #- WebHelper:
13
+ #- Db:
14
+ - Filesystem:
15
+ - Asserts:
16
  - \Helper\Acceptance
tests/acceptance/GeneralSettingsCest.php CHANGED
@@ -5,9 +5,15 @@ use Page\WPDashboardPage;
5
 
6
  class GeneralSettingsCest
7
  {
 
 
 
 
 
8
  public function _before(AcceptanceTester $I)
9
  {
10
- $I->login();
 
11
  }
12
 
13
  public function _after(AcceptanceTester $I)
@@ -17,35 +23,51 @@ class GeneralSettingsCest
17
  // tests
18
  public function test_general_settings_shows_up(AcceptanceTester $I)
19
  {
20
- (new GeneralPage($I))->amOnGeneralPage();
21
  }
22
 
23
- public function test_main_menu(AcceptanceTester $I){
24
- $page = new GeneralPage($I);
25
- $page->amOnGeneralPage();
26
-
27
- $page->selectedMenu('General');
28
- $page->seeMenu('Admin Bar');
29
- $page->seeMenu('Footer');
30
- $page->seeMenu('Dashboard');
31
- $page->seeMenu('Login Page');
32
- $page->seeMenu('Admin Menu');
33
- $page->seeMenu('Colorizer');
34
- $page->seeMenu('Advanced');
35
- $page->seeMenu('Themes');
36
- $page->seeMenu('Upgrade');
 
 
 
 
 
37
  }
38
 
39
- public function test_areas(AcceptanceTester $I){
40
- $page = new GeneralPage($I);
41
- $page->amOnGeneralPage();
42
- $page->seeArea('Pages');
43
- $page->seeArea('Security');
44
- $page->seeArea('Feedback and Support');
 
 
 
 
 
 
45
  }
46
 
47
- public function test_feedback_and_support(AcceptanceTester $I){
48
- (new GeneralPage($I))->amOnGeneralPage();
 
 
 
 
 
49
 
50
  $I->see('Idea for improvement');
51
  $I->see('Report an issue');
@@ -58,53 +80,138 @@ class GeneralSettingsCest
58
  //TODO: Test click on links open link in a new tab
59
  }
60
 
61
- public function test_capability_field(AcceptanceTester $I){
62
- $page = new GeneralPage($I);
63
- $page->amOnGeneralPage();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
- //set new value
66
- $I->selectOption(GeneralPage::$capabilityLabel, 'create_users');
67
- $I->see('create_users', GeneralPage::$capabilitySelected);
68
- $page->saveSettings();
69
- $page->amOnGeneralPage();
70
- $I->see('create_users', GeneralPage::$capabilitySelected);
71
 
72
- //Return to default
73
- $I->selectOption(GeneralPage::$capabilityLabel, 'edit_dashboard');
74
- $page->saveSettings();
75
- $page->amOnGeneralPage();
76
- $I->see('edit_dashboard', GeneralPage::$capabilitySelected);
77
 
78
- //TODO: Test if this actually affects user that does not have that capability. Login with subscriber
79
 
 
80
 
 
81
 
 
 
 
 
 
 
 
82
  }
83
 
84
- public function test_screen_options(AcceptanceTester $I){
85
- $page = new GeneralPage($I);
86
- $page->amOnGeneralPage();
87
 
88
- //Toggle hiding OFF
89
- $I->selectOption('agca_screen_options_menu', false);
90
- $page->saveSettings();
91
- $page->amOnGeneralPage();
92
- $I->selectOption('agca_screen_options_menu', false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
  $dashboardPage = new WPDashboardPage($I);
95
- $dashboardPage->amOnDashboardPage();
96
- $dashboardPage->canSeeScreenOptions();
97
 
98
- //Toggle hiding ON;
99
- $page->amOnGeneralPage();
100
- $I->selectOption('agca_screen_options_menu', true);
101
- $page->saveSettings();
102
- $page->amOnGeneralPage();
103
- $I->selectOption('agca_screen_options_menu', true);
 
 
 
 
 
 
 
 
104
 
105
- $dashboardPage->amOnDashboardPage();
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
- //TODO: Does not work. Enable webdriver instead of PHPBrowser
108
- //$dashboardPage->canSeeScreenOptions(false);
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
  }
5
 
6
  class GeneralSettingsCest
7
  {
8
+ /**
9
+ * @var GeneralPage
10
+ */
11
+ private $generalPage;
12
+
13
  public function _before(AcceptanceTester $I)
14
  {
15
+ $I->loginAsAdmin();
16
+ $this->generalPage = new GeneralPage($I);
17
  }
18
 
19
  public function _after(AcceptanceTester $I)
23
  // tests
24
  public function test_general_settings_shows_up(AcceptanceTester $I)
25
  {
26
+ $this->generalPage->visit();
27
  }
28
 
29
+ public function test_main_menu(AcceptanceTester $I)
30
+ {
31
+ // Initialization -----------------------------------------
32
+
33
+ $page = $this->generalPage->visit();
34
+
35
+ // Assertions ------------------------------------------------
36
+
37
+ $page
38
+ ->selectedMenu('General')
39
+ ->seeMenu('Admin Bar')
40
+ ->seeMenu('Footer')
41
+ ->seeMenu('Dashboard')
42
+ ->seeMenu('Login Page')
43
+ ->seeMenu('Admin Menu')
44
+ ->seeMenu('Colorizer')
45
+ ->seeMenu('Advanced')
46
+ ->seeMenu('Themes')
47
+ ->seeMenu('Upgrade');
48
  }
49
 
50
+ public function test_areas(AcceptanceTester $I)
51
+ {
52
+ // Initialization -----------------------------------------
53
+
54
+ $page = $this->generalPage->visit();
55
+
56
+ // Assertions ------------------------------------------------
57
+
58
+ $page
59
+ ->seeArea('Pages')
60
+ ->seeArea('Security')
61
+ ->seeArea('Feedback and Support');
62
  }
63
 
64
+ public function test_feedback_and_support(AcceptanceTester $I)
65
+ {
66
+ // Initialization -----------------------------------------
67
+
68
+ $this->generalPage->visit();
69
+
70
+ // Assertions ------------------------------------------------
71
 
72
  $I->see('Idea for improvement');
73
  $I->see('Report an issue');
80
  //TODO: Test click on links open link in a new tab
81
  }
82
 
83
+ public function test_capability_field(AcceptanceTester $I)
84
+ {
85
+ // Initialization -----------------------------------------
86
+
87
+ $dashboardPage = new WPDashboardPage($I);
88
+ $page = $this->generalPage->visit();
89
+
90
+ // Prerequisites -------------------------------------------
91
+
92
+ $page->prepareAgcaOptions([
93
+ GeneralPage::$helpMenuOption => true,
94
+ GeneralPage::$excludeAdministratorOption =>true,
95
+ GeneralPage::$capabilityField => [
96
+ 'type' => 'select',
97
+ 'value' => GeneralPage::$capabilityEditPosts
98
+ ]
99
+ ]);
100
+
101
+ // Assertions ------------------------------------------------
102
 
103
+ //EDITOR SHOULD NOT SEE THE CHANGES
104
+ $I->logOut()->loginAsEditor();
105
+ $dashboardPage->visit()->canSeeHelpOptions();
 
 
 
106
 
107
+ //SUBSCRIBER SHOULD SEE THE CHANGES
108
+ $I->logOut()->loginAsSubscriber();
109
+ $dashboardPage->visit()->canSeeHelpOptions(false);
 
 
110
 
 
111
 
112
+ $I->logOut()->loginAsAdmin();
113
 
114
+ $page->visit();
115
 
116
+ //Return to default capability value
117
+ $page->prepareAgcaOptions([
118
+ GeneralPage::$capabilityField => [
119
+ 'type' => 'select',
120
+ 'value' => GeneralPage::$capabilityEditDashboard
121
+ ]
122
+ ]);
123
  }
124
 
125
+ public function test_exclude_administrator(AcceptanceTester $I)
126
+ {
127
+ // Initialization -----------------------------------------
128
 
129
+ $dashboardPage = new WPDashboardPage($I);
130
+ $page = $this->generalPage->visit();
131
+
132
+ $option = GeneralPage::$excludeAdministratorOption;
133
+ $label = GeneralPage::$excludeAdministratorOptionLabel;
134
+
135
+
136
+ // Prerequisites -------------------------------------------
137
+
138
+ $page->prepareAgcaOptions([
139
+ GeneralPage::$helpMenuOption => true,
140
+ GeneralPage::$capabilityField => [
141
+ 'type' => 'select',
142
+ 'value' => GeneralPage::$capabilityEditDashboard
143
+ ]
144
+ ]);
145
+
146
+ // Assertions ------------------------------------------------
147
+
148
+ //Assert label is correct
149
+ $I->assertEquals($label, $I->getAGCAOptionLabel($option));
150
+
151
+ //Toggle OFF: Administrator is not excluded, he should see customizations
152
+ $page->prepareAgcaOptions([ $option => false ]);
153
+ $dashboardPage->visit()->canSeeHelpOptions(false);
154
+
155
+ $page->visit();
156
+
157
+ //Toggle ON: Administrator is excluded, customizations should not affect him
158
+ $page->prepareAgcaOptions([ $option => true ]);
159
+ $dashboardPage->visit()->canSeeHelpOptions();
160
+
161
+ //Revert back this option to defaults:
162
+ $page->visit();
163
+ $page->prepareAgcaOptions([ $option => false ]);
164
+ }
165
+
166
+ public function test_help_menu(AcceptanceTester $I)
167
+ {
168
+ // Initialization -----------------------------------------
169
 
170
  $dashboardPage = new WPDashboardPage($I);
171
+ $page = $this->generalPage->visit();
 
172
 
173
+ $option = GeneralPage::$helpMenuOption;
174
+ $label = GeneralPage::$helpMenuOptionLabel;
175
+
176
+ // Assertions ------------------------------------------------
177
+
178
+ //Assert label is correct
179
+ $I->assertEquals($label, $I->getAGCAOptionLabel($option));
180
+
181
+ //Toggle OFF
182
+ $page->prepareAgcaOptions([ $option => false ]);
183
+ $dashboardPage->visit()->canSeeHelpOptions();
184
+
185
+ //Toggle ON;
186
+ $page->visit();
187
 
188
+ $page->prepareAgcaOptions([ $option => true ]);
189
+ $dashboardPage->visit()->canSeeHelpOptions(false);
190
+ }
191
+
192
+ public function test_screen_options(AcceptanceTester $I)
193
+ {
194
+ // Initialization -----------------------------------------
195
+
196
+ $dashboardPage = new WPDashboardPage($I);
197
+ $page = $this->generalPage->visit();
198
+
199
+ $option = GeneralPage::$screenOption;
200
+ $label = GeneralPage::$screenOptionLabel;
201
 
202
+ // Assertions ------------------------------------------------
203
+
204
+ //Assert label is correct
205
+ $I->assertEquals($label, $I->getAGCAOptionLabel($option));
206
+
207
+ //Toggle hiding OFF
208
+ $page->prepareAgcaOptions([ $option => false ]);
209
+ $dashboardPage->visit()->canSeeScreenOptions();
210
+
211
+ $page->visit();
212
+
213
+ //Toggle hiding ON;
214
+ $page->prepareAgcaOptions([ $option => true ]);
215
+ $dashboardPage->visit()->canSeeScreenOptions(false);
216
  }
217
  }