Skip to content

Commit 0638bbf

Browse files
ManjushaManjusha
authored andcommitted
Merge branch 'upgrade-php-webdriver_ver2' into mftf_components_upgrade
2 parents 96e4d9a + abdaf25 commit 0638bbf

File tree

6 files changed

+77
-28
lines changed

6 files changed

+77
-28
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"monolog/monolog": "^2.3",
3131
"mustache/mustache": "~2.5",
3232
"nikic/php-parser": "^4.4",
33-
"php-webdriver/webdriver": "^1.9.0 <1.14.0",
33+
"php-webdriver/webdriver": "^1.14.0",
3434
"spomky-labs/otphp": "^10.0",
3535
"symfony/console": "^4.4||^5.4",
3636
"symfony/string": "^5.4",

composer.lock

Lines changed: 20 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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+
}

src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache

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 {{suiteName}} extends \Codeception\GroupObject
2729
private $testCount = {{testCount}};
2830
private $preconditionFailure = null;
2931
private $currentTestRun = 0;
32+
/**
33+
* Remote Web Driver
34+
*
35+
* @var RemoteWebDriver
36+
*/
37+
private $remoteWebDriver = null;
3038
{{#helpers}}
3139
/**
3240
* @var \Magento\FunctionalTestingFramework\Helper\HelperContainer $helperContainer
@@ -152,7 +160,11 @@ class {{suiteName}} extends \Codeception\GroupObject
152160
);
153161
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
154162
foreach ($availableSessions as $session) {
155-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost);
163+
// Create an instance of ChromeOptions:
164+
$chromeOptions = new ChromeOptions();
165+
$capabilities = DesiredCapabilities::chrome();
166+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
167+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
156168
$remoteWebDriver->quit();
157169
}
158170
}
@@ -197,4 +209,4 @@ class {{suiteName}} extends \Codeception\GroupObject
197209

198210
return $this->testCount;
199211
}
200-
}
212+
}

0 commit comments

Comments
 (0)