Code Monkey home page Code Monkey logo

behat-laravel-extension-example-app's Introduction

1. Install Dependencies

Have a look at the require-dev block in the composer.json file to see which dependencies you'll need to pull in:

"behat/behat": "~3.0@dev",
"behat/mink": "~1.6@dev",
"behat/mink-extension": "~2.0@dev",
"behat/mink-browserkit-driver": "~1.2@dev",
"laracasts/behat-laravel-extension": "dev-master"

2. Take a look at Behat.yml

Notice how, within this file, we load the LaravelExtension. As a parameter, you may also specify a custom Laravel 5 environment file that should be loaded. By default, the extension will look for a .env.behat file, however, you're free to change this.

This file should, like the .env file in your project root, contain any special environment variables for your tests (such as a special acceptance test-specific database).

3. Write Features

Check out features/bootstrap/example.feature for a quickie feature to get you started. Because our context (features/bootstrap/FeatureContext.php) is extending MinkContext, we already have a bunch of definitions out of the box.

You can always run behat -dl to see a full list.

Have fun!

example

behat-laravel-extension-example-app's People

Contributors

jeffreyway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

behat-laravel-extension-example-app's Issues

Set "show_cmd" parameter in behat.yml to be able to open page in browser (ex.: "show_cmd: firefox %s") (RuntimeException)

I am experiencing something strange in my experience. Usually behat works straight out the box with browserkit but I have run this example and if I run

Scenario:  Summary page displaying correctly                                                                                                              # features/example.feature:6
    Given I am on the homepage                                                                                                                                     # FeatureContext::iAmOnHomepage()
    Then show last response                                                                                                                                        # FeatureContext::showLastResponse()
      Set "show_cmd" parameter in behat.yml to be able to open page in browser (ex.: "show_cmd: firefox %s") (RuntimeException)
    Then I should see "Activity Summary"

Just to show it in bold the error displayed is
* Set "show_cmd" parameter in behat.yml to be able to open page in browser (ex.: "show_cmd: firefox %s") (RuntimeException)*

My behat.yml

default:
  extensions:
    Laracasts\Behat: ~
    #  env_path: .env.behat
    Behat\MinkExtension\ServiceContainer\MinkExtension:
      default_session: laravel
      base_url: 'http://localhost'
      laravel: ~ 

my .env.behat exists APP_ENV=acceptance

Any suggestions?

`Laracasts\Behat` extension file or class could not be located.

Hello,

I may be missing something, but on a totally fresh clone of this repo, then running composer install and composer update (mac, OSX yosemite running in homestead)

I get

  [Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException]  
  `Laracasts\Behat` extension file or class could not be located.               

Any help would be great, only I'm having a right ol' mare getting Laravel 5 and Behat 3 to work!

Thanks, DanC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.