From ab0097877b09433f4810372093831ed304db1424 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Thu, 29 May 2025 20:22:04 +0100 Subject: [PATCH 1/2] Bump selenium to version 4 This will align default Selenium version with moodle-docker. Fixes #352 --- docs/CHANGELOG.md | 3 +++ src/Command/BehatCommand.php | 4 ++-- tests/Command/BehatCommandTest.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 0780bb26..c9419203 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). The format of this change log follows the advice given at [Keep a CHANGELOG](https://keepachangelog.com). ## [Unreleased] +### Changed +- Bump default Selenium version to 4. + ## [4.5.7] - 2025-03-26 ### Changed - Allow to run with PHP 8.4 (supported in Moodle 5.0) diff --git a/src/Command/BehatCommand.php b/src/Command/BehatCommand.php index b2c600c5..56d218db 100644 --- a/src/Command/BehatCommand.php +++ b/src/Command/BehatCommand.php @@ -223,13 +223,13 @@ private function getSeleniumImage(InputInterface $input, string $profile): strin } if ($profile === 'chrome') { - return getenv('MOODLE_APP') ? 'selenium/standalone-chrome:120.0' : 'selenium/standalone-chrome:3'; + return 'selenium/standalone-chrome:4'; } if ($this->usesLegacyPhpWebdriver()) { return 'selenium/standalone-firefox:2.53.1'; } - return 'selenium/standalone-firefox:3'; + return 'selenium/standalone-firefox:4'; } } diff --git a/tests/Command/BehatCommandTest.php b/tests/Command/BehatCommandTest.php index 1be1714f..7b17625a 100644 --- a/tests/Command/BehatCommandTest.php +++ b/tests/Command/BehatCommandTest.php @@ -94,7 +94,7 @@ public function testExecuteWithChromeProfile() $commandTester = $this->executeCommand(null, null, ['--start-servers' => true, '--profile' => 'chrome']); $this->assertSame(0, $commandTester->getStatusCode()); - $this->assertMatchesRegularExpression('/selenium\/standalone-chrome:3/', $this->allCmds[1]); + $this->assertMatchesRegularExpression('/selenium\/standalone-chrome:4/', $this->allCmds[1]); } public function testExecuteWithFirefoxProfile() @@ -104,7 +104,7 @@ public function testExecuteWithFirefoxProfile() $commandTester = $this->executeCommand(null, null, ['--start-servers' => true, '--profile' => 'firefox']); $this->assertSame(0, $commandTester->getStatusCode()); - $this->assertMatchesRegularExpression('/selenium\/standalone-firefox:3/', $this->allCmds[1]); + $this->assertMatchesRegularExpression('/selenium\/standalone-firefox:4/', $this->allCmds[1]); } public function testExecuteWithLegacyFirefoxProfile() From 229b48558487f06dbce7be727ca27b7abcca0f53 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Thu, 29 May 2025 20:35:43 +0100 Subject: [PATCH 2/2] Add MOODLE_500_STABLE to GHA/Travis tests --- .github/workflows/test.yml | 6 ++++++ .travis.yml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4addc22..ae86bedc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,6 +78,9 @@ jobs: - php: '8.4' moodle-branch: 'main' moodle-app: 'true' + - php: '8.4' + moodle-branch: 'MOODLE_500_STABLE' + moodle-app: 'true' - php: '8.3' moodle-branch: 'MOODLE_405_STABLE' moodle-app: 'true' @@ -205,6 +208,9 @@ jobs: - php: '8.4' moodle-branch: 'main' moodle-app: 'true' + - php: '8.4' + moodle-branch: 'MOODLE_500_STABLE' + moodle-app: 'true' - php: '8.3' moodle-branch: 'MOODLE_405_STABLE' moodle-app: 'true' diff --git a/.travis.yml b/.travis.yml index ae9f974e..c9389d4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,9 +95,9 @@ jobs: - MOODLE_BRANCH=main - MOODLE_APP=true # Last stable with highest supported PHP version. - - php: 8.3 + - php: 8.4 env: - - MOODLE_BRANCH=MOODLE_405_STABLE + - MOODLE_BRANCH=MOODLE_500_STABLE - MOODLE_APP=true # And older stable supported (with lowest supported PHP version). - php: 7.4