Skip to content

Commit 1571dca

Browse files
committed
fix wp 5.7 compat
1 parent 02f1b88 commit 1571dca

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

tests/e2e/__tests__/0-setup-wordpress.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const {
22
ADMIN_LOGIN,
33
ADMIN_PASSWORD,
44
WORDPRESS_VERSION,
5+
WP57,
56
WP56,
67
WP55,
78
WP54,
@@ -25,7 +26,7 @@ describe(`Setup WordPress ${WORDPRESS_VERSION}`, () => {
2526
// Go to home
2627
await goToPublicPage();
2728

28-
if (WP54 || WP55 || WP56) {
29+
if (WP54 || WP55 || WP56 || WP57) {
2930
// "Language selection" page
3031
await page.click('option[lang="en"]');
3132
await page.click("#language-continue");
@@ -35,7 +36,7 @@ describe(`Setup WordPress ${WORDPRESS_VERSION}`, () => {
3536
// "Account creation" page
3637
await page.fill("#weblog_title", "My website");
3738
await page.fill("#user_login", ADMIN_LOGIN);
38-
if (WP53 || WP54 || WP55 || WP56) {
39+
if (WP53 || WP54 || WP55 || WP56 || WP57) {
3940
await page.fill("#pass1", ADMIN_PASSWORD);
4041
} else {
4142
await page.fill("#pass1-text", ADMIN_PASSWORD);

tests/e2e/__tests__/1-setup-plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const {
22
BOUNCER_KEY,
33
ADMIN_URL,
44
LAPI_URL_FROM_WP,
5+
WP57,
56
WP56,
67
WP55,
78
} = require("../utils/constants");
@@ -36,7 +37,7 @@ describe(`Setup CrowdSec plugin`, () => {
3637
// "Plugins" page
3738
await wait(2000);
3839
await page.goto(`${ADMIN_URL}/plugins.php`);
39-
if (WP55 || WP56) {
40+
if (WP55 || WP56|| WP57) {
4041
await page.click("#activate-crowdsec");
4142
} else {
4243
await page.click('[aria-label="Activate CrowdSec"]');

tests/e2e/utils/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const LAPI_URL_FROM_WP = process.env.LAPI_URL_FROM_WP;
1111
const DEBUG = !!process.env.DEBUG;
1212
const TIMEOUT = (!!process.env.DEBUG ? 5 * 60 : 15) * 1000;
1313
const OTHER_IP = "1.2.3.4";
14+
const WP57 = WORDPRESS_VERSION === "5.7";
1415
const WP56 = WORDPRESS_VERSION === "5.6";
1516
const WP55 = WORDPRESS_VERSION === "5.5";
1617
const WP54 = WORDPRESS_VERSION === "5.4";
@@ -24,6 +25,7 @@ module.exports = {
2425
ADMIN_PASSWORD,
2526
LAPI_URL_FROM_WP,
2627
OTHER_IP,
28+
WP57,
2729
WP56,
2830
WP55,
2931
WP54,

0 commit comments

Comments
 (0)