Skip to content

Commit

Permalink
add support multiple session
Browse files Browse the repository at this point in the history
  • Loading branch information
miya0001 committed Dec 24, 2016
1 parent fb6a609 commit 52bd9e7
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,7 +1,7 @@
language: php

php:
# - '7.1'
- '7.1'
- '5.6'

env:
Expand Down
17 changes: 16 additions & 1 deletion README.md
Expand Up @@ -93,13 +93,28 @@ Login as the administrator role and I should see "Dashboard".
```
Feature: I login as the specfic role
@javascript
Scenario: Login as the "administrator" role
When I login as the "administrator" role
Then I should see "Welcome to WordPress!"
```

Selenium2 driver can't retrieve the HTTP response.
So you have to use `@mink::goutte` tag like following.

```
Feature: HTTP response
@mink:goutte
Scenario: Check http status code
When I am on "/"
Then the HTTP status should be 200
When I am on "/the-page-not-found"
Then the HTTP status should be 404
```

Run to see contexts.

```
Expand Down
3 changes: 3 additions & 0 deletions behat.yml.dist
Expand Up @@ -18,7 +18,10 @@ default:
password: editor
Behat\MinkExtension:
base_url: http://127.0.0.1:8080
default_session: default
sessions:
default:
selenium2:
wd_host: http://127.0.0.1:4444/wd/hub
goutte:
goutte: ~
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -14,7 +14,8 @@
"behat/mink-extension": "~2.2",
"behat/mink-selenium2-driver": "~1.3.1",
"phpunit/phpunit": "^5.6",
"guzzlehttp/guzzle": "^6.2"
"guzzlehttp/guzzle": "^6.2",
"behat/mink-goutte-driver": "^1.2"
},
"require-dev": {
"phpspec/phpspec": "^3.1"
Expand Down
277 changes: 275 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions features/http-response.feature
@@ -1,5 +1,6 @@
Feature: HTTP response

@mink:goutte
Scenario: Check http status code

When I am on "/"
Expand All @@ -8,6 +9,7 @@ Feature: HTTP response
When I am on "/the-page-not-found"
Then the HTTP status should be 404

@mink:goutte
Scenario: Check http response headers

When I am on "/"
Expand Down

0 comments on commit 52bd9e7

Please sign in to comment.