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:

1Installing and Configuring Codeception in CraftLearn how to install and configure Codeception for Craft CMS 09:31
2Creating Your First Acceptance TestWe start with a basic acceptance test to make sure the login form works. 08:28
3Adding Multiple Tests in an Acceptance SuiteWe add additional tests to the suite and learn how to use the dontSee method. 07:24
4Checking for a Set Cookie in an Acceptance TestWe add a new test file to our suite and check for a cookie during the registration process on the site. 07:43
5Reusing Code with the _before Method, comment methods, and steps modeWe 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
6Sharing Code Across the Test Suite with Custom ActionsWe learn how to create custom actions in the AcceptanceTester class to share code across the entire suite. 06:02
7Testing forms in Codeception with submitFormSometimes 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
8Debugging Tests in CodeceptionHow 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
9Using Selenium and the Chrome WebDriverWe put the PhpDriver aside and install Selenium and Chrome WebDriver so we can run our acceptance tests in a real web browser. 09:41
10Running Codeception Tests in PhpStormPhpStorm 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
11Running Codeception Tests in VS CodeRunning tests in VS Code requires an extension but then you get easy simpler access to your tests right from the app. 01:44
12Multi-Environment Testing in CodeceptionCodeception 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