This is an example hookah integration with laravel app.
Composer dependencies are cached on wercker.
You can directly apply this patch
file if its easy or just copy the tests\Smoke folder and adapt it to your application.
-
Add
"yipl/hookah": "~0.4"to your require-dev part of composer.json -
Run
composer update --prefer-dist, push your lock file too when you push the change. -
Check if the tests are in a namespace, in your composer.json file. If not change it to below:
"autoload-dev": {
"psr-4": {
"Test\\": "tests"
}
},
- Change the base URL at 2 places (yes its quite lame but that's the price we paid for simplicity), first in
ApplicationSmokeTestCaseat line 9 for front end tests without logging in, andApplicationUserSmokeTestCaseat line 12 for back end tests for logged in users.
protected $baseUrl = 'http://laravel5-geshan.rhcloud.com/';
You can test the changes in local/development or your staging/live environment too by changing the above URL.
- Then change the following as per need in
ApplicationUserSmokeTestCase, we assume the variables are descriptive enough :)
/**
* @var string
*/
protected $loginPath = 'auth/login';
/**
* @var string
*/
protected $usernameField = 'email';
/**
* @var string
*/
protected $passwordField = 'password';
/**
* @var string
*/
protected $submitButtonText = 'Login';
/**
* @var array
*/
protected $users = [
['role'=> 'admin', 'identifier' => '[email protected]', 'password' => '123admin'],
];
/**
* @var string
*/
protected $loggedInLinkText = 'Logout';
-
Rename
ApplicationSmokeTestCaseandApplicationUserSmokeTestCaseto your application name for theApplicationword likeResourceContractsSmokeTestCaseandResourceContractsUserSmokeTestCase. -
Open
AdminUserTestextend it fromResourceContractsUserSmokeTestCaseand adjust class use accordingly. -
Adjust the backed user test-case path as per your application paths.
$adminPaths = [
['home', 200],
['logged-in', 200],
['not-existing', 404]
];
- Open
AdminUserTestextend it fromResourceContractsUserSmokeTestCaseand adjust class use accordingly. - Adjust the front end user test cases as per your application paths:
return [
[$this->baseUrl, 200],
['about', 200],
['auth/login', 200],
['auth/register', 200],
['not-existing', 404],
['.git', 404],
];
- Run your tests with
/vendor/bin/phpunitthey should be fine like below :

