Skip to content

Commit 0efaf28

Browse files
committed
Test on 4.8 selenium
1 parent 2d243b8 commit 0efaf28

7 files changed

+54
-50
lines changed

.ddev/docker-compose.selenium.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@ services:
1919
- ddev-global-cache:/mnt/ddev-global-cache
2020
chrome:
2121
container_name: ddev-${DDEV_SITENAME}-chrome
22-
image: selenium/standalone-chrome:latest
22+
image: selenium/standalone-chromium:latest
23+
labels:
24+
com.ddev.site-name: ${DDEV_SITENAME}
25+
com.ddev.approot: $DDEV_APPROOT
26+
shm_size: 2gb
27+
environment:
28+
- VIRTUAL_HOST=$DDEV_HOSTNAME
29+
links:
30+
- web:web
31+
external_links:
32+
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
33+
volumes:
34+
- ".:/mnt/ddev_config:ro"
35+
- ddev-global-cache:/mnt/ddev-global-cache
36+
oldchrome:
37+
container_name: ddev-${DDEV_SITENAME}-oldchrome
38+
image: selenium/standalone-chrome:4.8
2339
labels:
2440
com.ddev.site-name: ${DDEV_SITENAME}
2541
com.ddev.approot: $DDEV_APPROOT

test/Test/WebDriver/ChromeDriverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ public function testStatus()
7272
$this->assertEquals(1, $this->status['ready'], 'Chromedriver is not ready');
7373
$this->assertEquals('ChromeDriver ready for new sessions.', $this->status['message'], 'Chromedriver is not ready');
7474
$this->assertNotEmpty($this->status['os'], 'OS info not detected');
75-
$this->assertSame($this->w3c, $this->driver->isW3c());
75+
$this->assertSame($this->w3c, $this->session->isW3c());
7676
}
7777
}

test/Test/WebDriver/Selenium4ChromeWebDriverNonW3CTest.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

test/Test/WebDriver/Selenium4ChromeWebDriverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function setUp(): void
2525
$this->status = $this->driver->status();
2626
$this->session = $this->driver->session(Browser::CHROME, [
2727
'goog:chromeOptions' => [
28-
'w3c' => true,
28+
'w3c' => $this->w3c,
2929
'args' => [
3030
'--no-sandbox',
3131
'--ignore-certificate-errors',
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Test\WebDriver;
4+
5+
use WebDriver\Browser;
6+
7+
/**
8+
* Selenium WebDriver
9+
*
10+
* @package WebDriver
11+
*
12+
* @group Functional
13+
*/
14+
class Selenium4dot8ChromeWebDriverNonW3CTest extends Selenium4dot8ChromeWebDriverTest
15+
{
16+
protected $w3c = FALSE;
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Test\WebDriver;
4+
5+
use WebDriver\Browser;
6+
7+
/**
8+
* Selenium WebDriver
9+
*
10+
* @package WebDriver
11+
*
12+
* @group Functional
13+
*/
14+
class Selenium4dot8ChromeWebDriverTest extends Selenium4ChromeWebDriverTest
15+
{
16+
protected $testWebDriverRootUrl = 'http://oldchrome:4444';
17+
}

test/Test/WebDriver/SeleniumWebDriverTestBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ public function testStatus()
2424
$this->assertEquals(1, $this->status['ready'], 'Selenium is not ready');
2525
$this->assertEquals('Selenium Grid ready.', $this->status['message'], 'Selenium is not ready');
2626
$this->assertNotEmpty($this->status['nodes'][0]['osInfo'], 'OS info not detected');
27-
$this->assertSame($this->w3c, $this->driver->isW3c());
27+
$this->assertSame($this->w3c, $this->session->isW3c());
2828
}
2929
}

0 commit comments

Comments
 (0)