WordPress.org

Make WordPress Core

Ticket #34693: 34693_first_draft.diff

File 34693_first_draft.diff, 86.8 KB (added by jonathanbardo, 5 years ago)
  • new file codeception.yml

    diff --git codeception.yml codeception.yml
    new file mode 100644
    index 0000000..a4327af
    - +  
     1actor: Tester
     2paths:
     3    tests: tests/codeception
     4    log: tests/codeception/_output
     5    data: tests/codeception/_data
     6    helpers: tests/codeception/_support
     7settings:
     8    bootstrap: _bootstrap.php
     9    colors: true
     10    memory_limit: 256M
  • new file tests/codeception/_bootstrap.php

    diff --git tests/codeception/_bootstrap.php tests/codeception/_bootstrap.php
    new file mode 100644
    index 0000000..b8e9910
    - +  
     1<?php
     2/**
     3 * Use this file to run code before running the test suite
     4 */
  • new file tests/codeception/_support/AcceptanceHelper.php

    diff --git tests/codeception/_support/AcceptanceHelper.php tests/codeception/_support/AcceptanceHelper.php
    new file mode 100644
    index 0000000..776bcb4
    - +  
     1<?php
     2namespace Codeception\Module;
     3use Codeception\Util\Debug;
     4use \WP_CLI\Utils;
     5
     6// here you can define custom actions
     7// all public methods declared in helper class will be available in $I
     8
     9class AcceptanceHelper extends \Codeception\Module {
     10
     11        public function msWait( $ms ) {
     12
     13                usleep( $ms * 1000 );
     14
     15        }
     16
     17        public function seeSetting( $option_name, $option_value = null ) {
     18
     19                // We need to flush the object cache as it might have been updated by our tests
     20                Utils\wp_clear_object_cache();
     21
     22                $option = get_option( $option_name );
     23
     24                $message = sprintf( 'Option name %s does not exist', $option_name );
     25
     26                $this->assertNotEmpty( $option, $message );
     27
     28                if ( func_num_args() > 1 ) {
     29
     30                        $message = sprintf( 'Option %s does not contain expected value', $option_name );
     31
     32                        $this->assertEquals( $option, $option_value, $message );
     33
     34                }
     35
     36        }
     37
     38        /**
     39         * Make assertion that a plugin is active
     40         *
     41         * @param $plugin_basename
     42         */
     43        public function canSeePluginActive( $plugin_basename ) {
     44
     45                $is_active = is_plugin_active( $plugin_basename );
     46
     47                $message = sprintf( 'Plugin name %s is active', $plugin_basename );
     48
     49                $this->assertTrue( $is_active, $message );
     50
     51        }
     52
     53        /**
     54         * Make assertion that a plugin is inactive
     55         *
     56         * @param $plugin_basename
     57         */
     58        public function canSeePluginInactive( $plugin_basename ) {
     59
     60                $is_inactive = ! is_plugin_active( $plugin_basename );
     61
     62                $message = sprintf( 'Plugin name %s is inactive', $plugin_basename );
     63
     64                $this->assertTrue( $is_inactive, $message );
     65
     66        }
     67}
  • new file tests/codeception/acceptance.suite.yml

    diff --git tests/codeception/acceptance.suite.yml tests/codeception/acceptance.suite.yml
    new file mode 100644
    index 0000000..38e1600
    - +  
     1# Codeception Test Suite Configuration
     2
     3# suite for acceptance tests.
     4# perform tests in browser using the WebDriver or PhpBrowser.
     5# If you need both WebDriver and PHPBrowser tests - create a separate suite.
     6
     7class_name: AcceptanceTester
     8modules:
     9  enabled:
     10    - WebDriver
     11    - WordPress
     12    - AcceptanceHelper
     13  config:
     14    WebDriver:
     15      browser: phantomjs
     16      window_size: 1366x764
     17    BrowserStack:
     18      url: http://src.wordpress-develop.dev/
     19      username: BROWSERSTACK_USERNAME
     20      access_key: BROWSERSTACK_ACCESSKEY
     21      browser: IE
     22      version: 9.0
     23      resolution: 1024x768
     24      capabilities:
     25        'browserstack.local': 'true'
     26        'browserstack.debug': 'true'
     27env:
     28  mobile:
     29    modules:
     30      config:
     31        WebDriver:
     32          browser: phantomjs
     33          window_size: 568x320
     34  ie8:
     35    modules:
     36      enabled:
     37        - BrowserStack
     38      config:
     39        BrowserStack:
     40          browser: IE
     41          version: 8.0
     42          resolution: 1024x768
     43  ie9:
     44    modules:
     45      enabled:
     46        - BrowserStack
     47      config:
     48        BrowserStack:
     49          browser: IE
     50          version: 9.0
     51          resolution: 1024x768
     52  ie10:
     53    modules:
     54      enabled:
     55        - BrowserStack
     56      config:
     57        BrowserStack:
     58          browser: IE
     59          version: 10.0
     60          resolution: 1280x800
     61  ie11:
     62    modules:
     63      enabled:
     64        - BrowserStack
     65      config:
     66        BrowserStack:
     67          browser: IE
     68          version: 11.0
     69          resolution: 1440x900
     70  edge12:
     71    modules:
     72      enabled:
     73        - BrowserStack
     74      config:
     75        BrowserStack:
     76          browser: Edge
     77          version: 12.0
     78          resolution: 1440x900
     79          capabilities:
     80            'os': 'Windows'
     81            'os_version': '10'
     82  chrome:
     83    modules:
     84      enabled:
     85        - BrowserStack
     86      config:
     87        BrowserStack:
     88          browser: Chrome
     89          version: 46.0
     90          resolution: 1440x900
     91          capabilities:
     92            'os': 'Windows'
     93            'os_version': '8.1'
     94  safari9:
     95    modules:
     96      enabled:
     97        - BrowserStack
     98      config:
     99        BrowserStack:
     100          browser: Safari
     101          version: 9.0
     102          resolution: 1280x1024
     103          capabilities:
     104            'os': 'OS X'
     105            'os_version': 'El Capitan'
     106  safari8:
     107    modules:
     108      enabled:
     109        - BrowserStack
     110      config:
     111        BrowserStack:
     112          browser: Safari
     113          version: 8.0
     114          resolution: 1280x1024
     115          capabilities:
     116            'os': 'OS X'
     117            'os_version': 'Yosemite'
     118  iphone5:
     119    modules:
     120      enabled:
     121        - BrowserStack
     122      config:
     123        BrowserStack:
     124          browser: iPhone
     125          version:
     126          resolution: 1280x1024
     127          capabilities:
     128            'platform': 'MAC'
     129            'device': 'iPhone 5'
     130  ipadair:
     131    modules:
     132      enabled:
     133        - BrowserStack
     134      config:
     135        BrowserStack:
     136          browser: iPad
     137          version:
     138          resolution: 1280x1024
     139          capabilities:
     140            'platform': 'MAC'
     141            'device': 'iPad Air'
     142  android:
     143    modules:
     144      enabled:
     145        - BrowserStack
     146      config:
     147        BrowserStack:
     148          browser: android
     149          version:
     150          resolution: 1280x1024
     151          capabilities:
     152            'platform': 'ANDROID'
     153            'device': 'Google Nexus 5'
     154  firefox:
     155    modules:
     156      enabled:
     157        - BrowserStack
     158      config:
     159        BrowserStack:
     160          browser: Firefox
     161          version: 41.0
     162          resolution: 1440x900
     163          capabilities:
     164            'platform': 'Windows'
     165            'device': '10'
  • new file tests/codeception/acceptance/AcceptanceTester.php

    diff --git tests/codeception/acceptance/AcceptanceTester.php tests/codeception/acceptance/AcceptanceTester.php
    new file mode 100644
    index 0000000..d906677
    - +  
     1<?php //[STAMP] f345290bc9018bdd2984b37c6fb63d88
     2
     3// This class was automatically generated by build task
     4// You should not change it manually as it will be overwritten on next build
     5// @codingStandardsIgnoreFile
     6
     7
     8use WPCC\Module\BrowserStack;
     9use WPCC\Module\WordPress;
     10use Codeception\Module\AcceptanceHelper;
     11
     12/**
     13 * Inherited Methods
     14 * @method void wantToTest($text)
     15 * @method void wantTo($text)
     16 * @method void execute($callable)
     17 * @method void expectTo($prediction)
     18 * @method void expect($prediction)
     19 * @method void amGoingTo($argumentation)
     20 * @method void am($role)
     21 * @method void lookForwardTo($achieveValue)
     22 * @method void comment($description)
     23 * @method void haveFriend($name, $actorClass = null)
     24 *
     25 * @SuppressWarnings(PHPMD)
     26*/
     27class AcceptanceTester extends \Codeception\Actor
     28{
     29   
     30    /**
     31     * [!] Method is generated. Documentation taken from corresponding module.
     32     *
     33     * Changes the subdomain for the 'url' configuration parameter.
     34     * Does not open a page; use `amOnPage` for that.
     35     *
     36     * ``` php
     37     * <?php
     38     * // If config is: 'http://mysite.com'
     39     * // or config is: 'http://www.mysite.com'
     40     * // or config is: 'http://company.mysite.com'
     41     *
     42     * $I->amOnSubdomain('user');
     43     * $I->amOnPage('/');
     44     * // moves to http://user.mysite.com/
     45     * ?>
     46     * ```
     47     *
     48     * @param $subdomain
     49     *
     50     * @return mixed
     51     * @see \Codeception\Module\WebDriver::amOnSubdomain()
     52     */
     53    public function amOnSubdomain($subdomain) {
     54        return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
     55    }
     56
     57 
     58    /**
     59     * [!] Method is generated. Documentation taken from corresponding module.
     60     *
     61     * Takes a screenshot of the current window and saves it to `tests/_output/debug`.
     62     *
     63     * ``` php
     64     * <?php
     65     * $I->amOnPage('/user/edit');
     66     * $I->makeScreenshot('edit_page');
     67     * // saved to: tests/_output/debug/edit_page.png
     68     * ?>
     69     * ```
     70     *
     71     * @param $name
     72     * @see \Codeception\Module\WebDriver::makeScreenshot()
     73     */
     74    public function makeScreenshot($name) {
     75        return $this->scenario->runStep(new \Codeception\Step\Action('makeScreenshot', func_get_args()));
     76    }
     77
     78 
     79    /**
     80     * [!] Method is generated. Documentation taken from corresponding module.
     81     *
     82     * Resize the current window.
     83     *
     84     * ``` php
     85     * <?php
     86     * $I->resizeWindow(800, 600);
     87     *
     88     * ```
     89     *
     90     * @param int $width
     91     * @param int $height
     92     * @see \Codeception\Module\WebDriver::resizeWindow()
     93     */
     94    public function resizeWindow($width, $height) {
     95        return $this->scenario->runStep(new \Codeception\Step\Action('resizeWindow', func_get_args()));
     96    }
     97
     98 
     99    /**
     100     * [!] Method is generated. Documentation taken from corresponding module.
     101     *
     102     * Checks that a cookie with the given name is set.
     103     * You can set additional cookie params like `domain`, `path` as array passed in last argument.
     104     *
     105     * ``` php
     106     * <?php
     107     * $I->seeCookie('PHPSESSID');
     108     * ?>
     109     * ```
     110     *
     111     * @param $cookie
     112     * @param array $params
     113     * @return mixed
     114     * Conditional Assertion: Test won't be stopped on fail
     115     * @see \Codeception\Module\WebDriver::seeCookie()
     116     */
     117    public function canSeeCookie($cookie, $params = null) {
     118        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
     119    }
     120    /**
     121     * [!] Method is generated. Documentation taken from corresponding module.
     122     *
     123     * Checks that a cookie with the given name is set.
     124     * You can set additional cookie params like `domain`, `path` as array passed in last argument.
     125     *
     126     * ``` php
     127     * <?php
     128     * $I->seeCookie('PHPSESSID');
     129     * ?>
     130     * ```
     131     *
     132     * @param $cookie
     133     * @param array $params
     134     * @return mixed
     135     * @see \Codeception\Module\WebDriver::seeCookie()
     136     */
     137    public function seeCookie($cookie, $params = null) {
     138        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
     139    }
     140
     141 
     142    /**
     143     * [!] Method is generated. Documentation taken from corresponding module.
     144     *
     145     * Checks that there isn't a cookie with the given name.
     146     * You can set additional cookie params like `domain`, `path` as array passed in last argument.
     147     *
     148     * @param $cookie
     149     *
     150     * @param array $params
     151     * @return mixed
     152     * Conditional Assertion: Test won't be stopped on fail
     153     * @see \Codeception\Module\WebDriver::dontSeeCookie()
     154     */
     155    public function cantSeeCookie($cookie, $params = null) {
     156        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
     157    }
     158    /**
     159     * [!] Method is generated. Documentation taken from corresponding module.
     160     *
     161     * Checks that there isn't a cookie with the given name.
     162     * You can set additional cookie params like `domain`, `path` as array passed in last argument.
     163     *
     164     * @param $cookie
     165     *
     166     * @param array $params
     167     * @return mixed
     168     * @see \Codeception\Module\WebDriver::dontSeeCookie()
     169     */
     170    public function dontSeeCookie($cookie, $params = null) {
     171        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
     172    }
     173
     174 
     175    /**
     176     * [!] Method is generated. Documentation taken from corresponding module.
     177     *
     178     * Sets a cookie with the given name and value.
     179     * You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument.
     180     *
     181     * ``` php
     182     * <?php
     183     * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
     184     * ?>
     185     * ```
     186     *
     187     * @param $name
     188     * @param $val
     189     * @param array $params
     190     * @internal param $cookie
     191     * @internal param $value
     192     *
     193     * @return mixed
     194     * @see \Codeception\Module\WebDriver::setCookie()
     195     */
     196    public function setCookie($cookie, $value, $params = null) {
     197        return $this->scenario->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->scenario->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->scenario->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->scenario->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     *
     267     * @param $page
     268     * @see \Codeception\Module\WebDriver::amOnPage()
     269     */
     270    public function amOnPage($page) {
     271        return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
     272    }
     273
     274 
     275    /**
     276     * [!] Method is generated. Documentation taken from corresponding module.
     277     *
     278     * Checks that the current page contains the given string.
     279     * Specify a locator as the second parameter to match a specific region.
     280     *
     281     * ``` php
     282     * <?php
     283     * $I->see('Logout'); // I can suppose user is logged in
     284     * $I->see('Sign Up','h1'); // I can suppose it's a signup page
     285     * $I->see('Sign Up','//body/h1'); // with XPath
     286     * ?>
     287     * ```
     288     *
     289     * @param      $text
     290     * @param null $selector
     291     * Conditional Assertion: Test won't be stopped on fail
     292     * @see \Codeception\Module\WebDriver::see()
     293     */
     294    public function canSee($text, $selector = null) {
     295        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
     296    }
     297    /**
     298     * [!] Method is generated. Documentation taken from corresponding module.
     299     *
     300     * Checks that the current page contains the given string.
     301     * Specify a locator as the second parameter to match a specific region.
     302     *
     303     * ``` php
     304     * <?php
     305     * $I->see('Logout'); // I can suppose user is logged in
     306     * $I->see('Sign Up','h1'); // I can suppose it's a signup page
     307     * $I->see('Sign Up','//body/h1'); // with XPath
     308     * ?>
     309     * ```
     310     *
     311     * @param      $text
     312     * @param null $selector
     313     * @see \Codeception\Module\WebDriver::see()
     314     */
     315    public function see($text, $selector = null) {
     316        return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
     317    }
     318
     319 
     320    /**
     321     * [!] Method is generated. Documentation taken from corresponding module.
     322     *
     323     * Checks that the current page doesn't contain the text specified.
     324     * Give a locator as the second parameter to match a specific region.
     325     *
     326     * ```php
     327     * <?php
     328     * $I->dontSee('Login'); // I can suppose user is already logged in
     329     * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
     330     * $I->dontSee('Sign Up','//body/h1'); // with XPath
     331     * ?>
     332     * ```
     333     *
     334     * @param      $text
     335     * @param null $selector
     336     * Conditional Assertion: Test won't be stopped on fail
     337     * @see \Codeception\Module\WebDriver::dontSee()
     338     */
     339    public function cantSee($text, $selector = null) {
     340        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
     341    }
     342    /**
     343     * [!] Method is generated. Documentation taken from corresponding module.
     344     *
     345     * Checks that the current page doesn't contain the text specified.
     346     * Give a locator as the second parameter to match a specific region.
     347     *
     348     * ```php
     349     * <?php
     350     * $I->dontSee('Login'); // I can suppose user is already logged in
     351     * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
     352     * $I->dontSee('Sign Up','//body/h1'); // with XPath
     353     * ?>
     354     * ```
     355     *
     356     * @param      $text
     357     * @param null $selector
     358     * @see \Codeception\Module\WebDriver::dontSee()
     359     */
     360    public function dontSee($text, $selector = null) {
     361        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
     362    }
     363
     364 
     365    /**
     366     * [!] Method is generated. Documentation taken from corresponding module.
     367     *
     368     * Checks that the page source contains the given string.
     369     *
     370     * ```php
     371     * <?php
     372     * $I->seeInPageSource('<link rel="apple-touch-icon"');
     373     * ```
     374     *
     375     * @param $text
     376     * Conditional Assertion: Test won't be stopped on fail
     377     * @see \Codeception\Module\WebDriver::seeInPageSource()
     378     */
     379    public function canSeeInPageSource($text) {
     380        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args()));
     381    }
     382    /**
     383     * [!] Method is generated. Documentation taken from corresponding module.
     384     *
     385     * Checks that the page source contains the given string.
     386     *
     387     * ```php
     388     * <?php
     389     * $I->seeInPageSource('<link rel="apple-touch-icon"');
     390     * ```
     391     *
     392     * @param $text
     393     * @see \Codeception\Module\WebDriver::seeInPageSource()
     394     */
     395    public function seeInPageSource($text) {
     396        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInPageSource', func_get_args()));
     397    }
     398
     399 
     400    /**
     401     * [!] Method is generated. Documentation taken from corresponding module.
     402     *
     403     * Checks that the page source doesn't contain the given string.
     404     *
     405     * @param $text
     406     * Conditional Assertion: Test won't be stopped on fail
     407     * @see \Codeception\Module\WebDriver::dontSeeInPageSource()
     408     */
     409    public function cantSeeInPageSource($text) {
     410        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args()));
     411    }
     412    /**
     413     * [!] Method is generated. Documentation taken from corresponding module.
     414     *
     415     * Checks that the page source doesn't contain the given string.
     416     *
     417     * @param $text
     418     * @see \Codeception\Module\WebDriver::dontSeeInPageSource()
     419     */
     420    public function dontSeeInPageSource($text) {
     421        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInPageSource', func_get_args()));
     422    }
     423
     424 
     425    /**
     426     * [!] Method is generated. Documentation taken from corresponding module.
     427     *
     428     * Perform a click on a link or a button, given by a locator.
     429     * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
     430     * For buttons, the "value" attribute, "name" attribute, and inner text are searched.
     431     * For links, the link text is searched.
     432     * For images, the "alt" attribute and inner text of any parent links are searched.
     433     *
     434     * The second parameter is a context (CSS or XPath locator) to narrow the search.
     435     *
     436     * Note that if the locator matches a button of type `submit`, the form will be submitted.
     437     *
     438     * ``` php
     439     * <?php
     440     * // simple link
     441     * $I->click('Logout');
     442     * // button of form
     443     * $I->click('Submit');
     444     * // CSS button
     445     * $I->click('#form input[type=submit]');
     446     * // XPath
     447     * $I->click('//form/*[@type=submit]');
     448     * // link in context
     449     * $I->click('Logout', '#nav');
     450     * // using strict locator
     451     * $I->click(['link' => 'Login']);
     452     * ?>
     453     * ```
     454     *
     455     * @param $link
     456     * @param $context
     457     * @see \Codeception\Module\WebDriver::click()
     458     */
     459    public function click($link, $context = null) {
     460        return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args()));
     461    }
     462
     463 
     464    /**
     465     * [!] Method is generated. Documentation taken from corresponding module.
     466     *
     467     * Checks that there's a link with the specified text.
     468     * Give a full URL as the second parameter to match links with that exact URL.
     469     *
     470     * ``` php
     471     * <?php
     472     * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
     473     * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
     474     * ?>
     475     * ```
     476     *
     477     * @param      $text
     478     * @param null $url
     479     * Conditional Assertion: Test won't be stopped on fail
     480     * @see \Codeception\Module\WebDriver::seeLink()
     481     */
     482    public function canSeeLink($text, $url = null) {
     483        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
     484    }
     485    /**
     486     * [!] Method is generated. Documentation taken from corresponding module.
     487     *
     488     * Checks that there's a link with the specified text.
     489     * Give a full URL as the second parameter to match links with that exact URL.
     490     *
     491     * ``` php
     492     * <?php
     493     * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
     494     * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
     495     * ?>
     496     * ```
     497     *
     498     * @param      $text
     499     * @param null $url
     500     * @see \Codeception\Module\WebDriver::seeLink()
     501     */
     502    public function seeLink($text, $url = null) {
     503        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
     504    }
     505
     506 
     507    /**
     508     * [!] Method is generated. Documentation taken from corresponding module.
     509     *
     510     * Checks that the page doesn't contain a link with the given string.
     511     * If the second parameter is given, only links with a matching "href" attribute will be checked.
     512     *
     513     * ``` php
     514     * <?php
     515     * $I->dontSeeLink('Logout'); // I suppose user is not logged in
     516     * $I->dontSeeLink('Checkout now', '/store/cart.php');
     517     * ?>
     518     * ```
     519     *
     520     * @param $text
     521     * @param null $url
     522     * Conditional Assertion: Test won't be stopped on fail
     523     * @see \Codeception\Module\WebDriver::dontSeeLink()
     524     */
     525    public function cantSeeLink($text, $url = null) {
     526        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
     527    }
     528    /**
     529     * [!] Method is generated. Documentation taken from corresponding module.
     530     *
     531     * Checks that the page doesn't contain a link with the given string.
     532     * If the second parameter is given, only links with a matching "href" attribute will be checked.
     533     *
     534     * ``` php
     535     * <?php
     536     * $I->dontSeeLink('Logout'); // I suppose user is not logged in
     537     * $I->dontSeeLink('Checkout now', '/store/cart.php');
     538     * ?>
     539     * ```
     540     *
     541     * @param $text
     542     * @param null $url
     543     * @see \Codeception\Module\WebDriver::dontSeeLink()
     544     */
     545    public function dontSeeLink($text, $url = null) {
     546        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
     547    }
     548
     549 
     550    /**
     551     * [!] Method is generated. Documentation taken from corresponding module.
     552     *
     553     * Checks that current URI contains the given string.
     554     *
     555     * ``` php
     556     * <?php
     557     * // to match: /home/dashboard
     558     * $I->seeInCurrentUrl('home');
     559     * // to match: /users/1
     560     * $I->seeInCurrentUrl('/users/');
     561     * ?>
     562     * ```
     563     *
     564     * @param $uri
     565     * Conditional Assertion: Test won't be stopped on fail
     566     * @see \Codeception\Module\WebDriver::seeInCurrentUrl()
     567     */
     568    public function canSeeInCurrentUrl($uri) {
     569        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
     570    }
     571    /**
     572     * [!] Method is generated. Documentation taken from corresponding module.
     573     *
     574     * Checks that current URI contains the given string.
     575     *
     576     * ``` php
     577     * <?php
     578     * // to match: /home/dashboard
     579     * $I->seeInCurrentUrl('home');
     580     * // to match: /users/1
     581     * $I->seeInCurrentUrl('/users/');
     582     * ?>
     583     * ```
     584     *
     585     * @param $uri
     586     * @see \Codeception\Module\WebDriver::seeInCurrentUrl()
     587     */
     588    public function seeInCurrentUrl($uri) {
     589        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
     590    }
     591
     592 
     593    /**
     594     * [!] Method is generated. Documentation taken from corresponding module.
     595     *
     596     * Checks that the current URL is equal to the given string.
     597     * Unlike `seeInCurrentUrl`, this only matches the full URL.
     598     *
     599     * ``` php
     600     * <?php
     601     * // to match root url
     602     * $I->seeCurrentUrlEquals('/');
     603     * ?>
     604     * ```
     605     *
     606     * @param $uri
     607     * Conditional Assertion: Test won't be stopped on fail
     608     * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals()
     609     */
     610    public function canSeeCurrentUrlEquals($uri) {
     611        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
     612    }
     613    /**
     614     * [!] Method is generated. Documentation taken from corresponding module.
     615     *
     616     * Checks that the current URL is equal to the given string.
     617     * Unlike `seeInCurrentUrl`, this only matches the full URL.
     618     *
     619     * ``` php
     620     * <?php
     621     * // to match root url
     622     * $I->seeCurrentUrlEquals('/');
     623     * ?>
     624     * ```
     625     *
     626     * @param $uri
     627     * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals()
     628     */
     629    public function seeCurrentUrlEquals($uri) {
     630        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
     631    }
     632
     633 
     634    /**
     635     * [!] Method is generated. Documentation taken from corresponding module.
     636     *
     637     * Checks that the current URL matches the given regular expression.
     638     *
     639     * ``` php
     640     * <?php
     641     * // to match root url
     642     * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
     643     * ?>
     644     * ```
     645     *
     646     * @param $uri
     647     * Conditional Assertion: Test won't be stopped on fail
     648     * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches()
     649     */
     650    public function canSeeCurrentUrlMatches($uri) {
     651        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
     652    }
     653    /**
     654     * [!] Method is generated. Documentation taken from corresponding module.
     655     *
     656     * Checks that the current URL matches the given regular expression.
     657     *
     658     * ``` php
     659     * <?php
     660     * // to match root url
     661     * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
     662     * ?>
     663     * ```
     664     *
     665     * @param $uri
     666     * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches()
     667     */
     668    public function seeCurrentUrlMatches($uri) {
     669        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
     670    }
     671
     672 
     673    /**
     674     * [!] Method is generated. Documentation taken from corresponding module.
     675     *
     676     * Checks that the current URI doesn't contain the given string.
     677     *
     678     * ``` php
     679     * <?php
     680     * $I->dontSeeInCurrentUrl('/users/');
     681     * ?>
     682     * ```
     683     *
     684     * @param $uri
     685     * Conditional Assertion: Test won't be stopped on fail
     686     * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl()
     687     */
     688    public function cantSeeInCurrentUrl($uri) {
     689        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
     690    }
     691    /**
     692     * [!] Method is generated. Documentation taken from corresponding module.
     693     *
     694     * Checks that the current URI doesn't contain the given string.
     695     *
     696     * ``` php
     697     * <?php
     698     * $I->dontSeeInCurrentUrl('/users/');
     699     * ?>
     700     * ```
     701     *
     702     * @param $uri
     703     * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl()
     704     */
     705    public function dontSeeInCurrentUrl($uri) {
     706        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
     707    }
     708
     709 
     710    /**
     711     * [!] Method is generated. Documentation taken from corresponding module.
     712     *
     713     * Checks that the current URL doesn't equal the given string.
     714     * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
     715     *
     716     * ``` php
     717     * <?php
     718     * // current url is not root
     719     * $I->dontSeeCurrentUrlEquals('/');
     720     * ?>
     721     * ```
     722     *
     723     * @param $uri
     724     * Conditional Assertion: Test won't be stopped on fail
     725     * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals()
     726     */
     727    public function cantSeeCurrentUrlEquals($uri) {
     728        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
     729    }
     730    /**
     731     * [!] Method is generated. Documentation taken from corresponding module.
     732     *
     733     * Checks that the current URL doesn't equal the given string.
     734     * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
     735     *
     736     * ``` php
     737     * <?php
     738     * // current url is not root
     739     * $I->dontSeeCurrentUrlEquals('/');
     740     * ?>
     741     * ```
     742     *
     743     * @param $uri
     744     * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals()
     745     */
     746    public function dontSeeCurrentUrlEquals($uri) {
     747        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
     748    }
     749
     750 
     751    /**
     752     * [!] Method is generated. Documentation taken from corresponding module.
     753     *
     754     * Checks that current url doesn't match the given regular expression.
     755     *
     756     * ``` php
     757     * <?php
     758     * // to match root url
     759     * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
     760     * ?>
     761     * ```
     762     *
     763     * @param $uri
     764     * Conditional Assertion: Test won't be stopped on fail
     765     * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches()
     766     */
     767    public function cantSeeCurrentUrlMatches($uri) {
     768        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
     769    }
     770    /**
     771     * [!] Method is generated. Documentation taken from corresponding module.
     772     *
     773     * Checks that current url doesn't match the given regular expression.
     774     *
     775     * ``` php
     776     * <?php
     777     * // to match root url
     778     * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
     779     * ?>
     780     * ```
     781     *
     782     * @param $uri
     783     * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches()
     784     */
     785    public function dontSeeCurrentUrlMatches($uri) {
     786        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
     787    }
     788
     789 
     790    /**
     791     * [!] Method is generated. Documentation taken from corresponding module.
     792     *
     793     * Executes the given regular expression against the current URI and returns the first match.
     794     * If no parameters are provided, the full URI is returned.
     795     *
     796     * ``` php
     797     * <?php
     798     * $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~');
     799     * $uri = $I->grabFromCurrentUrl();
     800     * ?>
     801     * ```
     802     *
     803     * @param null $uri
     804     *
     805     * @internal param $url
     806     * @return mixed
     807     * @see \Codeception\Module\WebDriver::grabFromCurrentUrl()
     808     */
     809    public function grabFromCurrentUrl($uri = null) {
     810        return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
     811    }
     812
     813 
     814    /**
     815     * [!] Method is generated. Documentation taken from corresponding module.
     816     *
     817     * Checks that the specified checkbox is checked.
     818     *
     819     * ``` php
     820     * <?php
     821     * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
     822     * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
     823     * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
     824     * ?>
     825     * ```
     826     *
     827     * @param $checkbox
     828     * Conditional Assertion: Test won't be stopped on fail
     829     * @see \Codeception\Module\WebDriver::seeCheckboxIsChecked()
     830     */
     831    public function canSeeCheckboxIsChecked($checkbox) {
     832        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
     833    }
     834    /**
     835     * [!] Method is generated. Documentation taken from corresponding module.
     836     *
     837     * Checks that the specified checkbox is checked.
     838     *
     839     * ``` php
     840     * <?php
     841     * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
     842     * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
     843     * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
     844     * ?>
     845     * ```
     846     *
     847     * @param $checkbox
     848     * @see \Codeception\Module\WebDriver::seeCheckboxIsChecked()
     849     */
     850    public function seeCheckboxIsChecked($checkbox) {
     851        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
     852    }
     853
     854 
     855    /**
     856     * [!] Method is generated. Documentation taken from corresponding module.
     857     *
     858     * Check that the specified checkbox is unchecked.
     859     *
     860     * ``` php
     861     * <?php
     862     * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
     863     * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
     864     * ?>
     865     * ```
     866     *
     867     * @param $checkbox
     868     * Conditional Assertion: Test won't be stopped on fail
     869     * @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked()
     870     */
     871    public function cantSeeCheckboxIsChecked($checkbox) {
     872        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
     873    }
     874    /**
     875     * [!] Method is generated. Documentation taken from corresponding module.
     876     *
     877     * Check that the specified checkbox is unchecked.
     878     *
     879     * ``` php
     880     * <?php
     881     * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
     882     * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
     883     * ?>
     884     * ```
     885     *
     886     * @param $checkbox
     887     * @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked()
     888     */
     889    public function dontSeeCheckboxIsChecked($checkbox) {
     890        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
     891    }
     892
     893 
     894    /**
     895     * [!] Method is generated. Documentation taken from corresponding module.
     896     *
     897     * Checks that the given input field or textarea contains the given value.
     898     * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
     899     *
     900     * ``` php
     901     * <?php
     902     * $I->seeInField('Body','Type your comment here');
     903     * $I->seeInField('form textarea[name=body]','Type your comment here');
     904     * $I->seeInField('form input[type=hidden]','hidden_value');
     905     * $I->seeInField('#searchform input','Search');
     906     * $I->seeInField('//form/*[@name=search]','Search');
     907     * $I->seeInField(['name' => 'search'], 'Search');
     908     * ?>
     909     * ```
     910     *
     911     * @param $field
     912     * @param $value
     913     * Conditional Assertion: Test won't be stopped on fail
     914     * @see \Codeception\Module\WebDriver::seeInField()
     915     */
     916    public function canSeeInField($field, $value) {
     917        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
     918    }
     919    /**
     920     * [!] Method is generated. Documentation taken from corresponding module.
     921     *
     922     * Checks that the given input field or textarea contains the given value.
     923     * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
     924     *
     925     * ``` php
     926     * <?php
     927     * $I->seeInField('Body','Type your comment here');
     928     * $I->seeInField('form textarea[name=body]','Type your comment here');
     929     * $I->seeInField('form input[type=hidden]','hidden_value');
     930     * $I->seeInField('#searchform input','Search');
     931     * $I->seeInField('//form/*[@name=search]','Search');
     932     * $I->seeInField(['name' => 'search'], 'Search');
     933     * ?>
     934     * ```
     935     *
     936     * @param $field
     937     * @param $value
     938     * @see \Codeception\Module\WebDriver::seeInField()
     939     */
     940    public function seeInField($field, $value) {
     941        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
     942    }
     943
     944 
     945    /**
     946     * [!] Method is generated. Documentation taken from corresponding module.
     947     *
     948     * Checks that an input field or textarea doesn't contain the given value.
     949     * For fuzzy locators, the field is matched by label text, CSS and XPath.
     950     *
     951     * ``` php
     952     * <?php
     953     * $I->dontSeeInField('Body','Type your comment here');
     954     * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
     955     * $I->dontSeeInField('form input[type=hidden]','hidden_value');
     956     * $I->dontSeeInField('#searchform input','Search');
     957     * $I->dontSeeInField('//form/*[@name=search]','Search');
     958     * $I->dontSeeInField(['name' => 'search'], 'Search');
     959     * ?>
     960     * ```
     961     *
     962     * @param $field
     963     * @param $value
     964     * Conditional Assertion: Test won't be stopped on fail
     965     * @see \Codeception\Module\WebDriver::dontSeeInField()
     966     */
     967    public function cantSeeInField($field, $value) {
     968        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
     969    }
     970    /**
     971     * [!] Method is generated. Documentation taken from corresponding module.
     972     *
     973     * Checks that an input field or textarea doesn't contain the given value.
     974     * For fuzzy locators, the field is matched by label text, CSS and XPath.
     975     *
     976     * ``` php
     977     * <?php
     978     * $I->dontSeeInField('Body','Type your comment here');
     979     * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
     980     * $I->dontSeeInField('form input[type=hidden]','hidden_value');
     981     * $I->dontSeeInField('#searchform input','Search');
     982     * $I->dontSeeInField('//form/*[@name=search]','Search');
     983     * $I->dontSeeInField(['name' => 'search'], 'Search');
     984     * ?>
     985     * ```
     986     *
     987     * @param $field
     988     * @param $value
     989     * @see \Codeception\Module\WebDriver::dontSeeInField()
     990     */
     991    public function dontSeeInField($field, $value) {
     992        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
     993    }
     994
     995 
     996    /**
     997     * [!] Method is generated. Documentation taken from corresponding module.
     998     *
     999     * Selects an option in a select tag or in radio button group.
     1000     *
     1001     * ``` php
     1002     * <?php
     1003     * $I->selectOption('form select[name=account]', 'Premium');
     1004     * $I->selectOption('form input[name=payment]', 'Monthly');
     1005     * $I->selectOption('//form/select[@name=account]', 'Monthly');
     1006     * ?>
     1007     * ```
     1008     *
     1009     * Provide an array for the second argument to select multiple options:
     1010     *
     1011     * ``` php
     1012     * <?php
     1013     * $I->selectOption('Which OS do you use?', array('Windows','Linux'));
     1014     * ?>
     1015     * ```
     1016     *
     1017     * @param $select
     1018     * @param $option
     1019     * @see \Codeception\Module\WebDriver::selectOption()
     1020     */
     1021    public function selectOption($select, $option) {
     1022        return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
     1023    }
     1024
     1025 
     1026    /**
     1027     * [!] Method is generated. Documentation taken from corresponding module.
     1028     *
     1029     *
     1030     * @see \Codeception\Module\WebDriver::unselectOption()
     1031     */
     1032    public function unselectOption($select, $option) {
     1033        return $this->scenario->runStep(new \Codeception\Step\Action('unselectOption', func_get_args()));
     1034    }
     1035
     1036 
     1037    /**
     1038     * [!] Method is generated. Documentation taken from corresponding module.
     1039     *
     1040     * Ticks a checkbox. For radio buttons, use the `selectOption` method instead.
     1041     *
     1042     * ``` php
     1043     * <?php
     1044     * $I->checkOption('#agree');
     1045     * ?>
     1046     * ```
     1047     *
     1048     * @param $option
     1049     * @see \Codeception\Module\WebDriver::checkOption()
     1050     */
     1051    public function checkOption($option) {
     1052        return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
     1053    }
     1054
     1055 
     1056    /**
     1057     * [!] Method is generated. Documentation taken from corresponding module.
     1058     *
     1059     * Unticks a checkbox.
     1060     *
     1061     * ``` php
     1062     * <?php
     1063     * $I->uncheckOption('#notify');
     1064     * ?>
     1065     * ```
     1066     *
     1067     * @param $option
     1068     * @see \Codeception\Module\WebDriver::uncheckOption()
     1069     */
     1070    public function uncheckOption($option) {
     1071        return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
     1072    }
     1073
     1074 
     1075    /**
     1076     * [!] Method is generated. Documentation taken from corresponding module.
     1077     *
     1078     * Fills a text field or textarea with the given string.
     1079     *
     1080     * ``` php
     1081     * <?php
     1082     * $I->fillField("//input[@type='text']", "Hello World!");
     1083     * $I->fillField(['name' => 'email'], 'jon@mail.com');
     1084     * ?>
     1085     * ```
     1086     *
     1087     * @param $field
     1088     * @param $value
     1089     * @see \Codeception\Module\WebDriver::fillField()
     1090     */
     1091    public function fillField($field, $value) {
     1092        return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
     1093    }
     1094
     1095 
     1096    /**
     1097     * [!] Method is generated. Documentation taken from corresponding module.
     1098     *
     1099     * Attaches a file relative to the Codeception data directory to the given file upload field.
     1100     *
     1101     * ``` php
     1102     * <?php
     1103     * // file is stored in 'tests/_data/prices.xls'
     1104     * $I->attachFile('input[@type="file"]', 'prices.xls');
     1105     * ?>
     1106     * ```
     1107     *
     1108     * @param $field
     1109     * @param $filename
     1110     * @see \Codeception\Module\WebDriver::attachFile()
     1111     */
     1112    public function attachFile($field, $filename) {
     1113        return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
     1114    }
     1115
     1116 
     1117    /**
     1118     * [!] Method is generated. Documentation taken from corresponding module.
     1119     *
     1120     * Grabs all visible text from the current page.
     1121     *
     1122     * @return string
     1123     * @see \Codeception\Module\WebDriver::getVisibleText()
     1124     */
     1125    public function getVisibleText() {
     1126        return $this->scenario->runStep(new \Codeception\Step\Action('getVisibleText', func_get_args()));
     1127    }
     1128
     1129 
     1130    /**
     1131     * [!] Method is generated. Documentation taken from corresponding module.
     1132     *
     1133     * Finds and returns the text contents of the given element.
     1134     * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
     1135     *
     1136     * ``` php
     1137     * <?php
     1138     * $heading = $I->grabTextFrom('h1');
     1139     * $heading = $I->grabTextFrom('descendant-or-self::h1');
     1140     * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex
     1141     * ?>
     1142     * ```
     1143     *
     1144     * @param $cssOrXPathOrRegex
     1145     *
     1146     * @return mixed
     1147     * @see \Codeception\Module\WebDriver::grabTextFrom()
     1148     */
     1149    public function grabTextFrom($cssOrXPathOrRegex) {
     1150        return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
     1151    }
     1152
     1153 
     1154    /**
     1155     * [!] Method is generated. Documentation taken from corresponding module.
     1156     *
     1157     * Grabs the value of the given attribute value from the given element.
     1158     * Fails if element is not found.
     1159     *
     1160     * ``` php
     1161     * <?php
     1162     * $I->grabAttributeFrom('#tooltip', 'title');
     1163     * ?>
     1164     * ```
     1165     *
     1166     *
     1167     * @param $cssOrXpath
     1168     * @param $attribute
     1169     * @internal param $element
     1170     * @return mixed
     1171     * @see \Codeception\Module\WebDriver::grabAttributeFrom()
     1172     */
     1173    public function grabAttributeFrom($cssOrXpath, $attribute) {
     1174        return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
     1175    }
     1176
     1177 
     1178    /**
     1179     * [!] Method is generated. Documentation taken from corresponding module.
     1180     *
     1181     * Finds the value for the given form field.
     1182     * If a fuzzy locator is used, the field is found by field name, CSS, and XPath.
     1183     *
     1184     * ``` php
     1185     * <?php
     1186     * $name = $I->grabValueFrom('Name');
     1187     * $name = $I->grabValueFrom('input[name=username]');
     1188     * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
     1189     * $name = $I->grabValueFrom(['name' => 'username']);
     1190     * ?>
     1191     * ```
     1192     *
     1193     * @param $field
     1194     *
     1195     * @return mixed
     1196     * @see \Codeception\Module\WebDriver::grabValueFrom()
     1197     */
     1198    public function grabValueFrom($field) {
     1199        return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
     1200    }
     1201
     1202 
     1203    /**
     1204     * [!] Method is generated. Documentation taken from corresponding module.
     1205     *
     1206     * Checks that the given element exists on the page and is visible.
     1207     * You can also specify expected attributes of this element.
     1208     *
     1209     * ``` php
     1210     * <?php
     1211     * $I->seeElement('.error');
     1212     * $I->seeElement('//form/input[1]');
     1213     * $I->seeElement('input', ['name' => 'login']);
     1214     * $I->seeElement('input', ['value' => '123456']);
     1215     *
     1216     * // strict locator in first arg, attributes in second
     1217     * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
     1218     * ?>
     1219     * ```
     1220     *
     1221     * @param $selector
     1222     * @param array $attributes
     1223     * @return
     1224     * Conditional Assertion: Test won't be stopped on fail
     1225     * @see \Codeception\Module\WebDriver::seeElement()
     1226     */
     1227    public function canSeeElement($selector, $attributes = null) {
     1228        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
     1229    }
     1230    /**
     1231     * [!] Method is generated. Documentation taken from corresponding module.
     1232     *
     1233     * Checks that the given element exists on the page and is visible.
     1234     * You can also specify expected attributes of this element.
     1235     *
     1236     * ``` php
     1237     * <?php
     1238     * $I->seeElement('.error');
     1239     * $I->seeElement('//form/input[1]');
     1240     * $I->seeElement('input', ['name' => 'login']);
     1241     * $I->seeElement('input', ['value' => '123456']);
     1242     *
     1243     * // strict locator in first arg, attributes in second
     1244     * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
     1245     * ?>
     1246     * ```
     1247     *
     1248     * @param $selector
     1249     * @param array $attributes
     1250     * @return
     1251     * @see \Codeception\Module\WebDriver::seeElement()
     1252     */
     1253    public function seeElement($selector, $attributes = null) {
     1254        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
     1255    }
     1256
     1257 
     1258    /**
     1259     * [!] Method is generated. Documentation taken from corresponding module.
     1260     *
     1261     * Checks that the given element is invisible or not present on the page.
     1262     * You can also specify expected attributes of this element.
     1263     *
     1264     * ``` php
     1265     * <?php
     1266     * $I->dontSeeElement('.error');
     1267     * $I->dontSeeElement('//form/input[1]');
     1268     * $I->dontSeeElement('input', ['name' => 'login']);
     1269     * $I->dontSeeElement('input', ['value' => '123456']);
     1270     * ?>
     1271     * ```
     1272     *
     1273     * @param $selector
     1274     * @param array $attributes
     1275     * Conditional Assertion: Test won't be stopped on fail
     1276     * @see \Codeception\Module\WebDriver::dontSeeElement()
     1277     */
     1278    public function cantSeeElement($selector, $attributes = null) {
     1279        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
     1280    }
     1281    /**
     1282     * [!] Method is generated. Documentation taken from corresponding module.
     1283     *
     1284     * Checks that the given element is invisible or not present on the page.
     1285     * You can also specify expected attributes of this element.
     1286     *
     1287     * ``` php
     1288     * <?php
     1289     * $I->dontSeeElement('.error');
     1290     * $I->dontSeeElement('//form/input[1]');
     1291     * $I->dontSeeElement('input', ['name' => 'login']);
     1292     * $I->dontSeeElement('input', ['value' => '123456']);
     1293     * ?>
     1294     * ```
     1295     *
     1296     * @param $selector
     1297     * @param array $attributes
     1298     * @see \Codeception\Module\WebDriver::dontSeeElement()
     1299     */
     1300    public function dontSeeElement($selector, $attributes = null) {
     1301        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
     1302    }
     1303
     1304 
     1305    /**
     1306     * [!] Method is generated. Documentation taken from corresponding module.
     1307     *
     1308     * Checks that the given element exists on the page, even it is invisible.
     1309     *
     1310     * ``` php
     1311     * <?php
     1312     * $I->seeElementInDOM('//form/input[type=hidden]');
     1313     * ?>
     1314     * ```
     1315     *
     1316     * @param $selector
     1317     * Conditional Assertion: Test won't be stopped on fail
     1318     * @see \Codeception\Module\WebDriver::seeElementInDOM()
     1319     */
     1320    public function canSeeElementInDOM($selector, $attributes = null) {
     1321        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args()));
     1322    }
     1323    /**
     1324     * [!] Method is generated. Documentation taken from corresponding module.
     1325     *
     1326     * Checks that the given element exists on the page, even it is invisible.
     1327     *
     1328     * ``` php
     1329     * <?php
     1330     * $I->seeElementInDOM('//form/input[type=hidden]');
     1331     * ?>
     1332     * ```
     1333     *
     1334     * @param $selector
     1335     * @see \Codeception\Module\WebDriver::seeElementInDOM()
     1336     */
     1337    public function seeElementInDOM($selector, $attributes = null) {
     1338        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args()));
     1339    }
     1340
     1341 
     1342    /**
     1343     * [!] Method is generated. Documentation taken from corresponding module.
     1344     *
     1345     * Opposite of `seeElementInDOM`.
     1346     *
     1347     * @param $selector
     1348     * Conditional Assertion: Test won't be stopped on fail
     1349     * @see \Codeception\Module\WebDriver::dontSeeElementInDOM()
     1350     */
     1351    public function cantSeeElementInDOM($selector, $attributes = null) {
     1352        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args()));
     1353    }
     1354    /**
     1355     * [!] Method is generated. Documentation taken from corresponding module.
     1356     *
     1357     * Opposite of `seeElementInDOM`.
     1358     *
     1359     * @param $selector
     1360     * @see \Codeception\Module\WebDriver::dontSeeElementInDOM()
     1361     */
     1362    public function dontSeeElementInDOM($selector, $attributes = null) {
     1363        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElementInDOM', func_get_args()));
     1364    }
     1365
     1366 
     1367    /**
     1368     * [!] Method is generated. Documentation taken from corresponding module.
     1369     *
     1370     * Checks that there are a certain number of elements matched by the given locator on the page.
     1371     *
     1372     * ``` php
     1373     * <?php
     1374     * $I->seeNumberOfElements('tr', 10);
     1375     * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
     1376     * ?>
     1377     * ```
     1378     * @param $selector
     1379     * @param mixed $expected:
     1380     * - string: strict number
     1381     * - array: range of numbers [0,10]
     1382     * Conditional Assertion: Test won't be stopped on fail
     1383     * @see \Codeception\Module\WebDriver::seeNumberOfElements()
     1384     */
     1385    public function canSeeNumberOfElements($selector, $expected) {
     1386        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
     1387    }
     1388    /**
     1389     * [!] Method is generated. Documentation taken from corresponding module.
     1390     *
     1391     * Checks that there are a certain number of elements matched by the given locator on the page.
     1392     *
     1393     * ``` php
     1394     * <?php
     1395     * $I->seeNumberOfElements('tr', 10);
     1396     * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
     1397     * ?>
     1398     * ```
     1399     * @param $selector
     1400     * @param mixed $expected:
     1401     * - string: strict number
     1402     * - array: range of numbers [0,10]
     1403     * @see \Codeception\Module\WebDriver::seeNumberOfElements()
     1404     */
     1405    public function seeNumberOfElements($selector, $expected) {
     1406        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
     1407    }
     1408
     1409 
     1410    /**
     1411     * [!] Method is generated. Documentation taken from corresponding module.
     1412     *
     1413     * Checks that the given option is selected.
     1414     *
     1415     * ``` php
     1416     * <?php
     1417     * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
     1418     * ?>
     1419     * ```
     1420     *
     1421     * @param $selector
     1422     * @param $optionText
     1423     *
     1424     * @return mixed
     1425     * Conditional Assertion: Test won't be stopped on fail
     1426     * @see \Codeception\Module\WebDriver::seeOptionIsSelected()
     1427     */
     1428    public function canSeeOptionIsSelected($selector, $optionText) {
     1429        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
     1430    }
     1431    /**
     1432     * [!] Method is generated. Documentation taken from corresponding module.
     1433     *
     1434     * Checks that the given option is selected.
     1435     *
     1436     * ``` php
     1437     * <?php
     1438     * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
     1439     * ?>
     1440     * ```
     1441     *
     1442     * @param $selector
     1443     * @param $optionText
     1444     *
     1445     * @return mixed
     1446     * @see \Codeception\Module\WebDriver::seeOptionIsSelected()
     1447     */
     1448    public function seeOptionIsSelected($selector, $optionText) {
     1449        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
     1450    }
     1451
     1452 
     1453    /**
     1454     * [!] Method is generated. Documentation taken from corresponding module.
     1455     *
     1456     * Checks that the given option is not selected.
     1457     *
     1458     * ``` php
     1459     * <?php
     1460     * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
     1461     * ?>
     1462     * ```
     1463     *
     1464     * @param $selector
     1465     * @param $optionText
     1466     *
     1467     * @return mixed
     1468     * Conditional Assertion: Test won't be stopped on fail
     1469     * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected()
     1470     */
     1471    public function cantSeeOptionIsSelected($selector, $optionText) {
     1472        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
     1473    }
     1474    /**
     1475     * [!] Method is generated. Documentation taken from corresponding module.
     1476     *
     1477     * Checks that the given option is not selected.
     1478     *
     1479     * ``` php
     1480     * <?php
     1481     * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
     1482     * ?>
     1483     * ```
     1484     *
     1485     * @param $selector
     1486     * @param $optionText
     1487     *
     1488     * @return mixed
     1489     * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected()
     1490     */
     1491    public function dontSeeOptionIsSelected($selector, $optionText) {
     1492        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
     1493    }
     1494
     1495 
     1496    /**
     1497     * [!] Method is generated. Documentation taken from corresponding module.
     1498     *
     1499     * Checks that the page title contains the given string.
     1500     *
     1501     * ``` php
     1502     * <?php
     1503     * $I->seeInTitle('Blog - Post #1');
     1504     * ?>
     1505     * ```
     1506     *
     1507     * @param $title
     1508     *
     1509     * @return mixed
     1510     * Conditional Assertion: Test won't be stopped on fail
     1511     * @see \Codeception\Module\WebDriver::seeInTitle()
     1512     */
     1513    public function canSeeInTitle($title) {
     1514        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
     1515    }
     1516    /**
     1517     * [!] Method is generated. Documentation taken from corresponding module.
     1518     *
     1519     * Checks that the page title contains the given string.
     1520     *
     1521     * ``` php
     1522     * <?php
     1523     * $I->seeInTitle('Blog - Post #1');
     1524     * ?>
     1525     * ```
     1526     *
     1527     * @param $title
     1528     *
     1529     * @return mixed
     1530     * @see \Codeception\Module\WebDriver::seeInTitle()
     1531     */
     1532    public function seeInTitle($title) {
     1533        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
     1534    }
     1535
     1536 
     1537    /**
     1538     * [!] Method is generated. Documentation taken from corresponding module.
     1539     *
     1540     * Checks that the page title does not contain the given string.
     1541     *
     1542     * @param $title
     1543     *
     1544     * @return mixed
     1545     * Conditional Assertion: Test won't be stopped on fail
     1546     * @see \Codeception\Module\WebDriver::dontSeeInTitle()
     1547     */
     1548    public function cantSeeInTitle($title) {
     1549        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
     1550    }
     1551    /**
     1552     * [!] Method is generated. Documentation taken from corresponding module.
     1553     *
     1554     * Checks that the page title does not contain the given string.
     1555     *
     1556     * @param $title
     1557     *
     1558     * @return mixed
     1559     * @see \Codeception\Module\WebDriver::dontSeeInTitle()
     1560     */
     1561    public function dontSeeInTitle($title) {
     1562        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
     1563    }
     1564
     1565 
     1566    /**
     1567     * [!] Method is generated. Documentation taken from corresponding module.
     1568     *
     1569     * Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`.
     1570     * Don't confuse popups with modal windows, as created by [various libraries](http://jster.net/category/windows-modals-popups).
     1571     * @see \Codeception\Module\WebDriver::acceptPopup()
     1572     */
     1573    public function acceptPopup() {
     1574        return $this->scenario->runStep(new \Codeception\Step\Action('acceptPopup', func_get_args()));
     1575    }
     1576
     1577 
     1578    /**
     1579     * [!] Method is generated. Documentation taken from corresponding module.
     1580     *
     1581     * Dismisses the active JavaScript popup, as created by `window.alert`|`window.confirm`|`window.prompt`.
     1582     * @see \Codeception\Module\WebDriver::cancelPopup()
     1583     */
     1584    public function cancelPopup() {
     1585        return $this->scenario->runStep(new \Codeception\Step\Action('cancelPopup', func_get_args()));
     1586    }
     1587
     1588 
     1589    /**
     1590     * [!] Method is generated. Documentation taken from corresponding module.
     1591     *
     1592     * Checks that the active JavaScript popup, as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
     1593     *
     1594     * @param $text
     1595     * Conditional Assertion: Test won't be stopped on fail
     1596     * @see \Codeception\Module\WebDriver::seeInPopup()
     1597     */
     1598    public function canSeeInPopup($text) {
     1599        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args()));
     1600    }
     1601    /**
     1602     * [!] Method is generated. Documentation taken from corresponding module.
     1603     *
     1604     * Checks that the active JavaScript popup, as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
     1605     *
     1606     * @param $text
     1607     * @see \Codeception\Module\WebDriver::seeInPopup()
     1608     */
     1609    public function seeInPopup($text) {
     1610        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args()));
     1611    }
     1612
     1613 
     1614    /**
     1615     * [!] Method is generated. Documentation taken from corresponding module.
     1616     *
     1617     * Enters text into a native JavaScript prompt popup, as created by `window.prompt`.
     1618     *
     1619     * @param $keys
     1620     * @see \Codeception\Module\WebDriver::typeInPopup()
     1621     */
     1622    public function typeInPopup($keys) {
     1623        return $this->scenario->runStep(new \Codeception\Step\Action('typeInPopup', func_get_args()));
     1624    }
     1625
     1626 
     1627    /**
     1628     * [!] Method is generated. Documentation taken from corresponding module.
     1629     *
     1630     * Reloads the current page.
     1631     * @see \Codeception\Module\WebDriver::reloadPage()
     1632     */
     1633    public function reloadPage() {
     1634        return $this->scenario->runStep(new \Codeception\Step\Action('reloadPage', func_get_args()));
     1635    }
     1636
     1637 
     1638    /**
     1639     * [!] Method is generated. Documentation taken from corresponding module.
     1640     *
     1641     * Moves back in history.
     1642     * @see \Codeception\Module\WebDriver::moveBack()
     1643     */
     1644    public function moveBack() {
     1645        return $this->scenario->runStep(new \Codeception\Step\Action('moveBack', func_get_args()));
     1646    }
     1647
     1648 
     1649    /**
     1650     * [!] Method is generated. Documentation taken from corresponding module.
     1651     *
     1652     * Moves forward in history.
     1653     * @see \Codeception\Module\WebDriver::moveForward()
     1654     */
     1655    public function moveForward() {
     1656        return $this->scenario->runStep(new \Codeception\Step\Action('moveForward', func_get_args()));
     1657    }
     1658
     1659 
     1660    /**
     1661     * [!] Method is generated. Documentation taken from corresponding module.
     1662     *
     1663     * Submits the given form on the page, optionally with the given form values.
     1664     * Give the form fields values as an array. Note that hidden fields can't be accessed.
     1665     *
     1666     * Skipped fields will be filled by their values from the page.
     1667     * You don't need to click the 'Submit' button afterwards.
     1668     * This command itself triggers the request to form's action.
     1669     *
     1670     * You can optionally specify what button's value to include
     1671     * in the request with the last parameter as an alternative to
     1672     * explicitly setting its value in the second parameter, as
     1673     * button values are not otherwise included in the request.
     1674     *
     1675     * Examples:
     1676     *
     1677     * ``` php
     1678     * <?php
     1679     * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'));
     1680     * // or
     1681     * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName');
     1682     *
     1683     * ```
     1684     *
     1685     * For example, given this sample "Sign Up" form:
     1686     *
     1687     * ``` html
     1688     * <form action="/sign_up">
     1689     *     Login: <input type="text" name="user[login]" /><br/>
     1690     *     Password: <input type="password" name="user[password]" /><br/>
     1691     *     Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/>
     1692     *     Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select>
     1693     *     <input type="submit" name="submitButton" value="Submit" />
     1694     * </form>
     1695     * ```
     1696     *
     1697     * You could write the following to submit it:
     1698     *
     1699     * ``` php
     1700     * <?php
     1701     * $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton');
     1702     *
     1703     * ```
     1704     * Note that "2" will be the submitted value for the "plan" field, as it is the selected option.
     1705     *
     1706     * You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm.
     1707     *
     1708     * ```php
     1709     * <?php
     1710     * $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
     1711     *
     1712     * ```
     1713     *
     1714     * @param $selector
     1715     * @param $params
     1716     * @param $button
     1717     * @see \Codeception\Module\WebDriver::submitForm()
     1718     */
     1719    public function submitForm($selector, $params, $button = null) {
     1720        return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
     1721    }
     1722
     1723 
     1724    /**
     1725     * [!] Method is generated. Documentation taken from corresponding module.
     1726     *
     1727     * Waits up to $timeout seconds for the given element to change.
     1728     * Element "change" is determined by a callback function which is called repeatedly until the return value evaluates to true.
     1729     *
     1730     * ``` php
     1731     * <?php
     1732     * $I->waitForElementChange('#menu', function(\WebDriverElement $el) {
     1733     *     return $el->isDisplayed();
     1734     * }, 100);
     1735     * ?>
     1736     * ```
     1737     *
     1738     * @param $element
     1739     * @param \Closure $callback
     1740     * @param int $timeout seconds
     1741     * @throws \Codeception\Exception\ElementNotFound
     1742     * @see \Codeception\Module\WebDriver::waitForElementChange()
     1743     */
     1744    public function waitForElementChange($element, $callback, $timeout = null) {
     1745        return $this->scenario->runStep(new \Codeception\Step\Action('waitForElementChange', func_get_args()));
     1746    }
     1747
     1748 
     1749    /**
     1750     * [!] Method is generated. Documentation taken from corresponding module.
     1751     *
     1752     * Waits up to $timeout seconds for an element to appear on the page.
     1753     * If the element doesn't appear, a timeout exception is thrown.
     1754     *
     1755     * ``` php
     1756     * <?php
     1757     * $I->waitForElement('#agree_button', 30); // secs
     1758     * $I->click('#agree_button');
     1759     * ?>
     1760     * ```
     1761     *
     1762     * @param $element
     1763     * @param int $timeout seconds
     1764     * @throws \Exception
     1765     * @see \Codeception\Module\WebDriver::waitForElement()
     1766     */
     1767    public function waitForElement($element, $timeout = null) {
     1768        return $this->scenario->runStep(new \Codeception\Step\Action('waitForElement', func_get_args()));
     1769    }
     1770
     1771 
     1772    /**
     1773     * [!] Method is generated. Documentation taken from corresponding module.
     1774     *
     1775     * Waits up to $timeout seconds for the given element to be visible on the page.
     1776     * If element doesn't appear, a timeout exception is thrown.
     1777     *
     1778     * ``` php
     1779     * <?php
     1780     * $I->waitForElementVisible('#agree_button', 30); // secs
     1781     * $I->click('#agree_button');
     1782     * ?>
     1783     * ```
     1784     *
     1785     * @param $element
     1786     * @param int $timeout seconds
     1787     * @throws \Exception
     1788     * @see \Codeception\Module\WebDriver::waitForElementVisible()
     1789     */
     1790    public function waitForElementVisible($element, $timeout = null) {
     1791        return $this->scenario->runStep(new \Codeception\Step\Action('waitForElementVisible', func_get_args()));
     1792    }
     1793
     1794 
     1795    /**
     1796     * [!] Method is generated. Documentation taken from corresponding module.
     1797     *
     1798     * Waits up to $timeout seconds for the given element to become invisible.
     1799     * If element stays visible, a timeout exception is thrown.
     1800     *
     1801     * ``` php
     1802     * <?php
     1803     * $I->waitForElementNotVisible('#agree_button', 30); // secs
     1804     * ?>
     1805     * ```
     1806     *
     1807     * @param $element
     1808     * @param int $timeout seconds
     1809     * @throws \Exception
     1810     * @see \Codeception\Module\WebDriver::waitForElementNotVisible()
     1811     */
     1812    public function waitForElementNotVisible($element, $timeout = null) {
     1813        return $this->scenario->runStep(new \Codeception\Step\Action('waitForElementNotVisible', func_get_args()));
     1814    }
     1815
     1816 
     1817    /**
     1818     * [!] Method is generated. Documentation taken from corresponding module.
     1819     *
     1820     * Waits up to $timeout seconds for the given string to appear on the page.
     1821     * Can also be passed a selector to search in.
     1822     * If the given text doesn't appear, a timeout exception is thrown.
     1823     *
     1824     * ``` php
     1825     * <?php
     1826     * $I->waitForText('foo', 30); // secs
     1827     * $I->waitForText('foo', 30, '.title'); // secs
     1828     * ?>
     1829     * ```
     1830     *
     1831     * @param string $text
     1832     * @param int $timeout seconds
     1833     * @param null $selector
     1834     * @throws \Exception
     1835     * @internal param string $element
     1836     * @see \Codeception\Module\WebDriver::waitForText()
     1837     */
     1838    public function waitForText($text, $timeout = null, $selector = null) {
     1839        return $this->scenario->runStep(new \Codeception\Step\Action('waitForText', func_get_args()));
     1840    }
     1841
     1842 
     1843    /**
     1844     * [!] Method is generated. Documentation taken from corresponding module.
     1845     *
     1846     * Wait for $timeout seconds.
     1847     *
     1848     * @param int $timeout secs
     1849     * @throws \Codeception\Exception\TestRuntime
     1850     * @see \Codeception\Module\WebDriver::wait()
     1851     */
     1852    public function wait($timeout) {
     1853        return $this->scenario->runStep(new \Codeception\Step\Action('wait', func_get_args()));
     1854    }
     1855
     1856 
     1857    /**
     1858     * [!] Method is generated. Documentation taken from corresponding module.
     1859     *
     1860     * Low-level API method.
     1861     * If Codeception commands are not enough, this allows you to use Selenium WebDriver methods directly:
     1862     *
     1863     * ``` php
     1864     * $I->executeInSelenium(function(\WebDriver $webdriver) {
     1865     *   $webdriver->get('http://google.com');
     1866     * });
     1867     * ```
     1868     *
     1869     * This runs in the context of the [RemoteWebDriver class](https://github.com/facebook/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php).
     1870     * Try not to use this command on a regular basis.
     1871     * If Codeception lacks a feature you need, please implement it and submit a patch.
     1872     *
     1873     * @param callable $function
     1874     * @see \Codeception\Module\WebDriver::executeInSelenium()
     1875     */
     1876    public function executeInSelenium($function) {
     1877        return $this->scenario->runStep(new \Codeception\Step\Action('executeInSelenium', func_get_args()));
     1878    }
     1879
     1880 
     1881    /**
     1882     * [!] Method is generated. Documentation taken from corresponding module.
     1883     *
     1884     * Switch to another window identified by name.
     1885     *
     1886     * The window can only be identified by name. If the $name parameter is blank, the parent window will be used.
     1887     *
     1888     * Example:
     1889     * ``` html
     1890     * <input type="button" value="Open window" onclick="window.open('http://example.com', 'another_window')">
     1891     * ```
     1892     *
     1893     * ``` php
     1894     * <?php
     1895     * $I->click("Open window");
     1896     * # switch to another window
     1897     * $I->switchToWindow("another_window");
     1898     * # switch to parent window
     1899     * $I->switchToWindow();
     1900     * ?>
     1901     * ```
     1902     *
     1903     * If the window has no name, the only way to access it is via the `executeInSelenium()` method, like so:
     1904     *
     1905     * ``` php
     1906     * <?php
     1907     * $I->executeInSelenium(function (\Webdriver $webdriver) {
     1908     *      $handles=$webdriver->getWindowHandles();
     1909     *      $last_window = end($handles);
     1910     *      $webdriver->switchTo()->window($last_window);
     1911     * });
     1912     * ?>
     1913     * ```
     1914     *
     1915     * @param string|null $name
     1916     * @see \Codeception\Module\WebDriver::switchToWindow()
     1917     */
     1918    public function switchToWindow($name = null) {
     1919        return $this->scenario->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args()));
     1920    }
     1921
     1922 
     1923    /**
     1924     * [!] Method is generated. Documentation taken from corresponding module.
     1925     *
     1926     * Switch to another frame on the page.
     1927     *
     1928     * Example:
     1929     * ``` html
     1930     * <iframe name="another_frame" src="http://example.com">
     1931     *
     1932     * ```
     1933     *
     1934     * ``` php
     1935     * <?php
     1936     * # switch to iframe
     1937     * $I->switchToIFrame("another_frame");
     1938     * # switch to parent page
     1939     * $I->switchToIFrame();
     1940     *
     1941     * ```
     1942     *
     1943     * @param string|null $name
     1944     * @see \Codeception\Module\WebDriver::switchToIFrame()
     1945     */
     1946    public function switchToIFrame($name = null) {
     1947        return $this->scenario->runStep(new \Codeception\Step\Action('switchToIFrame', func_get_args()));
     1948    }
     1949
     1950 
     1951    /**
     1952     * [!] Method is generated. Documentation taken from corresponding module.
     1953     *
     1954     * Executes JavaScript and waits up to $timeout seconds for it to return true.
     1955     *
     1956     * In this example we will wait up to 60 seconds for all jQuery AJAX requests to finish.
     1957     *
     1958     * ``` php
     1959     * <?php
     1960     * $I->waitForJS("return $.active == 0;", 60);
     1961     * ?>
     1962     * ```
     1963     *
     1964     * @param string $script
     1965     * @param int $timeout seconds
     1966     * @see \Codeception\Module\WebDriver::waitForJS()
     1967     */
     1968    public function waitForJS($script, $timeout = null) {
     1969        return $this->scenario->runStep(new \Codeception\Step\Action('waitForJS', func_get_args()));
     1970    }
     1971
     1972 
     1973    /**
     1974     * [!] Method is generated. Documentation taken from corresponding module.
     1975     *
     1976     * Executes custom JavaScript.
     1977     *
     1978     * This example uses jQuery to get a value and assigns that value to a PHP variable:
     1979     *
     1980     * ```php
     1981     * <?php
     1982     * $myVar = $I->executeJS('return $("#myField").val()');
     1983     * ?>
     1984     * ```
     1985     *
     1986     * @param $script
     1987     * @return mixed
     1988     * @see \Codeception\Module\WebDriver::executeJS()
     1989     */
     1990    public function executeJS($script) {
     1991        return $this->scenario->runStep(new \Codeception\Step\Action('executeJS', func_get_args()));
     1992    }
     1993
     1994 
     1995    /**
     1996     * [!] Method is generated. Documentation taken from corresponding module.
     1997     *
     1998     * Maximizes the current window.
     1999     * @see \Codeception\Module\WebDriver::maximizeWindow()
     2000     */
     2001    public function maximizeWindow() {
     2002        return $this->scenario->runStep(new \Codeception\Step\Action('maximizeWindow', func_get_args()));
     2003    }
     2004
     2005 
     2006    /**
     2007     * [!] Method is generated. Documentation taken from corresponding module.
     2008     *
     2009     * Performs a simple mouse drag-and-drop operation.
     2010     *
     2011     * ``` php
     2012     * <?php
     2013     * $I->dragAndDrop('#drag', '#drop');
     2014     * ?>
     2015     * ```
     2016     *
     2017     * @param string $source (CSS ID or XPath)
     2018     * @param string $target (CSS ID or XPath)
     2019     * @see \Codeception\Module\WebDriver::dragAndDrop()
     2020     */
     2021    public function dragAndDrop($source, $target) {
     2022        return $this->scenario->runStep(new \Codeception\Step\Action('dragAndDrop', func_get_args()));
     2023    }
     2024
     2025 
     2026    /**
     2027     * [!] Method is generated. Documentation taken from corresponding module.
     2028     *
     2029     * Move mouse over the first element matched by the given locator.
     2030     * If the second and third parameters are given, then the mouse is moved to an offset of the element's top-left corner.
     2031     * Otherwise, the mouse is moved to the center of the element.
     2032     *
     2033     * ``` php
     2034     * <?php
     2035     * $I->moveMouseOver(['css' => '.checkout'], 20, 50);
     2036     * ?>
     2037     * ```
     2038     *
     2039     * @param string $cssOrXPath css or xpath of the web element
     2040     * @param int $offsetX
     2041     * @param int $offsetY
     2042     *
     2043     * @throws \Codeception\Exception\ElementNotFound
     2044     * @see \Codeception\Module\WebDriver::moveMouseOver()
     2045     */
     2046    public function moveMouseOver($cssOrXPath, $offsetX = null, $offsetY = null) {
     2047        return $this->scenario->runStep(new \Codeception\Step\Action('moveMouseOver', func_get_args()));
     2048    }
     2049
     2050 
     2051    /**
     2052     * [!] Method is generated. Documentation taken from corresponding module.
     2053     *
     2054     * Performs contextual click with the right mouse button on an element.
     2055     *
     2056     * @param $cssOrXPath
     2057     * @throws \Codeception\Exception\ElementNotFound
     2058     * @see \Codeception\Module\WebDriver::clickWithRightButton()
     2059     */
     2060    public function clickWithRightButton($cssOrXPath) {
     2061        return $this->scenario->runStep(new \Codeception\Step\Action('clickWithRightButton', func_get_args()));
     2062    }
     2063
     2064 
     2065    /**
     2066     * [!] Method is generated. Documentation taken from corresponding module.
     2067     *
     2068     * Pauses test execution in debug mode.
     2069     * To proceed test press "ENTER" in console.
     2070     *
     2071     * This method is useful while writing tests, since it allows you to inspect the current page in the middle of a test case.
     2072     * @see \Codeception\Module\WebDriver::pauseExecution()
     2073     */
     2074    public function pauseExecution() {
     2075        return $this->scenario->runStep(new \Codeception\Step\Action('pauseExecution', func_get_args()));
     2076    }
     2077
     2078 
     2079    /**
     2080     * [!] Method is generated. Documentation taken from corresponding module.
     2081     *
     2082     * Performs a double-click on an element matched by CSS or XPath.
     2083     *
     2084     * @param $cssOrXPath
     2085     * @throws \Codeception\Exception\ElementNotFound
     2086     * @see \Codeception\Module\WebDriver::doubleClick()
     2087     */
     2088    public function doubleClick($cssOrXPath) {
     2089        return $this->scenario->runStep(new \Codeception\Step\Action('doubleClick', func_get_args()));
     2090    }
     2091
     2092 
     2093    /**
     2094     * [!] Method is generated. Documentation taken from corresponding module.
     2095     *
     2096     * Presses the given key on the given element.
     2097     * To specify a character and modifier (e.g. ctrl, alt, shift, meta), pass an array for $char with
     2098     * the modifier as the first element and the character as the second.
     2099     * For special keys use key constants from \WebDriverKeys class.
     2100     *
     2101     * ``` php
     2102     * <?php
     2103     * // <input id="page" value="old" />
     2104     * $I->pressKey('#page','a'); // => olda
     2105     * $I->pressKey('#page',array('ctrl','a'),'new'); //=> new
     2106     * $I->pressKey('#page',array('shift','111'),'1','x'); //=> old!!!1x
     2107     * $I->pressKey('descendant-or-self::*[@id='page']','u'); //=> oldu
     2108     * $I->pressKey('#name', array('ctrl', 'a'), WebDriverKeys::DELETE); //=>''
     2109     * ?>
     2110     * ```
     2111     *
     2112     * @param $element
     2113     * @param $char Can be char or array with modifier. You can provide several chars.
     2114     * @throws \Codeception\Exception\ElementNotFound
     2115     * @see \Codeception\Module\WebDriver::pressKey()
     2116     */
     2117    public function pressKey($element, $char) {
     2118        return $this->scenario->runStep(new \Codeception\Step\Action('pressKey', func_get_args()));
     2119    }
     2120
     2121 
     2122    /**
     2123     * [!] Method is generated. Documentation taken from corresponding module.
     2124     *
     2125     * Append the given text to the given element.
     2126     * Can also add a selection to a select box.
     2127     *
     2128     * ``` php
     2129     * <?php
     2130     * $I->appendField('#mySelectbox', 'SelectValue');
     2131     * $I->appendField('#myTextField', 'appended');
     2132     * ?>
     2133     * ```
     2134     *
     2135     * @param string $field
     2136     * @param string $value
     2137     * @throws \Codeception\Exception\ElementNotFound
     2138     * @see \Codeception\Module\WebDriver::appendField()
     2139     */
     2140    public function appendField($field, $value) {
     2141        return $this->scenario->runStep(new \Codeception\Step\Action('appendField', func_get_args()));
     2142    }
     2143
     2144 
     2145    /**
     2146     * [!] Method is generated. Documentation taken from corresponding module.
     2147     *
     2148     * Checks user meta exists for an user.
     2149         *
     2150         * @since 1.0.0
     2151         *
     2152         * @access public
     2153         * @param int $user_id The user id.
     2154         * @param string $meta_key The meta key to check.
     2155         * @param mixed $meta_value The meta value to check
     2156     * Conditional Assertion: Test won't be stopped on fail
     2157     * @see \WPCC\Module\WordPress::seeUserMetaFor()
     2158     */
     2159    public function canSeeUserMetaFor($user_id, $meta_key, $meta_value = null) {
     2160        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeUserMetaFor', func_get_args()));
     2161    }
     2162    /**
     2163     * [!] Method is generated. Documentation taken from corresponding module.
     2164     *
     2165     * Checks user meta exists for an user.
     2166         *
     2167         * @since 1.0.0
     2168         *
     2169         * @access public
     2170         * @param int $user_id The user id.
     2171         * @param string $meta_key The meta key to check.
     2172         * @param mixed $meta_value The meta value to check
     2173     * @see \WPCC\Module\WordPress::seeUserMetaFor()
     2174     */
     2175    public function seeUserMetaFor($user_id, $meta_key, $meta_value = null) {
     2176        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeUserMetaFor', func_get_args()));
     2177    }
     2178
     2179 
     2180    /**
     2181     * [!] Method is generated. Documentation taken from corresponding module.
     2182     *
     2183     * Checks if user meta doesn't exists.
     2184         *
     2185         * @since 1.0.0
     2186         *
     2187         * @access public
     2188         * @param int $user_id The user id.
     2189         * @param string $meta_key The meta key to check.
     2190         * @param mixed $meta_value The meta value to check
     2191     * Conditional Assertion: Test won't be stopped on fail
     2192     * @see \WPCC\Module\WordPress::dontSeeUserMetaFor()
     2193     */
     2194    public function cantSeeUserMetaFor($user_id, $meta_key, $meta_value = null) {
     2195        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeUserMetaFor', func_get_args()));
     2196    }
     2197    /**
     2198     * [!] Method is generated. Documentation taken from corresponding module.
     2199     *
     2200     * Checks if user meta doesn't exists.
     2201         *
     2202         * @since 1.0.0
     2203         *
     2204         * @access public
     2205         * @param int $user_id The user id.
     2206         * @param string $meta_key The meta key to check.
     2207         * @param mixed $meta_value The meta value to check
     2208     * @see \WPCC\Module\WordPress::dontSeeUserMetaFor()
     2209     */
     2210    public function dontSeeUserMetaFor($user_id, $meta_key, $meta_value = null) {
     2211        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeUserMetaFor', func_get_args()));
     2212    }
     2213
     2214 
     2215    /**
     2216     * [!] Method is generated. Documentation taken from corresponding module.
     2217     *
     2218     * Checks a post meta exists for a post.
     2219         *
     2220         * @since 1.0.0
     2221         *
     2222         * @access public
     2223         * @param int $post_id The post id.
     2224         * @param string $meta_key The meta key to check.
     2225         * @param mixed $meta_value The meta value to check
     2226     * Conditional Assertion: Test won't be stopped on fail
     2227     * @see \WPCC\Module\WordPress::seePostMetaFor()
     2228     */
     2229    public function canSeePostMetaFor($post_id, $meta_key, $meta_value = null) {
     2230        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePostMetaFor', func_get_args()));
     2231    }
     2232    /**
     2233     * [!] Method is generated. Documentation taken from corresponding module.
     2234     *
     2235     * Checks a post meta exists for a post.
     2236         *
     2237         * @since 1.0.0
     2238         *
     2239         * @access public
     2240         * @param int $post_id The post id.
     2241         * @param string $meta_key The meta key to check.
     2242         * @param mixed $meta_value The meta value to check
     2243     * @see \WPCC\Module\WordPress::seePostMetaFor()
     2244     */
     2245    public function seePostMetaFor($post_id, $meta_key, $meta_value = null) {
     2246        return $this->scenario->runStep(new \Codeception\Step\Assertion('seePostMetaFor', func_get_args()));
     2247    }
     2248
     2249 
     2250    /**
     2251     * [!] Method is generated. Documentation taken from corresponding module.
     2252     *
     2253     * Checks if post meta doesn't exists.
     2254         *
     2255         * @since 1.0.0
     2256         *
     2257         * @access public
     2258         * @param int $post The post id.
     2259         * @param string $meta_key The meta key to check.
     2260         * @param mixed $meta_value The meta value to check
     2261     * Conditional Assertion: Test won't be stopped on fail
     2262     * @see \WPCC\Module\WordPress::dontSeePostMetaFor()
     2263     */
     2264    public function cantSeePostMetaFor($post, $meta_key, $meta_value = null) {
     2265        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeePostMetaFor', func_get_args()));
     2266    }
     2267    /**
     2268     * [!] Method is generated. Documentation taken from corresponding module.
     2269     *
     2270     * Checks if post meta doesn't exists.
     2271         *
     2272         * @since 1.0.0
     2273         *
     2274         * @access public
     2275         * @param int $post The post id.
     2276         * @param string $meta_key The meta key to check.
     2277         * @param mixed $meta_value The meta value to check
     2278     * @see \WPCC\Module\WordPress::dontSeePostMetaFor()
     2279     */
     2280    public function dontSeePostMetaFor($post, $meta_key, $meta_value = null) {
     2281        return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeePostMetaFor', func_get_args()));
     2282    }
     2283
     2284 
     2285    /**
     2286     * [!] Method is generated. Documentation taken from corresponding module.
     2287     *
     2288     *
     2289     * @see \Codeception\Module\AcceptanceHelper::msWait()
     2290     */
     2291    public function msWait($ms) {
     2292        return $this->scenario->runStep(new \Codeception\Step\Action('msWait', func_get_args()));
     2293    }
     2294
     2295 
     2296    /**
     2297     * [!] Method is generated. Documentation taken from corresponding module.
     2298     *
     2299     *
     2300     * Conditional Assertion: Test won't be stopped on fail
     2301     * @see \Codeception\Module\AcceptanceHelper::seeSetting()
     2302     */
     2303    public function canSeeSetting($option_name, $option_value = null) {
     2304        return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeSetting', func_get_args()));
     2305    }
     2306    /**
     2307     * [!] Method is generated. Documentation taken from corresponding module.
     2308     *
     2309     *
     2310     * @see \Codeception\Module\AcceptanceHelper::seeSetting()
     2311     */
     2312    public function seeSetting($option_name, $option_value = null) {
     2313        return $this->scenario->runStep(new \Codeception\Step\Assertion('seeSetting', func_get_args()));
     2314    }
     2315
     2316 
     2317    /**
     2318     * [!] Method is generated. Documentation taken from corresponding module.
     2319     *
     2320     * Make assertion that a plugin is active
     2321         *
     2322         * @param $plugin_basename
     2323     * @see \Codeception\Module\AcceptanceHelper::canSeePluginActive()
     2324     */
     2325    public function canSeePluginActive($plugin_basename) {
     2326        return $this->scenario->runStep(new \Codeception\Step\Action('canSeePluginActive', func_get_args()));
     2327    }
     2328
     2329 
     2330    /**
     2331     * [!] Method is generated. Documentation taken from corresponding module.
     2332     *
     2333     * Make assertion that a plugin is inactive
     2334         *
     2335         * @param $plugin_basename
     2336     * @see \Codeception\Module\AcceptanceHelper::canSeePluginInactive()
     2337     */
     2338    public function canSeePluginInactive($plugin_basename) {
     2339        return $this->scenario->runStep(new \Codeception\Step\Action('canSeePluginInactive', func_get_args()));
     2340    }
     2341}
  • new file tests/codeception/acceptance/CustomizerCest.php

    diff --git tests/codeception/acceptance/CustomizerCest.php tests/codeception/acceptance/CustomizerCest.php
    new file mode 100644
    index 0000000..d31361f
    - +  
     1<?php
     2use \AcceptanceTester;
     3use WPCC\Helper\PageObject\LoginPage;
     4
     5class CustomizerCest {
     6
     7    public function _before( AcceptanceTester $I ) {
     8
     9            $loginPage = new LoginPage( $I );
     10
     11            $loginPage->login( 'admin', 'password' );
     12
     13    }
     14
     15        /**
     16         * This tests makes sure the customizer can load properly
     17         *
     18         * @param \AcceptanceTester $I
     19         */
     20    public function customerizerIsLoading( AcceptanceTester $I ) {
     21
     22            $I->wantTo( 'Make sure the customizer can load properly' );
     23
     24            $I->amOnPage( admin_url( 'customize.php' ) );
     25
     26            $I->canSeeElement( 'body.wp-customizer' );
     27
     28    }
     29
     30}
  • new file tests/codeception/acceptance/_bootstrap.php

    diff --git tests/codeception/acceptance/_bootstrap.php tests/codeception/acceptance/_bootstrap.php
    new file mode 100644
    index 0000000..b3d9bbc
    - +  
     1<?php