Getting up and running with Codeception tests locally in Chrome, Firefox or BrowserStack you need to be able to run your site locally first (take a look at Laravel Valet, it’s fast and requires almost no configurations).

Here are the requirements for mac:

  • Java 1.8
  • Homebrew
  • WP-CLI (latest version)
  • Composer (latest version)
  • Selenium server
    brew install selenium-server-standalone && brew services start selenium-server-standalone
  • Chrome driver
    brew install chromedriver && brew services start chromedriver

Once everything is installed, you need to create a new composer.json (or merge an existing one) with the following requirements:

Could not embed GitHub Gist f73df5530abea74ae8ae250adbec9b90: Not Found

After this file is created, you can run composer install and composer will take care of downloading all dependencies for you.

Here is a sample plugin to help you get started. You can copy the codeception.yml file and the tests/codeception directory into your own plugin or theme and use that as a template.

You are ready to run wp codeception run --debug at the root of your directory!