comparison vendor/behat/mink-selenium2-driver/tests/Custom/DesiredCapabilitiesTest.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
1 <?php
2
3 namespace Behat\Mink\Tests\Driver\Custom;
4
5 use Behat\Mink\Driver\Selenium2Driver;
6 use Behat\Mink\Tests\Driver\TestCase;
7
8 class DesiredCapabilitiesTest extends TestCase
9 {
10 public function testGetDesiredCapabilities()
11 {
12 $caps = array(
13 'browserName' => 'firefox',
14 'version' => '30',
15 'platform' => 'ANY',
16 'browserVersion' => '30',
17 'browser' => 'firefox',
18 'name' => 'Selenium2 Mink Driver Test',
19 'deviceOrientation' => 'portrait',
20 'deviceType' => 'tablet',
21 'selenium-version' => '2.45.0'
22 );
23
24 $driver = new Selenium2Driver('firefox', $caps);
25 $this->assertNotEmpty($driver->getDesiredCapabilities(), 'desiredCapabilities empty');
26 $this->assertInternalType('array', $driver->getDesiredCapabilities());
27 $this->assertEquals($caps, $driver->getDesiredCapabilities());
28 }
29
30 /**
31 * @expectedException \Behat\Mink\Exception\DriverException
32 * @expectedExceptionMessage Unable to set desiredCapabilities, the session has already started
33 */
34 public function testSetDesiredCapabilities()
35 {
36 $caps = array(
37 'browserName' => 'firefox',
38 'version' => '30',
39 'platform' => 'ANY',
40 'browserVersion' => '30',
41 'browser' => 'firefox',
42 'name' => 'Selenium2 Mink Driver Test',
43 'deviceOrientation' => 'portrait',
44 'deviceType' => 'tablet',
45 'selenium-version' => '2.45.0'
46 );
47 $driver = $this->getSession()->getDriver();
48 $driver->setDesiredCapabilities($caps);
49 }
50 }