Behat

Events happening in the community are now at Drupal community events on www.drupal.org.

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.

Including Behat tests in modules, especially Feature modules, and running independently and as part of a site or distribution

Posted by mlncn on March 26, 2018 at 4:17am

Here's what i'd like to do:

  • Include one or more .feature Behat tests in a contributed module
  • Have automated tests run with just this module and its dependencies installed
  • Optionally include these .feature Behat tests from the module when it is included in my site or installation profile automated tests, this time running with the full site installed
Read more

An easier way to run Gherkin tests?

Posted by Bevan on May 13, 2017 at 12:53am

I've used Behat on and off over the years. I love how useful the scenarios, gherkin and test results are, but hate maintaining the suite and writing step definitions; there so many arcane bugs that are hard to debug. And getting it running in CI environments is always a headache.

There must be an easier way. What about http://www3.obehave.io/?

Any other ideas?

Read more

Any Behat examples for testing the RedHen CRM?

Posted by e3g on March 15, 2017 at 1:32pm

I am just getting started testing a new Redhen CRM instance using Behat. I'm using the Drupal API. While writing tests is coming along nicely, I don't see how to write tests that target the CRM's native objects, contacts, orgs, and lists.

The only connection that has turned up between Behat and Redhen from searches is three extremely basic tests that were the result of a sprint on Redhen Raiser. These tests don't target anything unique about the CRM but test basic things like logging in to Drupal.

I would like to be able to write a test along the lines of:

Given individuals:
Read more
Categories:

Random access error while trying to use access restricted pages

Posted by mickaelperrin on December 3, 2016 at 1:56pm

Hi all,

I have open an issue on Github, but this is maybe a better place to discuss this.

I have setup around twenty scenarios, all run fine when I run them directly and independently.

However, when I run my test suite in my CI pipeline (or locally), some of them randomly fails.

The screenshot taken when the test fails shows me that the user is considered as anonymous despite the fact that the authentification step was marked as successful.

Can someone give me some hints to try to debug this ?

I have no idea where to search as each time the failing tests differs.

Thanks,

Read more

BeEdit - a Drupal 8 Behat Editor

Posted by jchin1968 on November 23, 2016 at 1:49am

As part of my Drupal 8 self-learning, I created a module called BeEdit which is a Behat editor suitable for non-technical users. It allows someone to create, edit and run Behat tests from the Drupal web application. You can get it here: https://www.drupal.org/sandbox/jchin1968/2829843

Read more
11 comments Categories:

PHP Fatal error: Undefined class constant 'Symfony\Component\DependencyInjection\ContainerInterface::SCOPE_CONTAINER'

Posted by ushashree_m on June 22, 2016 at 6:51am
drupalextension
0% (0 votes)
behat
100% (3 votes)
Total votes: 3
Categories:

How to test entity references and OG

Posted by clemens.tolboom on September 2, 2015 at 8:17am

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 more

Isolated-Drupal Behat Extension

Posted by thewilkybarkid on August 28, 2015 at 10:56am

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 more
Categories:

I can't seem to login as an admin on behat tests. Could anyone help point me in the right direction?

Posted by rgchi on July 9, 2015 at 2:46pm

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 more

Need to expose features available for Gherkin test writers

Posted by gram.steve on June 2, 2015 at 11:43am

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 more
1 comment Categories:

Forcontu is offering 10 x Drupal Training Scholarships

Posted by frankgil on March 18, 2015 at 11:21am

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 more
Categories: ,

Drupal MidCamp Training: Behavior Driven Development with Behat

Posted by lisa.rae on March 13, 2015 at 5:57pm
Start:
2015年03月19日 09:00 - 17:00 America/Chicago
Event type:
Drupalcamp or Regional Summit

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 more

Performance of Behat tests

Posted by greggles on March 11, 2015 at 3:16pm

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.
Read more

Behat 3.0 tips/tricks

Posted by sethcohn on February 5, 2015 at 2:54pm
Last updated by robert castelo on Fri, 2017年03月17日 19:22

A place to link/stash Behat 3.0 tips and tricks.

Read more

Behat 3.0 changes

Posted by sethcohn on February 5, 2015 at 2:53pm

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 more

Junit formatter for Behat 3.x

Posted by fen on January 6, 2015 at 9:16pm

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 more

Generic drupal feature files

Posted by eMuse_be on December 23, 2014 at 3:38pm

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 more
6 comments Categories:

Google hangout Session on Acquia Certification Program by Drupal Experts

Posted by rachit_gupta on December 14, 2014 at 8:22pm
Start:
2014年12月27日 11:00 - 12:30 Asia/Kolkata
Event type:
Training (free or commercial)

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 more

BADCamp 2014 BDD Summit - Accomplishments

Posted by moshe weitzman on November 17, 2014 at 9:46pm

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=0 for remote testing on Pantheon).
Read more
Categories: ,

Dinner with Drupal

Posted by xano on October 8, 2014 at 2:41pm
Start:
2014年10月28日 17:30 - 21:00 Europe/Amsterdam
Event type:
User group meeting

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 more
Categories:
Subscribe with RSS Syndicate content

Behat

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /