diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index c42c78c..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: @@ -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..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: @@ -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..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: @@ -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..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: @@ -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 diff --git a/composer.json b/composer.json index 6362b00..cbac77e 100644 --- a/composer.json +++ b/composer.json @@ -16,16 +16,16 @@ "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": { "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index 0bd1f2e..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; @@ -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; } ); @@ -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}." @@ -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 {