Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just adding some more details #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ Here, is where we reference the Laravel extension, and tell Behat to use it as o
This file should, like the standard `.env` file in your project root, contain any special environment variables
for your tests (such as a special acceptance test-specific database).


# 3. Write Some Features

Finally run `vendor/bin/behat --init` to setup your folders.

Now at the root of your app is an acceptance folder. In there is where you can place your tests. For example

~~~
features/foo.feature
~~~


![example](https://dl.dropboxusercontent.com/u/774859/Work/BehatLaravelExtension/example.png)

You're all set to go! Start writing some features. If you want a quick dummy example to get you started, refer to [this project](https://github.com/laracasts/Behat-Laravel-Extension-Example-App).
Expand Down Expand Up @@ -137,6 +147,33 @@ If working along, you can dump that variable to see all of the various fields th

Even better, after each scenario completes, we'll go ahead and empty out your MailTrap inbox for convenience.

## Selenium

First install Selenium on your machine and run that Java jar file in a ternminal. You can then update your behat.yml as below. One it sets the host url you are testing if you are not running tests against localhost.

Also, seen below, is Selenium being used on my host machine, if I want to run the tests inside of my homestead (guest). It will then connect to the host machines Selenium server and open chrome on my machine, by default it is Firefox. Of course you would need to install the mink driver for this by running

```
composer require behat/mink-selenium2-driver
```

The add this if you want it these settings

```
default:
extensions:
Laracasts\Behat:
# env_path: .env.behat
Behat\MinkExtension:
base_url: https://mysite.dev
default_session: laravel
laravel: ~
selenium2:
wd_host: "http://192.168.10.1:4444/wd/hub"
browser_name: chrome

```

## FAQ

### I'm getting a "PHP Fatal error: Maximum function nesting level of '100' reached, aborting!" error.
Expand Down