Skip to content

Commit abdaf25

Browse files
ManjushaManjusha
authored andcommitted
upgrade-php-webdriver_ver2 : Fixed verification test
1 parent 419a8fa commit abdaf25

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

dev/tests/verification/Resources/ActionsInDifferentModulesSuite.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Group;
44

55
use Facebook\WebDriver\Remote\RemoteWebDriver;
6+
use Facebook\WebDriver\Remote\DesiredCapabilities;
67
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
78
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
89
use Magento\FunctionalTestingFramework\Module\MagentoWebDriver;
@@ -11,6 +12,7 @@ use Magento\FunctionalTestingFramework\Module\MagentoActionProxies;
1112
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1213
use Codeception\Lib\ModuleContainer;
1314
use Codeception\Module;
15+
use Facebook\WebDriver\Chrome\ChromeOptions;
1416

1517
/**
1618
* Group class is Codeception Extension which is allowed to handle to all internal events.
@@ -27,6 +29,12 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
2729
private $testCount = 1;
2830
private $preconditionFailure = null;
2931
private $currentTestRun = 0;
32+
/**
33+
* Remote Web Driver
34+
*
35+
* @var RemoteWebDriver
36+
*/
37+
private $remoteWebDriver = null;
3038
private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of ActionsInDifferentModulesSuite suite %s block ********/\n";
3139
private static $HOOK_EXECUTION_END = "\n/******** Execution of ActionsInDifferentModulesSuite suite %s block complete ********/\n";
3240
/** @var MagentoWebDriver */
@@ -196,7 +204,11 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
196204
);
197205
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
198206
foreach ($availableSessions as $session) {
199-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost);
207+
// Create an instance of ChromeOptions:
208+
$chromeOptions = new ChromeOptions();
209+
$capabilities = DesiredCapabilities::chrome();
210+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
211+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
200212
$remoteWebDriver->quit();
201213
}
202214
}
@@ -241,4 +253,4 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
241253

242254
return $this->testCount;
243255
}
244-
}
256+
}

dev/tests/verification/Resources/functionalSuiteHooks.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Group;
44

55
use Facebook\WebDriver\Remote\RemoteWebDriver;
6+
use Facebook\WebDriver\Remote\DesiredCapabilities;
67
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
78
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
89
use Magento\FunctionalTestingFramework\Module\MagentoWebDriver;
@@ -11,6 +12,7 @@ use Magento\FunctionalTestingFramework\Module\MagentoActionProxies;
1112
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1213
use Codeception\Lib\ModuleContainer;
1314
use Codeception\Module;
15+
use Facebook\WebDriver\Chrome\ChromeOptions;
1416

1517
/**
1618
* Group class is Codeception Extension which is allowed to handle to all internal events.
@@ -27,6 +29,12 @@ class functionalSuiteHooks extends \Codeception\GroupObject
2729
private $testCount = 1;
2830
private $preconditionFailure = null;
2931
private $currentTestRun = 0;
32+
/**
33+
* Remote Web Driver
34+
*
35+
* @var RemoteWebDriver
36+
*/
37+
private $remoteWebDriver = null;
3038
private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of functionalSuiteHooks suite %s block ********/\n";
3139
private static $HOOK_EXECUTION_END = "\n/******** Execution of functionalSuiteHooks suite %s block complete ********/\n";
3240
/** @var MagentoWebDriver */
@@ -179,7 +187,11 @@ class functionalSuiteHooks extends \Codeception\GroupObject
179187
);
180188
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
181189
foreach ($availableSessions as $session) {
182-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost);
190+
// Create an instance of ChromeOptions:
191+
$chromeOptions = new ChromeOptions();
192+
$capabilities = DesiredCapabilities::chrome();
193+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
194+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
183195
$remoteWebDriver->quit();
184196
}
185197
}
@@ -224,4 +236,4 @@ class functionalSuiteHooks extends \Codeception\GroupObject
224236

225237
return $this->testCount;
226238
}
227-
}
239+
}

dev/tests/verification/Resources/functionalSuiteWithComments.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Group;
44

55
use Facebook\WebDriver\Remote\RemoteWebDriver;
6+
use Facebook\WebDriver\Remote\DesiredCapabilities;
67
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
78
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
89
use Magento\FunctionalTestingFramework\Module\MagentoWebDriver;
@@ -11,6 +12,7 @@ use Magento\FunctionalTestingFramework\Module\MagentoActionProxies;
1112
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1213
use Codeception\Lib\ModuleContainer;
1314
use Codeception\Module;
15+
use Facebook\WebDriver\Chrome\ChromeOptions;
1416

1517
/**
1618
* Group class is Codeception Extension which is allowed to handle to all internal events.
@@ -27,6 +29,12 @@ class functionalSuiteWithComments extends \Codeception\GroupObject
2729
private $testCount = 1;
2830
private $preconditionFailure = null;
2931
private $currentTestRun = 0;
32+
/**
33+
* Remote Web Driver
34+
*
35+
* @var RemoteWebDriver
36+
*/
37+
private $remoteWebDriver = null;
3038
private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of functionalSuiteWithComments suite %s block ********/\n";
3139
private static $HOOK_EXECUTION_END = "\n/******** Execution of functionalSuiteWithComments suite %s block complete ********/\n";
3240
/** @var MagentoWebDriver */
@@ -159,7 +167,11 @@ class functionalSuiteWithComments extends \Codeception\GroupObject
159167
);
160168
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
161169
foreach ($availableSessions as $session) {
162-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost);
170+
// Create an instance of ChromeOptions:
171+
$chromeOptions = new ChromeOptions();
172+
$capabilities = DesiredCapabilities::chrome();
173+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
174+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
163175
$remoteWebDriver->quit();
164176
}
165177
}
@@ -204,4 +216,4 @@ class functionalSuiteWithComments extends \Codeception\GroupObject
204216

205217
return $this->testCount;
206218
}
207-
}
219+
}

0 commit comments

Comments
 (0)