src/Codeception/Module/WordPress.php
public function amOnPage($page)
    {
        $this->setRequestType($page);

        $parts      = parse_url($page);
        $parameters = [];
        if (!empty($parts['query'])) {
            parse_str($parts['query'], $parameters);
        }

        $this->client->setHeaders($this->headers);

        if ($this->isMockRequest) {
            return $page;
        }

        $this->setCookie('wordpress_test_cookie', 'WP Cookie check');
        $this->_loadPage('GET', $page, $parameters);

        return null;
    }
public function amOnPage($page)
    {
        $this->setRequestType($page);

        $parts      = parse_url($page);
        $parameters = [];
        if (!empty($parts['query'])) {
            parse_str($parts['query'], $parameters);
        }

        $this->client->setHeaders($this->headers);

        if ($this->isMockRequest) {
            return $page;
        }

        $this->setCookie('wordpress_test_cookie', 'WP Cookie check');
        $this->_loadPage('GET', $page, $parameters);

        return null;
    }
public function amOnPage ( $ page ) { $ this -> setRequestType ( $ page ) ; $ parts = parse_url ( $ page ) ; $ parameters = [ ] ; if ( ! empty ( $ parts [ 'query' ] ) ) { parse_str ( $ parts [ 'query' ] , $ parameters ) ; } $ this -> client -> setHeaders ( $ this -> headers ) ; if ( $ this -> isMockRequest ) { return $ page ; } $ this -> setCookie ( 'wordpress_test_cookie' , 'WP Cookie check' ) ; $ this -> _loadPage ( 'GET' , $ page , $ parameters ) ; return null ; }
Go to a page on the site.

The module will try to reach the page, relative to the URL specified in the module configuration, without
applying any permalink resolution.

@example
```php
// Go the the homepage.
$I->amOnPage('/');
// Go to the single page of post with ID 23.
$I->amOnPage('/?p=23');
// Go to search page for the string "foo".
$I->amOnPage('/?s=foo');
```

@param string $page The path to the page, relative to the the root URL.
Go to a page on the site .