Laravel 5.1 Behat and Codeship
The new integration testing features with Laravel 5.1 make Behat almost not needed BUT we do a lot of AngularJs work and instead of using karma to test the ui we enjoy using behat since we like the Gherkin Syntax and how we can easily code custom steps in PHP.
Here are some steps to getting behat going on CodeShip so you get full CI even of Angular.
This is all based off of https://github.com/laracasts/Behat-Laravel-Extension
Behat.yml behat.yml looks like this for me
default: extensions: Laracasts\Behat:
env_path: .env.behat
Behat\MinkExtension:
base_url: https://microservicehub.dev:44300
default_session: laravel
laravel: ~
selenium2:
wd_host: "http://192.168.10.1:4444/wd/hub"
browser_name: chrome
codeship:
extensions:
Laracasts\Behat:
env_path: .env.codeship
Behat\MinkExtension:
base_url: http://localhost:8080
default_session: laravel
laravel: ~
selenium2:
wd_host: "http://localhost:4444/wd/hub"
browser_name: chrome
This is so I can run it locally as needed. The CodeShip profile will then call in the .env.codeship and update the url as needed.
.env.codeship
This file has
APP_ENV=testing
APP_DEBUG=true
APP_KEY=f5edkkfijPDKQXPLHyYNDhiNZZrpT0Qd
DB_HOST=localhost
DB_DATABASE=test
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Link:
This post is submitted by our members. Submit a new post.
Tags: Tutorials Laravel 5.1 Laravel 5