mitogh / wp-browser

Easy acceptance, functional, integration and unit testing for WordPress plugins, themes and sites using Codeception.

Home Page:https://wpbrowser.wptestkit.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wp-browser

Easy acceptance, functional, integration and unit testing for WordPress plugins, themes and sites using Codeception.

Build Status

wp-browser provides a Codeception based solution to test WordPress plugins, themes and whole sites at all levels of testing.

Find out more here in the documentation.

Installation and setup - the really fast version

Using Composer require wp-browser as a development dependency:

cd my-wordrpess-project
composer require --dev lucatume/wp-browser
vendor/bin/codecept init wpbrowser

Answer the questions and you will be ready to test your project. Find out more about the setup in the project documentation.

Usage

The project provides a number of modules to ease the testing of WordPress projects; you can find out more in the modules section of the documentation.
Here's a quick example acceptance test you can write:

// tests/acceptance/PrivatePostsCept.php
$I->haveManyPostsInDatabase(3, ['post_title' => 'Test post {{n}}', 'post_status' => 'private']);

$I->loginAs('subscriber', 'secret');
$I->amOnPage('/');
$I->see('Nothing found');

$I->loginAs('editor', 'secret');
$I->amOnPage('/');
$I->see('Test post 0');
$I->see('Test post 1');
$I->see('Test post 2');

This is just a bite though, find out more in the documentation.

About

Easy acceptance, functional, integration and unit testing for WordPress plugins, themes and sites using Codeception.

https://wpbrowser.wptestkit.dev/

License:GNU General Public License v3.0


Languages

Language:PHP 97.4%Language:HTML 1.0%Language:Makefile 0.9%Language:CSS 0.2%Language:Python 0.2%Language:Dockerfile 0.1%Language:Hack 0.0%