Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 1c5e7f0

Browse files
committed
Extend connection timeout further more to make SauceLabs tests hopefully more stable
1 parent 735a615 commit 1c5e7f0

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

tests/functional/RemoteWebDriverCreateTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ class RemoteWebDriverCreateTest extends WebDriverTestCase
2929

3030
public function testShouldStartBrowserAndCreateInstanceOfRemoteWebDriver()
3131
{
32-
$this->driver = RemoteWebDriver::create($this->serverUrl, $this->desiredCapabilities, 30000, 33370);
32+
$this->driver = RemoteWebDriver::create(
33+
$this->serverUrl,
34+
$this->desiredCapabilities,
35+
$this->connectionTimeout,
36+
$this->requestTimeout
37+
);
3338

3439
$this->assertInstanceOf(RemoteWebDriver::class, $this->driver);
3540

@@ -51,8 +56,8 @@ public function testShouldCreateWebDriverWithRequiredCapabilities()
5156
$this->driver = RemoteWebDriver::create(
5257
$this->serverUrl,
5358
$this->desiredCapabilities,
54-
null,
55-
null,
59+
$this->connectionTimeout,
60+
$this->requestTimeout,
5661
null,
5762
null,
5863
$requiredCapabilities
@@ -64,7 +69,12 @@ public function testShouldCreateWebDriverWithRequiredCapabilities()
6469
public function testShouldCreateInstanceFromExistingSessionId()
6570
{
6671
// Create driver instance and load page "index.html"
67-
$originalDriver = RemoteWebDriver::create($this->serverUrl, $this->desiredCapabilities);
72+
$originalDriver = RemoteWebDriver::create(
73+
$this->serverUrl,
74+
$this->desiredCapabilities,
75+
$this->connectionTimeout,
76+
$this->requestTimeout
77+
);
6878
$originalDriver->get($this->getTestPageUrl('index.html'));
6979
$this->assertContains('/index.html', $originalDriver->getCurrentURL());
7080

tests/functional/WebDriverTestCase.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class WebDriverTestCase extends \PHPUnit_Framework_TestCase
3434
protected $serverUrl = 'http://localhost:4444/wd/hub';
3535
/** @var DesiredCapabilities */
3636
protected $desiredCapabilities;
37+
/** @var int */
38+
protected $connectionTimeout = 60000;
39+
/** @var int */
40+
protected $requestTimeout = 60000;
3741

3842
protected function setUp()
3943
{
@@ -58,7 +62,12 @@ protected function setUp()
5862
}
5963

6064
if ($this->createWebDriver) {
61-
$this->driver = RemoteWebDriver::create($this->serverUrl, $this->desiredCapabilities);
65+
$this->driver = RemoteWebDriver::create(
66+
$this->serverUrl,
67+
$this->desiredCapabilities,
68+
$this->connectionTimeout,
69+
$this->requestTimeout
70+
);
6271
}
6372
}
6473

0 commit comments

Comments
 (0)