2017 © Pedro Peláez
 

library wp-browser

WordPress extension of the PhpBrowser class.

image

lucatume/wp-browser

WordPress extension of the PhpBrowser class.

  • Wednesday, June 6, 2018
  • by theAverageDev
  • Repository
  • 14 Watchers
  • 173 Stars
  • 224,818 Installations
  • PHP
  • 30 Dependents
  • 0 Suggesters
  • 39 Forks
  • 2 Open issues
  • 100 Versions
  • 8 % Grown

The README.md

wp-browser

You can use wp-browser to test WordPress sites, plugins and themes., (*1)

An easy and quick setup, with a default configuration that will work for most projects, run end-to-end tests, integration tests and unit tests all with the same tool., (*2)

This document refers to version 4 of the project. If you're using version 3 or version 3.5, and are looking for the migration and troubleshooting guide, you can find it [here][6], (*3)

Requirements

Depending on the nature of your project, there are different requirements it will need to satisfy before getting started., (*4)

Site

  • Ensure you're running the vendor/bin/codecept init wpbrowser command from the root directory of your WordPress site.
  • Ensure the directory contains the WordPress installation files. In a standard scenario you should have extracted WordPress files in this directory.
  • Ensure your installation is configured: it should contain a wp-config.php file.

Plugin

  • Ensure you're running the vendor/bin/codecept init wpbrowser command from the root directory of your plugin; this should be the directory that contains the PHP file defining the [plugin header][6].

Theme

  • Ensure you're running the vendor/bin/codecept init wpbrowser command from the root directory of your theme; this should be the directory that contains the style.css file defining [the theme header][7].

If you decide to use the quick installation, then your PHP version should have the sqlite3 extensions installed and activated. You can check this using the php -m command and verifying the sqlite3 extension is among the active extensions., (*5)

Installation

Add wp-browser to your project as a development dependency using Composer, (*6)

cd my-wordrpess-project
composer require --dev lucatume/wp-browser

Initialize wp-browser to quickly configured to suite your project and setup:, (*7)

vendor/bin/codecept init wpbrowser

The command will set up your project to run integration and end-to-end tests using:, (*8)

  • SQLite as the database engine, leveraging the SQLite Database Integration plugin
  • PHP built-in web server to serve the WordPress site on localhost (e.g. http://localhost:8080)
  • Chromedriver to drive the local version of Chrome installed on your machine

If you're working on a plugin or theme project, the default configuration will add some extra steps:, (*9)

  • install the latest version of WordPress in the tests/_wordpress directory
  • create a tests/_plugins directory: any file or directory in this directory will be symlinked into the WordPress installation in tests/_wordpress/wp-content/plugins
  • create a tests/_themes directory: any file or directory in this directory will be symlinked into the WordPress installation in tests/_wordpress/wp-content/themes

For most projects this configuration will be enough to get started with testing., (*10)

You can run your tests immediately using the vendor/bin/codecept run command., (*11)

Read more about the commands provided by the library here., (*12)

Using a custom configuration

If you decide to skip the default configuration, you will be able to set up wp-browser to suit your needs and local setup by editing the tests/.env file. The inline documentation in the file will guide you through the configuration process., (*13)

Read more about using a custom configuration here., (*14)

Getting support for wp-browser configuration and usage

The best place to get support for wp-browser is the project documentation.
Since this project builds on top of PHPUnit and Codeception, you can also refer to their documentation., (*15)

If you can't find the answer to your question here you can ask on the "Issues" section of the wp-browser repository taking care to provide as much information as possible., (*16)

Finally, you can contact me directly to set up a call to discuss your project needs and how wp-browser can help you., (*17)

Sponsors

A thanks to my sponsors: you make maintaining this project easier., (*18)

The Versions

14/02 2017

dev-fix/isolated-install-custom-paths

dev-fix/isolated-install-custom-paths http://github.com/lucatume/wp-browser

WordPress extension of the PhpBrowser class.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress codeception