Skip to content

Commit

Permalink
Merge pull request #98 from tr33m4n/feature/dep-update
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
tr33m4n authored Apr 14, 2022
2 parents e25bf6a + a556cc8 commit a2788c2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ development, master ]
pull_request:
branches: [ development, master ]
schedule:
- cron: 0 3 * * 1,3,5
workflow_dispatch:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ext-json": "*",
"composer-plugin-api": "^2",
"codeception/codeception": "^4.1.22",
"codeception/module-webdriver": "^1.2",
"codeception/module-webdriver": "^2.0",
"composer/package-versions-deprecated": "^1.11.99",
"eloquent/composer-npm-bridge": "^5.0",
"ramsey/uuid": "^4.1",
Expand All @@ -28,8 +28,8 @@
},
"require-dev": {
"adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
"codeception/module-asserts": "^1.3",
"codeception/module-phpbrowser": "^1.0",
"codeception/module-asserts": "^2.0",
"codeception/module-phpbrowser": "^2.0",
"friendsofphp/php-cs-fixer": "^3.8",
"phpstan/phpstan": "^0.12.90",
"rector/rector": "^0.11.35",
Expand Down
7 changes: 6 additions & 1 deletion src/Codeception/Module/Percy.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public function takeAPercySnapshot(
return;
}

// If remote web driver has not been set, return
if (null === $this->webDriver->webDriver) {
return;
}

// Add Percy CLI JS to page
$this->webDriver->executeJS($this->percyCliJs);

Expand All @@ -106,7 +111,7 @@ public function takeAPercySnapshot(
)
))
->withClientInfo(InfoProvider::getClientInfo())
->withEnvironmentInfo(InfoProvider::getEnvironmentInfo($this->webDriver))
->withEnvironmentInfo(InfoProvider::getEnvironmentInfo($this->webDriver->webDriver))
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Codeception/Module/Percy/InfoProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Codeception\Module\Percy;

use Codeception\Module\WebDriver;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use PackageVersions\Versions;

final class InfoProvider
Expand All @@ -18,16 +18,16 @@ final class InfoProvider
/**
* Get environment info
*
* @param \Codeception\Module\WebDriver $webDriver
* @param \Facebook\WebDriver\Remote\RemoteWebDriver $webDriver
* @return string
*/
public static function getEnvironmentInfo(WebDriver $webDriver): string
public static function getEnvironmentInfo(RemoteWebDriver $webDriver): string
{
if (null !== self::$environmentInfo) {
return self::$environmentInfo;
}

$webDriverCapabilities = $webDriver->webDriver->getCapabilities();
$webDriverCapabilities = $webDriver->getCapabilities();

return self::$environmentInfo = sprintf(
'codeception-php; %s; %s/%s',
Expand Down

0 comments on commit a2788c2

Please sign in to comment.