Skip to content

Instantly share code, notes, and snippets.

@xurizaemon
Last active July 17, 2020 01:47
Show Gist options
  • Save xurizaemon/268814d9c9a9d88cbaed76d738c6beb2 to your computer and use it in GitHub Desktop.
Save xurizaemon/268814d9c9a9d88cbaed76d738c6beb2 to your computer and use it in GitHub Desktop.
examples for behat question
default:
suites:
default:
paths:
- '%paths.base%/features'
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
extensions:
Bex\Behat\ScreenshotExtension:
image_drivers:
local:
screenshot_directory: /vagrant/tests/screenshots
clear_screenshot_directory: true
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension:
Drupal\DrupalExtension:
api_driver: 'drupal'
drupal:
drupal_root: '/vagrant/web'
drush:
root: '/vagrant/web'
blackbox: ~
text:
username_field: 'E-mail or username'
password_field: 'Password'
log_out: "Log out"
log_in: "Log in"
selectors:
message_selector: '.messages'
error_message_selector: '.messages.error'
success_message_selector: '.messages.status'
logged_in_selector: '.logged-in'
region_map:
navigation: "#block-system-main-menu"
header: ".header-top"
content: ".region-content"
footer: ".region-footer"
Drupal\MinkExtension:
ajax_timeout: 5
browser_name: chrome
base_url: http://0.0.0.0:8080/
sessions:
default:
chrome:
socket_timeout: 10
api_url: "http://localhost:9222"
dom_wait_timeout: 5000
rpkamp\Behat\MailhogExtension:
base_url: http://localhost:8025
example:
extensions:
Drupal\MinkExtension:
base_url: http://example.local:8080/
Drupal\DrupalExtension:
drush:
alias: 'example.local'
region_map:
navigation: "#block-system-navigation"
ci:
suites:
default:
paths:
- '%paths.base%/features'
extensions:
Bex\Behat\ScreenshotExtension:
image_drivers:
local:
screenshot_directory: '%paths.base%/../../screenshots'
Drupal\DrupalExtension:
api_driver: 'drupal'
drupal:
drupal_root: '%paths.base%/../../web'
drush:
root: '%paths.base%/../../web'
Drupal\MinkExtension:
base_url: http://0.0.0.0:80
rpkamp\Behat\MailhogExtension:
base_url: http://mailhog:8025
formatters:
pretty:
output_decorate: true
junit:
output_path: 'reports/junit'
{
"name": "example/example",
"type": "project",
"description": "Example project",
"license": "proprietary",
"authors": [
{
"name": "Chris",
"email": "[email protected]"
}
],
"require": {},
"require-dev": {
"behat/behat": "^3.7",
"bex/behat-screenshot": "^2.1",
"cweagans/composer-patches": "^1.6",
"dmore/behat-chrome-extension": "^1.3",
"drupal/coder": "^8.2",
"drupal/drupal-driver": "dev-master",
"drupal/drupal-extension": "^4.1",
"ergebnis/composer-normalize": "^2.5",
"php-http/guzzle6-adapter": "^2.0",
"php-http/message": "^1.8",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpro/grumphp": "^0.18",
"rpkamp/mailhog-behat-extension": "^0.6.4",
"sensiolabs/security-checker": "^6.0",
"squizlabs/php_codesniffer": "^3.5",
"zaporylie/composer-drupal-optimizations": "^1.1"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
@example @booking @member @api @javascript
Feature: Example Feature
Background:
Given I create a Commerce Percent Coupon with code 50percent and percent 50
@localfailure
Scenario: First test fails
Given I am logged in as a user with the "coach" role
@offpeak @lane
Scenario: member, off-peak, lane is $20
Given I am logged in as a user with the "member" role
And I am at "/booking"
And I select weekday 2 of month 2 week 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment