public function amOnPage($page) { $url = Uri::appendPath($this->config['url'], $page); $this->debugSection('GET', $url); $this->webDriver->get($url); }
public function amOnUrl($url) { $host = Uri::retrieveHost($url); $this->_reconfigure(['url' => $host]); $page = substr($url, strlen($host)); $this->debugSection('Host', $host); $this->amOnPage($page); }
public function getAbsoluteUri($uri) { $baseUri = $this->client->getConfig('base_uri'); if (strpos($uri, '://') === false) { if (strpos($uri, '/') === 0) { $baseUriPath = $baseUri->getPath(); if (!empty($baseUriPath) && strpos($uri, $baseUriPath) === 0) { $uri = substr($uri, strlen($baseUriPath)); } return Uri::appendPath((string) $baseUri, $uri); } // relative url if (!$this->getHistory()->isEmpty()) { return Uri::mergeUrls((string) $this->getHistory()->current()->getUri(), $uri); } } return Uri::mergeUrls($baseUri, $uri); }
/** * Returns an absolute URL for the passed URI with the current URL * as the base path. * * @param string $uri the absolute or relative URI * @return string the absolute URL * @throws \Codeception\Exception\TestRuntimeException if either the current * URL or the passed URI can't be parsed */ protected function getAbsoluteUrlFor($uri) { $currentUrl = $this->getRunningClient()->getHistory()->current()->getUri(); if (empty($uri) || $uri === '#') { return $currentUrl; } return Uri::mergeUrls($currentUrl, $uri); }
public function getAbsoluteUri($uri) { $baseUri = $this->baseUri; if (strpos($uri, '://') === false) { if (strpos($uri, '/') === 0) { return Uri::appendPath((string) $baseUri, $uri); } // relative url if (!$this->getHistory()->isEmpty()) { return Uri::mergeUrls((string) $this->getHistory()->current()->getUri(), $uri); } } return Uri::mergeUrls($baseUri, $uri); }
public function getAbsoluteUri($uri) { /** @var $baseUri Psr7Uri **/ $baseUri = $this->client->getConfig('base_uri'); if (strpos($uri, '://') === false) { return new Psr7Uri(Uri::appendPath((string) $baseUri, $uri)); } return Psr7Uri::resolve($baseUri, $uri); }