Given the interest shown at Drupalcon Portland with both a crowded session and BOF, the next step of fostering a growing use of Behat is to have a group of interested users/developers/etc. Behat, if embraced by enough Drupal folks, has the potential to vastly improve the way we test Drupal websites.
Behat IS NOT unit testing nor a specification testing tool. Behat is a Scenario-oriented BDD framework with functional testing capabilities as part of a communication process between stake-holders and developers. Behat was created and is evolving as an agile planning and functional testing methodology. However, if you want to use it as unit testing or spec testing tool, you can, but keep in mind, that it wasn't intended to do ideologically. http://groups.drupal.org/unit-testing is a better place for discussion of unit-testing. Yes, there is some overlap, but that is because of the spectrum in the testing pyramid with the various types of testing: unit tests (base), functional/acceptance tests (middle), (G)UI tests (peak)
Behat was created to address black-box like, functional, user-observable behavior testing.
How to test entity references and OG
We like to test Organic Group and their Content but are puzzled how to create related content.
Reading http://www.grasmash.com/article/behat-steps-organic-groups gives some clues but it's for Behat 2 and we did not manage to get that translated to Behat 3 yet.
Thinking about this basic need makes us wonder whether every site team has to add these steps themselves to their own context?
What would be the best way to share steps through the contrib modules?
Read moreIsolated-Drupal Behat Extension
We had some trouble using the Drupal Extension for Behat as scenarios aren't isolated from each other/what's already there, leading to sporadic failures. To counter this, we've put together an extension which causes each scenario to be run on a fresh install, leading to consistent (but slightly slower) builds. We've released it at https://github.com/elifesciences/isolated-drupal-behat-extension.
Read moreI can't seem to login as an admin on behat tests. Could anyone help point me in the right direction?
I'm trying to log create a scenario with a by logging in as a user in the administration role. I'm using the following as my first run to get my feet wet
$ cat first.feature
Feature: First
Playing with features and exploring
@api
Scenario: Run cron
Given I am logged in as a user with the "authenticated" role
When I run cron
And am on "admin/reports/dblog"
Then I should see the link "Cron run completed"However, on this I can't seem to get past the first step. When running this feature, I see the following error:
Read moreNeed to expose features available for Gherkin test writers
I need to find a way to create a list of all tests available for non technical gherkin test writers.
What are others using for this?
Read moreForcontu is offering 10 x Drupal Training Scholarships
Forcontu is offering 10 x Training Scholarships for the Expert in Drupal 7 online course (valued at USD1350). If you want to apply, complete the form before April 15, 2015. On April 16 we will announce the 10 winners of a scholarship to join the course completely free. The course will be conducted from May 4 to December 4 (7 months).
More information and registration at:
http://www.forcontu.com/en/10-drupal-training-scholarships
Read moreDrupal MidCamp Training: Behavior Driven Development with Behat
Promet Source will be conducting a full day of training at Drupal MidCamp next week for Behavior Driven Development with Behat.
This training workshop is designed to help developers get started with the process of behavior driven development (BDD) in PHP using the Behat toolkit with Drupal specific extensions in order to align technical testing with business expectations when using Drupal as a development platform.
We will be focusing on Behat 3, and the latest version of the Drupal Extension for Behat in our workshop.
Read morePerformance of Behat tests
When we started out using behat, things were great. Tests were easy to write and ran quickly. And then...over time, we got up to tests that took an hour to run. Which is too long.
We tried a few strategies:
- Throwing more hardware at the problem - this cut test speed in half, but was constrained by CPU speed.
- Reducing steps in afterScenario - we had placed a handful of different test cleanup steps into the afterScenario and those ran every time, even if they weren't needed. Optimizing those cut 30% off the test time for us.
Behat 3.0 tips/tricks
A place to link/stash Behat 3.0 tips and tricks.
Read moreBehat 3.0 changes
So I'm working with the new Behat 3.0 (and the latest Drupal Extension), and discovering how much has changed... For example, Metasteps? Gone. Lots of changes to how you call stuff, and so on.
So a lot of the existing (and awesome) code out there you'll find googling no longer works.
One example: take a screenshot when a step fails? The code is obsolete. I know it's doable, but I'm not sure how yet.
Is there a good place (yet?) to discover the 3.0 way of doing things, and a repository of good example code for doing 'all the things'?
Read moreJunit formatter for Behat 3.x
Does anyone have the junit formatter working with behat 3.x?
I suppose there is a related question: is anyone using Behat 3.x with D7 site builds or is 2.x still the way to go?
Read moreGeneric drupal feature files
Hi, I have set up a drupal structure using composer in git to kickstart our drupal development.
In the setup, behat and the DrupalExtension is integrated.
Our team will soon start writing tests for our websites. The generic tests (administrator permissions, Check if homepage works ...) will be put in our main git repo. I was wondering if there are other who have generic tests that are used on every drupal site, and if we could create a main repository ?
Read moreGoogle hangout Session on Acquia Certification Program by Drupal Experts
Dear All,
We are arranging for a Google hangout session where Drupal experts who have built the curriculum for Acquia certification and Drupal Developer who have taken the test will come on the same floor to talk on all you need to know about Drupal Acquia certification program. This will be an interactive session, you can ask questions and clarify your all your doubts.
Event URL - https://plus.google.com/events/c1bkr5q8id13k7nf6ncq7b214l0
Read moreBADCamp 2014 BDD Summit - Accomplishments
Drupal Extension and Contrib
- Jonathan Hedstrom et al worked on bug fixes and several feature additions to version 3 of the Drupal Extension. The Drush driver now allows global options to be passed through for all commands (such as
--strict=0for remote testing on Pantheon).
Dinner with Drupal
On Tuesday, October 28 we'll meer for another Dinner with Drupal. Between 17:30 and 18:30 a number of stand-up presentations will be given, after which we will have dinner and drinks at the venue. There are open spots for those who will want to demonstrate interesting new technologies or services, or who will want to pitch ideas. Please contact us, so we can put you in the schedule.
Read moreContributing behat tests to drupal.org?
Hello!
I'd like to start contributing some '.feature' files to modules on drupal.org and I'm trying to figure out if there's a standard way to do that so that they will be picked up when I run bin/behat to run my custom tests.
I see this documentation on subcontexts but it wasn't clear how to take advantage of that to run tests in a .feature file in a contrib.
Is there an example of a contrib module that has tests already and how to run them?
Read moreI just create a new module Merlin: Automatic Site builder and tester from a spreadsheet
Hello everyone,
I want to introduce you a new project I worked on : Merlin.
https://drupal.org/sandbox/churel/2160815
The global goal is to build automatically drupal components (content type, taxonomy, field etc...) and their BDD tests.
Example or examples using Zombie?
I've seen some discussion of and generic examples of using Zombie with behat. I haven't seen any examples of using it with the drupalextension. Has anyone had any success with Zombie and the drupalextension? If so can you share a gist? Thanks!
Read moreGetting started with Behat and Drupal: Resources Wiki
Here are a few things that are helping me get started:
- Very quick introduction video and step-by-step from Lin Clark
- Behat and Mink thorough review in Drupal Watchdog magazine
- Behat examples and snippets wiki
- A Discussion of the various behat modules/projects hosted on drupal.org including best practices for setting them up
Starting to use Drupal Extension is easy
Hi,
I made a little starter kit which help you starting Drupal Extension
https://github.com/tanarurkerem/DrupalExtensionStarterKit
I will be happy from your feedback.
Read moreAttempting Blackbox Driver Test
I have installed Behat on my pc and I am using the feature from the blackbox driver page @ http://dspeak.com/drupalextension/blackbox.html for my first Drupal site test.
Scenario 7 is failing:
Scenario: Error messages
# features\drupalcontext.feature:35
Given I am on "/user"
# FeatureContext::visit()
When I press "Log in"
# FeatureContext::pressButton()
Then I should see the error message "Password field is required"











