Codeception

Codeception collects and shares the best practices and solutions for testing PHP web applications. With a flexible set of included modules, tests are easy to write, easy to use, and easy to maintain. Codeception encourages developers and QA engineers to concentrate on testing and not on building test suite.

Codeception for WordPress

You can find full installation instructions here.

First, install the latest stable WPBrowser package via Composer

composer require lucatume/wp-browser --dev

Then, while in the root of your plugin or theme where you've installed the codeception, run

vendor/bin/codecept init wpbrowser

This will set up a scaffolding for setting up various tests in your plugin/theme.