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

Database: add support to delete generated database dumps after-scenario. #259

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e41a68c
Composer: remove unused packages.
paulgibbs Apr 6, 2019
beed8d2
Composer: update description.
paulgibbs Apr 6, 2019
7eaf320
Update readme project desc to match Composer desc.
paulgibbs Apr 6, 2019
e2968f3
CI: first pass at standardising project development local setup.
paulgibbs Apr 7, 2019
07dd7ee
CI: first steps at refactoring to support PHP and CLI drivers again.
paulgibbs Apr 7, 2019
8561b38
CI: add WP-PHP driver test run to CI config.
paulgibbs Apr 7, 2019
aa8796e
CI: test on PHP 7.1.* and PHP 7.3.*.
paulgibbs Apr 7, 2019
92aeb82
CI: add fake env vars to project to add label in CI UI.
paulgibbs Apr 7, 2019
5ece490
Adds 'page_template' as a whitelisted CLI arg
codereviewvideos Apr 9, 2019
f46c6ba
Work in progress: database dump deletion.
paulgibbs May 15, 2019
5479d54
Work in progress: database dump deletion.
paulgibbs Oct 20, 2019
5a5c5b5
Update Composer dependencies
paulgibbs May 15, 2019
c43fe8d
Docs: update WP-CLI requirement.
paulgibbs May 15, 2019
0c90ac5
Fix `ocramius/proxy-manager` Composer dependency.
paulgibbs May 15, 2019
0ab92a0
Features, Toolbar: fix Support Forums test for WP core changes.
paulgibbs May 15, 2019
79e275d
Page Objects: tidy up code for log in page.
paulgibbs May 15, 2019
5232755
Context, User: Ensure log-in page is not the first loaded page in the…
paulgibbs May 15, 2019
518758a
Context, User: code tidy-up.
paulgibbs May 15, 2019
b3b6340
Context, User: check "remember me" on log-in form.
paulgibbs May 15, 2019
08f7229
Context: do not restart Mink session after scenario.
paulgibbs May 24, 2019
99a4415
Revert "Context: do not restart Mink session after scenario."
paulgibbs May 30, 2019
ee0b78a
Contexts: fix orphaned browser windows failing tests.
paulgibbs May 31, 2019
da3811f
Update Composer dependencies to latest constrained versions.
paulgibbs Jun 4, 2019
6a65612
Bump readme
paulgibbs Jun 5, 2019
9b3b92c
Add basic support for Behat translations
paulgibbs Jun 8, 2019
ec825b6
i18n: add base translation file and tooling helper.
paulgibbs Jun 8, 2019
bb870e2
i18n: remove copypasta.
paulgibbs Jun 8, 2019
52096eb
Fix a documentation link
johnbillion Jun 14, 2019
d406473
Fix an undefined user ID variable when creating users with the wpphp …
johnbillion Jun 14, 2019
9990011
Docs: remove references to appveyor tests.
paulgibbs Jun 16, 2019
f42e82f
Update Composer dependencies to latest
paulgibbs Jun 16, 2019
9d9caac
Switch default Mink webdriver from Selenium to using Chrome directly.
paulgibbs Jun 22, 2019
25d4299
CI: add seperate Behat config file for CI runs.
paulgibbs Jun 22, 2019
09047da
CI: update Travis-CI for recent Selenium removal.
paulgibbs Jun 23, 2019
bc12bd6
CI: update Travis-CI for recent Selenium removal.
paulgibbs Jun 23, 2019
16b3b25
CI: try to configure CI feature folder location.
paulgibbs Jun 23, 2019
3526c33
CI: fix username/password and artifact path.
paulgibbs Jun 23, 2019
e666e0b
CI: fix type in Behat config
paulgibbs Jun 23, 2019
8d23833
Context, Edit Post: re-implement visual editor filling technique.
paulgibbs Jun 23, 2019
0a08226
Docs: general update/tidy-up; adjustments to mentions of Selenium.
paulgibbs Jun 23, 2019
313a427
Bump minimum PHP requirements from 7.1 to 7.2
paulgibbs Jun 23, 2019
0a21d27
Composer: remove pinned PHP 7.1-era dependancy.
paulgibbs Jun 23, 2019
0199d8c
Update readme
paulgibbs Jun 24, 2019
dc96080
Database: add support to delete generated database dumps after-scenario.
paulgibbs Oct 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space

[{.jshintrc,*.json,*.yml,*.xml,*.sh,*.conf,*.neon}]
[{.jshintrc,*.json,*.yml,*.xml,*.sh,*.conf,*.neon,*.xliff}]
indent_style = space
indent_size = 2

