From 0f99034fc19ec44cf594728f5f443d0a8c15c357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Hennes?= Date: Thu, 15 Feb 2024 08:33:13 +0100 Subject: [PATCH] Release 2.4.5 --- changelog.txt | 4 +- eicaptcha.php | 15 +++--- tests/functionnal/.gitignore | 3 +- tests/functionnal/package-lock.json | 71 ++++++++++++++++++++------ tests/functionnal/package.json | 3 ++ tests/functionnal/playwright.config.ts | 9 ++-- 6 files changed, 76 insertions(+), 29 deletions(-) diff --git a/changelog.txt b/changelog.txt index 132e2dc..9930055 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,11 +1,11 @@ /** * Module Captcha * Add (re)captcha on contact and account creation forms - * © Hervé Hennes 2013-2023 + * © Hervé Hennes 2013-2024 * https://github.com/nenes25/eicaptcha * https://www.h-hennes.fr/blog/ */ - - V 2.4.5 - 2023-04-XX #229 Replace override of Authcontroller + - V 2.4.5 - 2024-02-15 #229 Replace override of Authcontroller #247 Registration check on prestashop 8.x #221 recaptcha v3 doesn't validate in form added with elementor form builder of warehouse theme #218 Harmonize and fix licence headers diff --git a/eicaptcha.php b/eicaptcha.php index c27c97d..3d9c56e 100644 --- a/eicaptcha.php +++ b/eicaptcha.php @@ -195,16 +195,17 @@ public function hookHeader(array $params) protected function renderHeaderV2() { if (( - $this->context->controller instanceof AuthController - && Configuration::get('CAPTCHA_ENABLE_ACCOUNT') == 1 + ( + $this->context->controller instanceof AuthController + || $this->context->controller instanceof RegistrationController + ) + && Configuration::get('CAPTCHA_ENABLE_ACCOUNT') == 1 ) || - ( ($this->context->controller instanceof ContactController - || Configuration::get('CAPTCHA_LOAD_EVERYWHERE') == 1 - ) && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1 ) + || Configuration::get('CAPTCHA_LOAD_EVERYWHERE') == 1 ) { $this->context->controller->registerStylesheet( 'module-eicaptcha', @@ -247,9 +248,9 @@ public function renderHeaderV3() { if ( ($this->context->controller instanceof ContactController - || Configuration::get('CAPTCHA_LOAD_EVERYWHERE') == 1 + && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1 ) - && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1 + || Configuration::get('CAPTCHA_LOAD_EVERYWHERE') == 1 ) { $publicKey = Configuration::get('CAPTCHA_PUBLIC_KEY'); $js = ' diff --git a/tests/functionnal/.gitignore b/tests/functionnal/.gitignore index 75e854d..6619af3 100644 --- a/tests/functionnal/.gitignore +++ b/tests/functionnal/.gitignore @@ -1,4 +1,5 @@ -node_modules/ +/node_modules/ /test-results/ /playwright-report/ /playwright/.cache/ +/.env \ No newline at end of file diff --git a/tests/functionnal/package-lock.json b/tests/functionnal/package-lock.json index 87dfa35..bb51ebe 100644 --- a/tests/functionnal/package-lock.json +++ b/tests/functionnal/package-lock.json @@ -1,40 +1,81 @@ { "name": "functionnal", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@playwright/test": { + "packages": { + "": { + "name": "functionnal", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "dotenv": "^16.3.1" + }, + "devDependencies": { + "@playwright/test": "^1.32.3" + } + }, + "node_modules/@playwright/test": { "version": "1.32.3", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.3.tgz", "integrity": "sha512-BvWNvK0RfBriindxhLVabi8BRe3X0J9EVjKlcmhxjg4giWBD/xleLcg2dz7Tx0agu28rczjNIPQWznwzDwVsZQ==", "dev": true, - "requires": { + "dependencies": { "@types/node": "*", - "fsevents": "2.3.2", "playwright-core": "1.32.3" }, - "dependencies": { - "playwright-core": { - "version": "1.32.3", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz", - "integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==", - "dev": true - } + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, - "@types/node": { + "node_modules/@playwright/test/node_modules/playwright-core": { + "version": "1.32.3", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz", + "integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==", + "dev": true, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@types/node": { "version": "18.15.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", "dev": true }, - "fsevents": { + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "optional": true + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } } } } diff --git a/tests/functionnal/package.json b/tests/functionnal/package.json index 872a5f6..0ee0430 100644 --- a/tests/functionnal/package.json +++ b/tests/functionnal/package.json @@ -9,5 +9,8 @@ "license": "ISC", "devDependencies": { "@playwright/test": "^1.32.3" + }, + "dependencies": { + "dotenv": "^16.3.1" } } diff --git a/tests/functionnal/playwright.config.ts b/tests/functionnal/playwright.config.ts index 6c521d6..3ca564c 100644 --- a/tests/functionnal/playwright.config.ts +++ b/tests/functionnal/playwright.config.ts @@ -4,22 +4,23 @@ import { defineConfig, devices } from '@playwright/test'; * Read environment variables from file. * https://github.com/motdotla/dotenv */ -// require('dotenv').config(); +require('dotenv').config(); /** * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ testDir: './e2e', - fullyParallel: true, + fullyParallel: false, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, - workers: process.env.CI ? 1 : undefined, + workers: 1, reporter: 'html', use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://www.prestashop74.local/tests/1786/', // Will need to be replaced by a CI or a local url to test + baseURL: process.env.CI_ENVIRONMENT_URL, // Will need to be replaced by a CI or a local url to test trace: 'on-first-retry', + screenshot: 'only-on-failure', }, /* Configure projects for major browsers */ projects: [