From 9a8426242b39d2397c29fdff06b50c046b734ffb Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 11 Nov 2024 10:48:39 +0200 Subject: [PATCH] Skip "testDragDropOntoHiddenItself" test on Selenium 2 + Firefox --- .github/workflows/tests.yml | 3 +++ tests/Selenium2Config.php | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 35072403..d3630860 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,6 +84,9 @@ jobs: - name: Run tests env: + SELENIUM_VERSION: ${{ matrix.selenium_version }} + DRIVER_URL: http://localhost:4444/wd/hub + WEB_FIXTURES_BROWSER: firefox DRIVER_MACHINE_BASE_PATH: /fixtures/ run: | vendor/bin/phpunit -v --coverage-clover=coverage.xml diff --git a/tests/Selenium2Config.php b/tests/Selenium2Config.php index 7affa8dc..0128ec21 100644 --- a/tests/Selenium2Config.php +++ b/tests/Selenium2Config.php @@ -62,6 +62,18 @@ public function skipMessage($testCase, $test): ?string return 'Checking status code is not supported.'; } + if ( + 'Behat\Mink\Tests\Driver\Js\JavascriptTest' === $testCase + && 'testDragDropOntoHiddenItself' === $test + ) { + $seleniumVersion = $_SERVER['SELENIUM_VERSION'] ?? null; + $browser = $_SERVER['WEB_FIXTURES_BROWSER'] ?? null; + + if ($seleniumVersion && version_compare($seleniumVersion, '3.0.0', '<') && $browser === 'firefox') { + return 'The Firefox browser compatible with Selenium Server 2.x doesn\'t fully implement drag-n-drop support.'; + } + } + return parent::skipMessage($testCase, $test); }