Expand Down
66 changes: 33 additions & 33 deletions .github/ISSUE_TEMPLATE/---report-a-bug.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
---
name: "\U0001F41B Report a bug"
about: Is something not working as you expected?

---

## Expected behaviour
> Describe the bug; what should happen?

## Current behaviour
> What happens instead of the expected behaviour?

## Possible solution
> Not obligatory, but you can suggest a fix/reason for the bug. Thanks!

## Steps to reproduce
> Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant.
1.
2.
3.
4.

## Context
> How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world.

## Your environment
> Include as many relevant details about the environment you experienced the bug in:

* WordHat version used:
* Environment name and version (e.g. PHP 7.1 on nginx 1.11.9):
* Server operating system type and version:
* Type of Behat browser used (e.g. Selenium, headless Chrome, etc):
* Link to your project:
---
name: "\U0001F41B Report a bug"
about: Is something not working as you expected?
---
## Expected behaviour
> Describe the bug; what should happen?
## Current behaviour
> What happens instead of the expected behaviour?
## Possible solution
> Not obligatory, but you can suggest a fix/reason for the bug. Thanks!
## Steps to reproduce
> Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant.
1.
2.
3.
4.
## Context
> How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world.
## Your environment
> Include as many relevant details about the environment you experienced the bug in:
* WordHat version used:
* Environment name and version (e.g. PHP 7.2 on nginx 1.11.9):
* Server operating system type and version:
* Type of Behat browser used (e.g. Selenium, headless Chrome, etc):
* Link to your project:
46 changes: 23 additions & 23 deletions .github/ISSUE_TEMPLATE/---request-a-feature.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
name: "\U0001F680 Request a feature"
about: Do you want to suggest a new feature, rule, or option?

---

## Expected behaviour
> If you're suggesting a change/improvement, tell us how it should work.

## Current behaviour
> If suggesting a change/improvement, explain the difference from current behaviour.

## Context
> How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world.

## Your environment
> Include as many relevant details about the environment you experienced the bug in:

* WordHat version used:
* Environment name and version (e.g. PHP 7.1 on nginx 1.11.9):
* Server operating system type and version:
* Type of Behat browser used (e.g. Selenium, headless Chrome, etc):
* Link to your project:
---
name: "\U0001F680 Request a feature"
about: Do you want to suggest a new feature, rule, or option?
---
## Expected behaviour
> If you're suggesting a change/improvement, tell us how it should work.
## Current behaviour
> If suggesting a change/improvement, explain the difference from current behaviour.
## Context
> How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world.
## Your environment
> Include as many relevant details about the environment you experienced the bug in:
* WordHat version used:
* Environment name and version (e.g. PHP 7.2 on nginx 1.11.9):
* Server operating system type and version:
* Type of Behat browser used (e.g. Selenium, headless Chrome, etc):
* Link to your project:
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ vendor/

.DS_Store
npm-debug.log
wp-cli.yml
/selenium.log

/tests/app/www
Expand Down
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ services:
- mysql

php:
- 7.1
- 7.2
- 7.3

cache:
apt: true
directories:
- $HOME/.composer/cache/files
- $HOME/.npm

git:
depth: 3
Expand All @@ -34,9 +34,12 @@ matrix:

env:
global:
- WP_WEBROOT="tests/app/www/"
- BEHAT_PARAMS="{\"extensions\":{\"Behat\\\\MinkExtension\":{\"base_url\":\"http://localhost:8000\"},\"PaulGibbs\\\\WordpressBehatExtension\":{\"path\":\"$WP_WEBROOT\"}}}"
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress --no-suggest --prefer-dist"
- WP_VERSION="~5.1"
- WP_WEBROOT="tests/app/www/"
matrix:
- LABEL="wpcli" BEHAT_PARAMS="{\"extensions\":{\"PaulGibbs\\\\WordpressBehatExtension\":{\"default_driver\":\"wpcli\"}}}"
- LABEL="wpphp" BEHAT_PARAMS="{\"extensions\":{\"PaulGibbs\\\\WordpressBehatExtension\":{\"default_driver\":\"wpphp\"}}}"

before_install:
- phpenv config-rm xdebug.ini
Expand All @@ -45,19 +48,16 @@ before_install:
install:
- travis_retry composer global require $DEFAULT_COMPOSER_FLAGS hirak/prestissimo
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS
- travis_retry composer require roots/wordpress ^5.1
- npm install selenium-standalone@latest -g
- selenium-standalone install
- travis_retry composer require roots/wordpress $WP_VERSION

# Start webserver.
- php -S localhost:8000 -t $WP_WEBROOT 2>/dev/null &
- sleep 10
- sleep 5
- scripts/install.sh

