Skip to main content

Drupal end-to-end testing with Behat

Overview

Code with confidence. Deploy without doubt. End-to-end testing provides you with the assurance that improvements to your site are not breaking anything else. And when changes do cause regressions, end-to-end tests point you to what needs to be fixed.

Behat makes it possible to set up end-to-end tests that can access Drupal's APIs for setup, context provisioning, and teardown.  And it does this with tests that can be read by project managers, product owners, and everybody else involved in the project, because each step is written in plain English.

This training will give you the setup that makes testing a realistic part of your day-to-day development.

Request a Private Training

What you will learn

  • What Behat is
    •  Gherkin syntax
    •  Behavior Driven Development
  • What dependencies are required for testing Drupal with Behat
    •  drupal/core-dev
    •  drupal/drupal-extension
  • How to set up your project for Behat testing
    •  Multi-site set up for testing against same codebase but not disturbing your main database
    •  DDEV with Selenium add-on
    •  Providing default content
    •  Making sure each test runs starts at a known state
  • How to write Behat tests
    •  How to find steps
    •  How to write new steps
    •  Behat hooks
    •  File downloads
    •  Using tags for test organization
  • How to run your tests
    •  Running single tests
    •  Running subsets across features using tags
    •  Running features
  • Tips and tricks for writing, running and debugging your tests
    •  'And I break' for debugging
    •  Using Selenium to watch where things are failing
  • Using Artificial Intelligence to help you write tests
    •  Determine what needs to be tested
    •  Prompt suggestions for generating better quality tests

Prerequisites

No previous experience with Behat is needed.

Setup instructions

A working Drupal 11 installation using DDEV will be provided.

This training will be provided over Zoom. You can ask questions via text chat or audio. Sharing your screen is optional, but you might want to do it to get assistance on a specific issue. Sharing your camera is optional.

What to expect

Women looking at map

Prior to the training

Attendees will receive detailed instructions on how to setup their development environment. In addition, they will be able to join a support video call days before the training event to make the the local development environment is ready. This prevents losing time fixing problems with environment set up during the training.

On the days of the training

  • The training totals 7 hours of instruction, which we usually split into 2 sessions
  • A team of developers available to answer questions and help with training-related issues

After the training

  • Attendees will receive a copy of the training recording.
  • Attendees will receive a certificate of completion.

Training FAQ

Here are some quick answers to Frequently Asked Questions about Agaric trainings.

Can I get a discount when purchasing more than one training?

Yes, a 15% discount is available for additional trainings. Contact Agaric after purchasing your first training to get the information needed to purchase second or third at a discount.

Are scholarships available?

Yes, partial and full scholarships are available! We are prioritizing people facing disadvantages, in particular survivors of historical and ongoing discrimination and people under-represented in technology. Contact Agaric with your circumstances and for more information. Agaric will review your submission internally only— we do not share the information you provide in determining your eligibility for a discount/scholarship with anyone outside Agaric.

What if my corporate employer cannot submit payment for my attendance before the training date? If your company sees the benefit of you getting training from Agaric but the accounts payable department will not be able to accommodate fulfilling payment prior to the training date, please contact us for an invoice due up to 90 days after the training.
I'm not sure I meet the prerequsites or will be able to set up a development environment.

Every training includes sessions ahead of time to help everybody get their local development environment set up before the training (if needed). We'll also direct you to other resources helpful for getting up to speed before the training. Contact Agaric to check in with where you are to get our help ensuring you get the full benefit of the training.

Can I cancel and get a refund?

No, we do not offer refunds but tickets are transferable and we'll help you re-sell the ticket, so please contact Agaric if you can't make the training.

Will I receive a recording or other materials?

Yes, all attendees will be sent recordings from the training as well as the curriculum and materials used in the training and additional books or other references and resources.

Will Agaric provide a certificate of completion?

Yes, all students who participate in the full training will receive a Certificate of Completion.

Have more questions? Ask Agaric!