Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
Docs: general update/tidy-up; adjustments to mentions of Selenium.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgibbs committed Jun 23, 2019
1 parent f1205e5 commit 162ed23
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 72 deletions.
60 changes: 0 additions & 60 deletions docs/contributing/build.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/features/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WordHat provides WordPress-specific functionality for common testing scenarios t

For convenience, our `behat.yml.dist` configuration template loads all of our contexts by default, though Behat does support [more complex configuration](http://behat.org/en/latest/user_guide/configuration/suites.html) for advanced use cases.

To find out which step definitions are available for your tests, run `vendor/bin/behat -dl` in your terminal.
To find out which step definitions are available for your tests, run `vendor/bin/behat --definitions i` in your terminal.


## Drivers
Expand Down Expand Up @@ -45,7 +45,7 @@ The `SiteContext` context provides step definitions for activating/deactivating

### TinyMCE

The `EditPost` context provides step definitions to manage editing and creating content within wp-admin.
The `EditPost` context provides step definitions to manage editing and creating content within wp-admin. At time of writing, no support is yet provided for Gutenberg.

### Toolbar

Expand Down
9 changes: 3 additions & 6 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: How to get install Behat, WordPress, and WordHat

WordHat requires [PHP](https://php.net/) (version 7.1+), [Composer](https://getcomposer.org/), and a [WordPress](https://wordpress.org/) site to test (version 4.8+).

We strongly recommend using [WP-CLI](https://wp-cli.org/)[^1] \(version 2.1.0+), and [Selenium](http://www.seleniumhq.org/)[^2] to help with browser automation. Selenium is fiddly to set up, so we recommend using [vvo/selenium-standalone](https://github.com/vvo/selenium-standalone#command-line-interface), which requires the [Java Platform JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
We recommend using [WP-CLI](https://wp-cli.org/)[^1] \(version 2.1.0+).


## Installation
Expand All @@ -18,7 +18,7 @@ cd project</code></pre>
</li>

<li>Tell <a href="https://getcomposer.org/">Composer</a> to download WordHat:
<pre><code>composer require --dev paulgibbs/behat-wordpress-extension behat/mink-goutte-driver behat/mink-selenium2-driver</code></pre>
<pre><code>composer require --dev paulgibbs/behat-wordpress-extension behat/mink-goutte-driver dmore/behat-chrome-extension</code></pre>
</li>

<li>Copy WordHat's sample configuration file into your <code>project</code> folder and rename it:
Expand All @@ -41,7 +41,7 @@ cd project</code></pre>
</li>

<li>To confirm that everything is set up correctly, run:
<pre><code>vendor/bin/behat -dl</code></pre>
<pre><code>vendor/bin/behat --definitions i</code></pre>
If it worked, you will see a list of text that looks a little like the following (but much longer):
<pre><code>Given I am an anonymous user
Given I am not logged in
Expand All @@ -60,6 +60,3 @@ Now that you have WordHat set up, we recommend reading our [introduction to Beha

[^1]:
The WP-CLI executable *must* be named `wp` and be within your system's <a href="https://en.wikipedia.org/wiki/PATH_(variable)" id="WP-CLI">$PATH</a>.

[^2]:
Selenium is recommended for testing <a href="http://mink.behat.org/en/latest/guides/drivers.html" id="SEL">websites that require Javascript</a>. Behat requires the [Mink Selenium2 library](https://packagist.org/packages/behat/mink-selenium2-driver), which we include in the installation instructions above.
2 changes: 1 addition & 1 deletion docs/getting-started/wordhat-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Otherwise, if you are unsure how to proceed, first check the [FAQ](/recipes/faq.

One of the fun things about using Behat is seeing it control your web browser and navigating your site. Behat relies on a library called [Mink](http://mink.behat.org/en/latest/) to interface with your web browser. Mink has its own driver system, with [each driver supporting a different combination of browser features](http://mink.behat.org/en/latest/guides/drivers.html#driver-feature-support).

Some Mink drivers run headless web browsers (e.g. Goutte), and these tend to be the fastest, though notably, most do not support Javascript. WordHat's sample configuration file is configured to use [Selenium](http://www.seleniumhq.org/), which supports a broad range of browser features for most use cases. Selenium is fiddly to set up, so we recommend using [vvo/selenium-standalone](https://github.com/vvo/selenium-standalone#command-line-interface).
Some Mink drivers run headless web browsers (e.g. Goutte), and these tend to be the fastest, though notably, most do not support Javascript. WordHat's sample configuration file is configured to use Google Chrome by default, which supports a broad range of browser features for most use cases.

For tests requiring Javascript interactions, mark the scenario or feature with the `@javascript` [tag](http://behat.org/en/latest/user_guide/organizing.html#tags).

Expand Down
5 changes: 3 additions & 2 deletions docs/recipes/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: WordHat frequently asked questions and answers
If you are new to the project or Behat, we recommend that you first [read through our documentation](https://wordhat.info/). For any questions, feedback, or to contribute, you can get in contact with us via Github or our [Slack](https://wordhat.herokuapp.com).

## Browsers
* If you are using [Selenium](http://docs.seleniumhq.org/download/) to run Javascript tests, and you access your WordPress site over HTTPS, *and* your site has a self-signed certificate, you will need to manually configure the web browser to accept that certificate.
* If you are using [Selenium](http://docs.seleniumhq.org/download/) to run Javascript tests, and you access your WordPress site over HTTPS, *and* your site is using a self-signed HTTPS certificate, you will need to manually configure the web browser to accept that certificate.

## Drivers
* If you are using the WP-CLI driver to [connect to a remote WordPress site over SSH](https://make.wordpress.org/cli/handbook/running-commands-remotely/), WordHat assumes the remote server is Linux-like, with a shell that provides [GNU Coreutils](https://www.gnu.org/software/coreutils/coreutils.html).
Expand All @@ -13,13 +13,14 @@ If you are new to the project or Behat, we recommend that you first [read throug

## Selenium
* On a Mac, Selenium is incompatible with the default Apple Java; error messages look like "Unsupported major.minor version 52.0". To fix, install [Oracle Java Platform JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
* With Selenium, some environments may require a "webdriver"; error messages may refer to "GeckoWebDriver" or "ChromeWebDriver", etc. Good solutions include [vvo/selenium-standalone](https://github.com/vvo/selenium-standalone#command-line-interface) or [joomla-projects/selenium-server-standalone](https://github.com/joomla-projects/selenium-server-standalone).
* Selenium is fiddly to set up, so we recommend using [vvo/selenium-standalone](https://github.com/vvo/selenium-standalone#command-line-interface) to install and run it.

## Supported platforms
* WordHat supports MacOS, most flavours of Linux, and Windows. We use [Travis-CI](https://travis-ci.org/paulgibbs/behat-wordpress-extension) to test on Ubuntu, and require modern versions of PHP.

## Virtual machines (Vagrant)
* If you are using a Vagrant-powered virtual machine to run Behat via the [WP-CLI driver](../features/overview.html#wp-cli), you will need to `vagrant ssh` into the box once. This will set up password-less authentication; otherwise, WordHat will prompt you for the SSH password frequently.
* If you are using the WP-CLI driver to [connect to a Vagrant-powered WordPress site over SSH](https://make.wordpress.org/cli/handbook/running-commands-remotely/), you will probably have better performance by switching to use the WP-PHP driver. This is because [WP-CLI is slow at opening SSH connections to Vagrant boxes](https://github.com/wp-cli/wp-cli/pull/5235).

## WordPress
* If your WordPress is installed in a subdirectory, you need to set the `site_url` option to the value of the "WordPress address (URL)" option (found in WordPress > Settings > General). For more information, [consult the WordHat documentation](/configuration/settings.html).
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ nav:
- Errors W800-899: recipes/errors/w800-899.md
- Open Source:
- Contributing: contributing/open-source.md
- Build Process: contributing/build.md
- Credits: credits.md
- License: license.md
- News: changelog.md
Expand Down

0 comments on commit 162ed23

Please sign in to comment.