/Users/luca/Sites/wordpress/wp-content/plugins/acme-plugin
in the example, run the command:codecept
) in the vendor
folder of my project.codecept init wpbrowser
command will ask but, for sake of brevity and space, there's no way I could provide inline a deeper explanation of each.ui
, rest
and user
.service
.integration
..env
to store the configuration parameters..env.tests
, .env.codeception
and similar.wp-load.php
file./Users/luca/Sites/wordrpress
, or a path relative to the folder where Codeception is installed like vendor/wordpress
./Users/luca/Sites/wordpress
in the example configuration above./Users/luca/Sites/wordpress
/var/www/html
folder/Users/luca/Sites/wordpress
, if I run the tests from within the Docker container then WordPress root folder will be /var/www/html
./Users/luca/Local\ Sites/wordpress/app/public
/app/public
./../../../wordpress
and will attempt to resolve them./wp-admin
but you might have the web-server, or a plugin, redirect or hide requests for the administration area to another path./admin
, /login
and the like.wordpress
.http://localhost:8080
.I want to underline the word "test". Any site and any database you use and expose to wp-browser should be intended for tests; this means that it does not contain any data you care about as it will be lost.
127.0.0.1:3306
.127.0.0.1
) on MySQL default port (3306
).192.168.92.100:4050
(from the site "Database" tab); the same principle applies if I am using a Vagrant-based or Docker-based solution.localhost
or 1270.0.0.1
.root
as I'm using MySQL server root user to access the database during tests.wp_
; that value is taken from the WordPress installation configuration file.wp-config.php
file directly: it's the value of the $table_prefix
variable.tests
.127.0.0.1:3306
.root
.wp_
.http://localhost:8080
.[email protected]
.Acme Plugin Test Site
.admin
.http://localhost:8080/wp-admin
in my example.password
.http://localhost:8080/wp-admin
in my example.both
(for "a combination of both") then you'll be able to choose the plugins and theme to load in integration and WordPress "unit" tests in the following questions.plugin
to the question Are you testing a plugin, a theme or a combination of both?.
In my example setup it's acme-plugin/plugin.php
.<folder>/<main-plugin-file>.php
path, relative to the WordPress installation plugins folder, to the plugin you are testing.theme
to the question Are you testing a plugin, a theme or a combination of both?.
Enter yes
if you are developing a child theme.Please note that wp-browser will not download and install the parent theme in the WordPress installation for you.
both
to the question Are you testing a plugin, a theme or a combination of both?.
Enter yes
if you are using a child theme.Please note that wp-browser will not download and install the parent theme in the WordPress installation for you.
yes
to the question Are you developing a child theme?.twentyseventeen
.Please note that wp-browser will not download and install the parent theme in the WordPress installation for you.
theme
to the question Are you testing a plugin, a theme or a combination of both?.
Reply with the slug of the theme, that's usually the name of the folder the theme lives in, e.g. twentyseventeen
.both
to the question Are you testing a plugin, a theme or a combination of both?.
Reply with the slug of the theme you are using, that's usually the name of the folder the theme lives in, e.g. twentyseventeen
.<plugin-folder>/<plugin-main-file>.php
; in the case of WooCommerce it would be woocommerce/woocommerce.php
.Please note that wp-browser will not download and install the required plugins in the WordPress installation for you.
tests/<suite>.suite.yml
; e.g. the wpunit
suite configuration file will be tests/wpunit.suite.yml
file.tests/acceptance.suite.yml
file and in the tests/functional.suite.yml
file, the configuration file for the acceptance
and functional
suites respectively, the WPDb
module configuration contains a dump
configuration parameter:dump
parameter is inherited by the WPDb
module from the Codeception Db
module and defines the SQL dump file that should be loaded before, and between, tests to reset the testing environment to a base known state.mysql
binary is not a requirement.acceptance
, functional
, integration
and unit
. If you have modified the default suite names during the setup your suites names might differ though.codecept run
command:codecept run
(without specifying the suite names)? See the FAQ entry.