From 59b6fe426dddbe889c23593f8698c52e08bba6e9 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Fri, 3 Feb 2023 23:46:32 +0200 Subject: [PATCH 1/6] 3.* versions are compatible with PHPUnit 9 only --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6362b00..33c052d 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "codeception/codeception": "^5.0.0-RC2", "codeception/lib-web": "^1.0.1", "codeception/stub": "^4.0", - "php-webdriver/webdriver": "^1.8.0" + "php-webdriver/webdriver": "^1.8.0", + "phpunit/phpunit": "^9.5" }, "suggest": { "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" From d1f8b1e61f963b955ce99d3df5da93c326c6c8ea Mon Sep 17 00:00:00 2001 From: Mathias Brodala Date: Thu, 11 Jan 2024 14:06:14 +0100 Subject: [PATCH 2/6] Fix namespace mismatch of ActionSequence --- src/Codeception/Module/WebDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index 0bd1f2e..c80e691 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -3633,7 +3633,7 @@ protected function getRelativeTabHandle($offset) * In 3rd argument you can set number a seconds to wait for element to appear * * @param string|array|WebDriverBy $element - * @param callable|array|ActionSequence $actions + * @param callable|array|\Codeception\Util\ActionSequence $actions */ public function performOn($element, $actions, int $timeout = 10): void { From fdf3b81ac21aecdf408eb884af0e045b390d0446 Mon Sep 17 00:00:00 2001 From: Craig McMahon Date: Wed, 31 Jan 2024 15:22:49 +0000 Subject: [PATCH 3/6] Fix type error when using `seeLink` --- src/Codeception/Module/WebDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index c80e691..a0c6932 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -1367,7 +1367,7 @@ private function filterNodesByHref(string $url, array $nodes): array return array_filter( $nodes, function (WebDriverElement $e) use ($expectedUrl, $absoluteCurrentUrl): bool { - $elementHref = Uri::mergeUrls($absoluteCurrentUrl, $e->getAttribute('href')); + $elementHref = Uri::mergeUrls($absoluteCurrentUrl, $e->getAttribute('href') ?? ''); return $elementHref === $expectedUrl; } ); From c1440b00fcdd4b3bd55d3a9a969cce116afd6fa7 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Fri, 16 Feb 2024 13:23:48 +0200 Subject: [PATCH 4/6] Use actions/checkout@v4 in Github Actions --- .github/workflows/static-analysis.yml | 3 +-- .github/workflows/webdriver-chrome-headless.yml | 4 ++-- .github/workflows/webdriver-chrome.yml | 4 ++-- .github/workflows/webdriver-firefox.yml | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index c42c78c..defc1a4 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,8 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/webdriver-chrome-headless.yml b/.github/workflows/webdriver-chrome-headless.yml index 7c43517..46ce1cb 100644 --- a/.github/workflows/webdriver-chrome-headless.yml +++ b/.github/workflows/webdriver-chrome-headless.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - run: docker run -d --net=host --shm-size=2g selenium/standalone-chrome:3.141.59-oxygen - name: Validate composer.json and composer.lock diff --git a/.github/workflows/webdriver-chrome.yml b/.github/workflows/webdriver-chrome.yml index 3c82039..43b5d69 100644 --- a/.github/workflows/webdriver-chrome.yml +++ b/.github/workflows/webdriver-chrome.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - run: docker run -d --net=host --shm-size=2g selenium/standalone-chrome:3.141.59-oxygen - name: Validate composer.json and composer.lock diff --git a/.github/workflows/webdriver-firefox.yml b/.github/workflows/webdriver-firefox.yml index 2cb82a7..e421e41 100644 --- a/.github/workflows/webdriver-firefox.yml +++ b/.github/workflows/webdriver-firefox.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - run: docker run -d --net=host --shm-size=2g selenium/standalone-firefox:3.141.59-oxygen - name: Validate composer.json and composer.lock From 9ac8cfe0264b94c8ecde9d08f43b89c7349b2a26 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis <395992+Naktibalda@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:47:00 +0200 Subject: [PATCH 5/6] Updated WebDriver exception handling (#121) WebDriverCurlException was moved to Internal namespace and deprecated in php-webdriver/webdriver 1.14 --- composer.json | 7 +++---- src/Codeception/Module/WebDriver.php | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 33c052d..cbac77e 100644 --- a/composer.json +++ b/composer.json @@ -16,16 +16,15 @@ "name": "Zaahid Bateson" } ], - "minimum-stability": "dev", - + "minimum-stability": "stable", "require": { "php": "^8.0", "ext-json": "*", "ext-mbstring": "*", - "codeception/codeception": "^5.0.0-RC2", + "codeception/codeception": "^5.0.0", "codeception/lib-web": "^1.0.1", "codeception/stub": "^4.0", - "php-webdriver/webdriver": "^1.8.0", + "php-webdriver/webdriver": "^1.14.0", "phpunit/phpunit": "^9.5" }, "suggest": { diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index a0c6932..b0a210f 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -35,11 +35,11 @@ use Exception; use Facebook\WebDriver\Cookie; use Facebook\WebDriver\Cookie as WebDriverCookie; +use Facebook\WebDriver\Exception\Internal\UnexpectedResponseException; use Facebook\WebDriver\Exception\InvalidElementStateException; use Facebook\WebDriver\Exception\InvalidSelectorException; use Facebook\WebDriver\Exception\NoSuchElementException; use Facebook\WebDriver\Exception\UnknownErrorException; -use Facebook\WebDriver\Exception\WebDriverCurlException; use Facebook\WebDriver\Interactions\WebDriverActions; use Facebook\WebDriver\Remote\LocalFileDetector; use Facebook\WebDriver\Remote\RemoteWebDriver; @@ -1686,7 +1686,7 @@ public function _initializeSession(): void $this->setBaseElement(); $this->initialWindowSize(); - } catch (WebDriverCurlException $exception) { + } catch (UnexpectedResponseException $exception) { codecept_debug('Curl error: ' . $exception->getMessage()); throw new ConnectionException( "Can't connect to WebDriver at {$this->wdHost}." From 06fe128460a313e171bfef894882c7c880aef6b8 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Fri, 16 Feb 2024 15:09:30 +0200 Subject: [PATCH 6/6] Run Github actions in 3.x branch --- .github/workflows/static-analysis.yml | 4 ++-- .github/workflows/webdriver-chrome-headless.yml | 4 ++-- .github/workflows/webdriver-chrome.yml | 4 ++-- .github/workflows/webdriver-firefox.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index defc1a4..6f560d0 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,9 +2,9 @@ name: Static analysis on: push: - branches: [ master ] + branches: [ 3.x ] pull_request: - branches: [ master ] + branches: [ 3.x ] jobs: phpcs: diff --git a/.github/workflows/webdriver-chrome-headless.yml b/.github/workflows/webdriver-chrome-headless.yml index 46ce1cb..eb66019 100644 --- a/.github/workflows/webdriver-chrome-headless.yml +++ b/.github/workflows/webdriver-chrome-headless.yml @@ -2,9 +2,9 @@ name: Chrome Headless Tests on: push: - branches: [ master ] + branches: [ 3.x ] pull_request: - branches: [ master ] + branches: [ 3.x ] jobs: build: diff --git a/.github/workflows/webdriver-chrome.yml b/.github/workflows/webdriver-chrome.yml index 43b5d69..7fe1bb5 100644 --- a/.github/workflows/webdriver-chrome.yml +++ b/.github/workflows/webdriver-chrome.yml @@ -2,9 +2,9 @@ name: Chrome Tests on: push: - branches: [ master ] + branches: [ 3.x ] pull_request: - branches: [ master ] + branches: [ 3.x ] jobs: build: diff --git a/.github/workflows/webdriver-firefox.yml b/.github/workflows/webdriver-firefox.yml index e421e41..6fee50d 100644 --- a/.github/workflows/webdriver-firefox.yml +++ b/.github/workflows/webdriver-firefox.yml @@ -2,9 +2,9 @@ name: Firefox Tests on: push: - branches: [ master ] + branches: [ 3.x ] pull_request: - branches: [ master ] + branches: [ 3.x ] jobs: build: