Testing framework: Codeception
How to open a url/webpage in codeception acceptance testing ?
Testing framework: Codeception
How to open a url/webpage in codeception acceptance testing ?
On
You should have a webdriver enabled in your config for the suite you are using. Usually PhantomJS or Selenium for acceptance testing. You should also set a base URL. i.e.:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://localhost/'
browser: phantomjs
There are two commands:
amOnPage($page) - appends $page to URL and opens
amOnUrl($URL) - opens $URL directly
So with the above config:
$I->amOnPage("works"); //opens http://localhost/works
$I->amOnPage("http://localhost/dontwork"); //error!
$I->amOnUrl("http://localhost/works"); //opens http://localhost/works
You can open an url directly by method: amOnPage
PHP-Browser
If you are using Selenium you can see here: WebDriver