Skip to content

Commit f9cdc08

Browse files
test(5.9): Add test for wordpress 5.9
1 parent ae42956 commit f9cdc08

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

.github/workflows/end-to-end-test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
wp-version: [ 4.9, 5.7 ]
14+
wp-version: [ 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9 ]
1515
php-version: [ 7.2, 7.4 ]
1616
exclude:
1717
- { php-version: 7.4, wp-version: 4.9 }

docs/ddev.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@ ddev exec wp core install --url='https://wp565.ddev.site' --title='WordPress' --
8686

8787
### Test the module
8888

89+
#### Install the module
90+
91+
```
92+
cd wp-sources
93+
mkdir my-own-modules && mkdir my-own-modules/crowdsec-bouncer && cd my-own-modules/crowdsec-bouncer
94+
git clone git@github.com:crowdsecurity/cs-wordpress-bouncer.git ./
95+
ddev composer install --working-dir ./my-own-modules/crowdsec-bouncer
96+
cd wp-sources
97+
cp .ddev/additional_docker_compose/docker-compose.crowdsec.yaml .ddev/docker-compose.crowdsec.yaml
98+
cp .ddev/additional_docker_compose/docker-compose.playwright.yaml .ddev/docker-compose.playwright.yaml
99+
ddev start
100+
```
101+
102+
Login to the admin by browsing the url `https://wp565.ddev.site/admin` (username: `admin` and password: `admin123`)
103+
104+
Activate the CrowdSec plugin
105+
89106
#### End-to-end tests
90107

91108
```

tests/e2e-ddev/__tests__/1-activate-plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-undef */
2-
const { ADMIN_URL, WP58, WP57, WP56, WP55 } = require("../utils/constants");
2+
const { ADMIN_URL, WP59, WP58, WP57, WP56, WP55 } = require("../utils/constants");
33

44
const {
55
waitForNavigation,
@@ -19,7 +19,7 @@ describe(`Setup CrowdSec plugin`, () => {
1919
// "Plugins" page
2020
await wait(2000);
2121
await page.goto(`${ADMIN_URL}/plugins.php`);
22-
if (WP55 || WP56 || WP57 || WP58) {
22+
if (WP55 || WP56 || WP57 || WP58 || WP59) {
2323
await page.click("#activate-crowdsec");
2424
} else {
2525
await page.click('[aria-label="Activate CrowdSec"]');

tests/e2e-ddev/utils/constants.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ const { TIMEOUT } = process.env;
1414
const { CURRENT_IP } = process.env;
1515
const { PROXY_IP } = process.env;
1616
const OTHER_IP = "1.2.3.4";
17+
const WP59 = WORDPRESS_VERSION.startsWith("59");
1718
const WP58 = WORDPRESS_VERSION.startsWith("58");
1819
const WP57 = WORDPRESS_VERSION.startsWith("57");
1920
const WP56 = WORDPRESS_VERSION.startsWith("56");
2021
const WP55 = WORDPRESS_VERSION.startsWith("55");
2122
const WP54 = WORDPRESS_VERSION.startsWith("54");
2223
const WP53 = WORDPRESS_VERSION.startsWith("53");
24+
const WP52 = WORDPRESS_VERSION.startsWith("52");
25+
const WP51 = WORDPRESS_VERSION.startsWith("51");
26+
const WP50 = WORDPRESS_VERSION.startsWith("50");
27+
const WP49 = WORDPRESS_VERSION.startsWith("49");
28+
2329

2430
module.exports = {
2531
ADMIN_URL,
@@ -32,12 +38,17 @@ module.exports = {
3238
LAPI_URL_FROM_WP,
3339
LAPI_URL_FROM_PLAYWRIGHT,
3440
OTHER_IP,
41+
WP59,
3542
WP58,
3643
WP57,
3744
WP56,
3845
WP55,
3946
WP54,
4047
WP53,
48+
WP52,
49+
WP51,
50+
WP50,
51+
WP49,
4152
DEBUG,
4253
TIMEOUT,
4354
WATCHER_LOGIN,

0 commit comments

Comments
 (0)