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