Testing with Codeception

Craft 3.2 and later supports automated testing with Codeception. In this course we learn how to setup and use Codeception for automated acceptance and functional testing of our Craft CMS website projects. If you've never set up acceptance testing for a web project before then this course will get you up and running quickly. Don't hope; test!

Start Course
Ryan Irelan

I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.

Testing with Codeception is made up of the following videos:

1 Installing and Configuring Codeception in Craft Learn how to install and configure Codeception for Craft CMS 09:31
2 Creating Your First Acceptance Test We start with a basic acceptance test to make sure the login form works. 08:28
3 Adding Multiple Tests in an Acceptance Suite We add additional tests to the suite and learn how to use the dontSee method. 07:24
4 Checking for a Set Cookie in an Acceptance Test We add a new test file to our suite and check for a cookie during the registration process on the site. 07:43
5 Reusing Code with the _before Method, comment methods, and steps mode We enhance our existing tests by reusing some code with the _before method, add comments using the comment methods and learn how to run tests using the steps mode. 06:08
6 Sharing Code Across the Test Suite with Custom Actions We learn how to create custom actions in the AcceptanceTester class to share code across the entire suite. 06:02
7 Testing forms in Codeception with submitForm Sometimes you don't want to fill out each form field one-by-one in your test. That's where the submitForm method comes in! 03:28
8 Debugging Tests in Codeception How to debug tests in Codeception when a test doesn't do what we think it should. Learn about debug mode, interactive shell, and verbose mode. 07:36
9 Using Selenium and the Chrome WebDriver We put the PhpDriver aside and install Selenium and Chrome WebDriver so we can run our acceptance tests in a real web browser. 09:41
10 Running Codeception Tests in PhpStorm PhpStorm has built-in support for Codeception. Here's how you can configure it to run tests from the same place you write code. 05:28
11 Running Codeception Tests in VS Code Running tests in VS Code requires an extension but then you get easy simpler access to your tests right from the app. 01:44
12 Multi-Environment Testing in Codeception Codeception environments allow us to define different settings for the same suite of tests. Choose a different target site, browser, or any other valid setting. 05:15