I'm just moving on to Codeception, for my acceptance tests.
Here is my accept.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
- \Helper\Acceptance
- Db
config:
WebDriver:
url: 'http://laravel.dev'
browser: 'phantomjs'
Db:
dsn: 'mysql:host=laravel.dev;dbname=test'
user: 'homestead'
password: 'secret'
The thing is when I use Webdriver, and I have an error in my tests, I get an error that doesn't help much:
[Facebook\WebDriver\Exception\WebDriverException]
JSON decoding of remote response failed.
Error code: 4
The response: 'Invalid Command Method - Request => {"headers": {"Accept":"application/json","Content-Length":"0","Content- Type":"application/json;charset=UTF- 8","Host":"127.0.0.1:4444"},"httpVersion
":"1.1","method":"GET","url":"/log/types","urlParsed": {"anchor":"","query":"","file":"types","directory":"/log/","path":"/log/t ypes","relative":"/log/types","port":"","host":"","password":"","user"
:"","userInfo":"","authority":"","protocol":"","source":"/log/types","que ryKey":{},"chunks":["log","types"]},"urlOriginal":"/session/44be5ec0- 1de2-11e6-ac4e-297abcf5a22b/log/types"}'
When I change WebDriver for Laravel5 (but the documentation says not to use it for acceptance tests.) My errors do not explain, for example:
1) AuthTestCept (tests/acceptance/AuthTestCept.php)
Step I click "#choose-account-0"
Fail Link or Button by name or CSS or XPath element with '#choose-account-0' was not found.
Scenario Steps:
3. $I->click("#choose-account-0") at tests/acceptance/AuthTestCept.php:33
2. $I->click("#google") at tests/acceptance/AuthTestCept.php:32
So, I'm a bit unhappy about this ... Any way to have clean errors using WebDriver ???