before_script:
# Start Selenium.
- xvfb-run --server-args="-screen 0 1920x1080x24" selenium-standalone start 2>&1 1>/dev/null &
- sleep 20
# Start Chrome.
- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 &
- sleep 5

script:
- curl -I http://localhost:8000
Expand Down
14 changes: 10 additions & 4 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ default:
- FailAid\Context\FailureContext

extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~

Behat\MinkExtension:
base_url: http://behat.local
browser_name: chrome
default_session: headless
javascript_session: javascript
sessions:
headless:
goutte:
guzzle_parameters:
verify: false # Allow self-signed SSL certificates
verify: false
javascript:
selenium2:
wd_host: "http://127.0.0.1:4444/wd/hub"
chrome:
api_url: http://localhost:9222
validate_certificate: false

PaulGibbs\WordpressBehatExtension:
default_driver: wpcli
Expand All @@ -39,7 +43,9 @@ default:
database:
restore_after_test: true
wpcli:
binary: ./vendor/bin/wp
binary: vendor/bin/wp
alias: dev
site_url: http://behat.local/wp/

FailAid\Extension:
screenshotDirectory: '%paths.base%/tests/artifacts'
Expand Down
18 changes: 11 additions & 7 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ default:
- PaulGibbs\WordpressBehatExtension\Context\ToolbarContext

extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~

Behat\MinkExtension:
base_url: http://your-wordpress-site.example.com
browser_name: chrome
default_session: default
javascript_session: selenium2
default_session: headless
javascript_session: javascript
sessions:
default:
headless:
goutte:
guzzle_parameters:
verify: false # Allow self-signed SSL certificates
selenium2:
selenium2: ~
verify: false
javascript:
chrome:
api_url: http://localhost:9222
validate_certificate: false

PaulGibbs\WordpressBehatExtension:
default_driver: wpcli
Expand All @@ -35,6 +39,6 @@ default:
roles:
- administrator
username: admin
password: admin
password: password
database:
restore_after_test: true
30 changes: 12 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "paulgibbs/behat-wordpress-extension",
"type": "behat-extension",
"description": "WordHat is a Behat extension, integrating Behat, Mink, and WordPress. It provides WordPress-specific functionality for common testing scenarios specific to WordPress sites.",
"description": "WordHat is a Behat extension for WordPress. It provides WordPress-specific functionality for common testing scenarios specific to WordPress sites.",
"keywords": [
"WordPress",
"behat",
"extension",
"bdd",
"mink"
"bdd"
],
"homepage": "https://wordhat.info",
"license": "GPL-3.0-or-later",
Expand All @@ -21,10 +20,7 @@
"config": {
"preferred-install": "dist",
"sort-packages": true,
"autoloader-suffix": "wordhat",
"platform": {
"php": "7.1"
}
"autoloader-suffix": "wordhat"
},
"autoload": {
"psr-4": {
Expand All @@ -36,25 +32,22 @@
},
"require": {
"behat/behat": "~3.1",
"php": "~7.1",
"php": ">=7.2 <7.4",
"sensiolabs/behat-page-object-extension": "~2.1",
"behat/mink-extension": "~2.3",

"ocramius/proxy-manager": "2.1"
"behat/mink-extension": "~2.3"
},
"require-dev": {
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "^1.3",
"dmore/behat-chrome-extension": "^1.3",
"genesis/behat-fail-aid": "^2.0",
"joomla-projects/selenium-server-standalone": "~3.5",
"phing/phing": "~2.16",
"phpstan/phpstan": "~0.9",
"squizlabs/php_codesniffer": "~3.0",
"wp-cli/wp-cli": "~1.5"
"wp-cli/wp-cli-bundle": "~2.1"
},
"suggest": {
"behat/mink-goutte-driver": "Headless Mink driver",
"behat/mink-selenium2-driver": "JS-enabled Mink driver (requires Selenium2)",
"behat/mink-selenium2-driver": "JS-enabled Mink driver (requires Selenium)",
"dmore/behat-chrome-extension": "JS-enabled Mink driver for Chrome (does not require Selenium)",
"genesis/behat-fail-aid": "Get more out of your test suite by getting it to work with you when tests fail."
},
"extra": {
Expand All @@ -72,14 +65,15 @@
"ci-tests": [
"@test:behat-ci"
],
"local-tests": [
"tests": [
"@test:behat-local"
],

"test:behat-ci": [
"vendor/bin/behat --colors --format progress"
"vendor/bin/behat --config tests/app/behat-ci.yml --colors --format progress"
],
"test:behat-local": [
"vendor/bin/behat --colors"
]
}
}
Loading