Skip to content

Commit

Permalink
Merge pull request #278 from stof/fix_tests
Browse files Browse the repository at this point in the history
Rewrite the capability test to be compatible with lazy-starting
  • Loading branch information
stof authored Oct 3, 2018
2 parents f4efaf5 + 7fa8a11 commit d28b505
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/Custom/DesiredCapabilitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public function testSetDesiredCapabilities()
'deviceType' => 'tablet',
'selenium-version' => '2.45.0'
);
$driver = $this->getSession()->getDriver();
$session = $this->getSession();
$session->start();
$driver = $session->getDriver();
$driver->setDesiredCapabilities($caps);
}
}
}
4 changes: 3 additions & 1 deletion tests/Custom/WebDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ class WebDriverTest extends TestCase
{
public function testGetWebDriverSessionId()
{
$session = $this->getSession();
$session->start();
/** @var Selenium2Driver $driver */
$driver = $this->getSession()->getDriver();
$driver = $session->getDriver();
$this->assertNotEmpty($driver->getWebDriverSessionId(), 'Started session has an ID');

$driver = new Selenium2Driver();
Expand Down
2 changes: 2 additions & 0 deletions tests/Custom/WindowNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class WindowNameTest extends TestCase
public function testPatternGetWindowNames()
{
$session = $this->getSession();
$session->start();

$windowNames = $session->getWindowNames();
$this->assertArrayHasKey(0, $windowNames);
Expand All @@ -23,6 +24,7 @@ public function testPatternGetWindowNames()
public function testGetWindowName()
{
$session = $this->getSession();
$session->start();

$this->assertRegExp(self::WINDOW_NAME_REGEXP, $session->getWindowName());
}
Expand Down

0 comments on commit d28b505

Please sign in to comment.