Skip to content

Commit 9fa64ce

Browse files
authored
Fix test coverage (#18)
1 parent c430749 commit 9fa64ce

File tree

3 files changed

+69
-52
lines changed

3 files changed

+69
-52
lines changed

.ddev/config.yaml

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
11
name: php-webdriver
22
type: php
33
docroot: ""
4-
php_version: "8.1"
4+
php_version: "8.3"
55
webserver_type: nginx-fpm
66
xdebug_enabled: false
77
additional_hostnames: []
88
additional_fqdns: []
99
database:
1010
type: mariadb
1111
version: "10.4"
12+
webimage_extra_packages: [chromium-driver, firefox-esr]
1213
use_dns_when_possible: true
1314
composer_version: "2"
1415
web_environment: []
1516
nodejs_version: "18"
16-
webimage_extra_packages:
17-
- chromium-driver
18-
- firefox-esr
17+
corepack_enable: false
1918
web_extra_daemons:
20-
- name: "chromedriver"
21-
command: "/usr/bin/chromedriver --verbose"
22-
directory: "/usr/bin"
23-
- name: "geckodriver"
24-
command: "/usr/local/bin/geckodriver -b /usr/bin/firefox"
25-
directory: "/usr/local/bin/"
19+
- name: chromedriver
20+
command: /usr/bin/chromedriver --verbose
21+
directory: /usr/bin
22+
- name: geckodriver
23+
command: /usr/local/bin/geckodriver -b /usr/bin/firefox
24+
directory: /usr/local/bin/
2625

27-
# Key features of ddev's config.yaml:
26+
# Key features of DDEV's config.yaml:
2827

2928
# name: <projectname> # Name of the project, automatically provides
3029
# http://projectname.ddev.site and https://projectname.ddev.site
3130

32-
# type: <projecttype> # drupal6/7/8, backdrop, typo3, wordpress, php
31+
# type: <projecttype> # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
32+
# See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more
33+
# information on the different project types
34+
# "drupal" covers recent Drupal 8+
3335

3436
# docroot: <relative_path> # Relative path to the directory containing index.php.
3537

36-
# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"
38+
# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"
3739

3840
# You can explicitly specify the webimage but this
39-
# is not recommended, as the images are often closely tied to ddev's' behavior,
41+
# is not recommended, as the images are often closely tied to DDEV's' behavior,
4042
# so this can break upgrades.
4143

4244
# webimage: <docker_image> # nginx/php docker image.
4345

4446
# database:
4547
# type: <dbtype> # mysql, mariadb, postgres
46-
# version: <version> # database version, like "10.4" or "8.0"
47-
# mariadb versions can be 5.5-10.8 and 10.11, mysql versions can be 5.5-8.0
48-
# postgres versions can be 9-15.
48+
# version: <version> # database version, like "10.11" or "8.0"
49+
# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0
50+
# PostgreSQL versions can be 9-16.
4951

5052
# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
5153
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
5254

53-
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
55+
# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart"
5456
# Note that for most people the commands
55-
# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better,
56-
# as leaving xdebug enabled all the time is a big performance hit.
57+
# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better,
58+
# as leaving Xdebug enabled all the time is a big performance hit.
5759

58-
# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart"
60+
# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart"
5961
# Note that for most people the commands
60-
# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better,
61-
# as leaving xhprof enabled all the time is a big performance hit.
62+
# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better,
63+
# as leaving Xhprof enabled all the time is a big performance hit.
6264

63-
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
65+
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
6466

6567
# timezone: Europe/Berlin
6668
# This is the timezone used in the containers and by PHP;
@@ -69,7 +71,7 @@ web_extra_daemons:
6971
# For example Europe/Dublin or MST7MDT
7072

7173
# composer_root: <relative_path>
72-
# Relative path to the composer root directory from the project root. This is
74+
# Relative path to the Composer root directory from the project root. This is
7375
# the directory which contains the composer.json and where all Composer related
7476
# commands are executed.
7577

@@ -84,10 +86,17 @@ web_extra_daemons:
8486
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
8587
# To reinstall Composer after the image was built, run "ddev debug refresh".
8688

87-
# nodejs_version: "18"
88-
# change from the default system Node.js version to another supported version, like 14, 16, 18, 20.
89-
# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any
90-
# Node.js version, including v6, etc.
89+
# nodejs_version: "20"
90+
# change from the default system Node.js version to any other version.
91+
# Numeric version numbers can be complete (i.e. 18.15.0) or
92+
# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with
93+
# other named releases.
94+
# see https://www.npmjs.com/package/n#specifying-nodejs-versions
95+
# Note that you can continue using 'ddev nvm' or nvm inside the web container
96+
# to change the project's installed node version if you need to.
97+
98+
# corepack_enable: false
99+
# Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm
91100

92101
# additional_hostnames:
93102
# - somename
@@ -102,19 +111,26 @@ web_extra_daemons:
102111
# Please take care with this because it can cause great confusion.
103112

104113
# upload_dirs: "custom/upload/dir"
105-
#
114+
#
106115
# upload_dirs:
107116
# - custom/upload/dir
108117
# - ../private
109118
#
110119
# would set the destination paths for ddev import-files to <docroot>/custom/upload/dir
111-
# When mutagen is enabled this path is bind-mounted so that all the files
112-
# in the upload_dirs don't have to be synced into mutagen.
120+
# When Mutagen is enabled this path is bind-mounted so that all the files
121+
# in the upload_dirs don't have to be synced into Mutagen.
113122

114123
# disable_upload_dirs_warning: false
115124
# If true, turns off the normal warning that says
116125
# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set"
117126

127+
# ddev_version_constraint: ""
128+
# Example:
129+
# ddev_version_constraint: ">= 1.22.4"
130+
# This will enforce that the running ddev version is within this constraint.
131+
# See https://github.com/Masterminds/semver#checking-version-constraints for
132+
# supported constraint formats
133+
118134
# working_dir:
119135
# web: /var/www/html
120136
# db: /home
@@ -125,7 +141,7 @@ web_extra_daemons:
125141
# omit_containers: [db, ddev-ssh-agent]
126142
# Currently only these containers are supported. Some containers can also be
127143
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
128-
# the "db" container, several standard features of ddev that access the
144+
# the "db" container, several standard features of DDEV that access the
129145
# database container will be unusable. In the global configuration it is also
130146
# possible to omit ddev-router, but not here.
131147

@@ -139,8 +155,8 @@ web_extra_daemons:
139155
# - "mutagen": enables Mutagen for this project.
140156
# - "nfs": enables NFS for this project.
141157
#
142-
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs
143-
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen
158+
# See https://ddev.readthedocs.io/en/stable/users/install/performance/#nfs
159+
# See https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen
144160

145161
# fail_on_hook_fail: False
146162
# Decide whether 'ddev start' should be interrupted by a failing hook
@@ -161,12 +177,12 @@ web_extra_daemons:
161177
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
162178
# unless explicitly specified.
163179

164-
# mailhog_port: "8025"
165-
# mailhog_https_port: "8026"
166-
# The MailHog ports can be changed from the default 8025 and 8026
180+
# mailpit_http_port: "8025"
181+
# mailpit_https_port: "8026"
182+
# The Mailpit ports can be changed from the default 8025 and 8026
167183

168-
# host_mailhog_port: "8025"
169-
# The mailhog port is not normally bound on the host at all, instead being routed
184+
# host_mailpit_port: "8025"
185+
# The mailpit port is not normally bound on the host at all, instead being routed
170186
# through ddev-router, but it can be bound directly to localhost if specified here.
171187

172188
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
@@ -192,8 +208,8 @@ web_extra_daemons:
192208
# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h"
193209

194210
# disable_settings_management: false
195-
# If true, ddev will not create CMS-specific settings files like
196-
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
211+
# If true, DDEV will not create CMS-specific settings files like
212+
# Drupal's settings.php/settings.ddev.php or TYPO3's additional.php
197213
# In this case the user must provide all such settings.
198214

199215
# You can inject environment variables into the web container with:
@@ -202,19 +218,19 @@ web_extra_daemons:
202218
# - SOMEOTHERENV=someothervalue
203219

204220
# no_project_mount: false
205-
# (Experimental) If true, ddev will not mount the project into the web container;
221+
# (Experimental) If true, DDEV will not mount the project into the web container;
206222
# the user is responsible for mounting it manually or via a script.
207223
# This is to enable experimentation with alternate file mounting strategies.
208224
# For advanced users only!
209225

210226
# bind_all_interfaces: false
211227
# If true, host ports will be bound on all network interfaces,
212-
# not just the localhost interface. This means that ports
228+
# not the localhost interface only. This means that ports
213229
# will be available on the local network if the host firewall
214230
# allows it.
215231

216232
# default_container_timeout: 120
217-
# The default time that ddev waits for all containers to become ready can be increased from
233+
# The default time that DDEV waits for all containers to become ready can be increased from
218234
# the default 120. This helps in importing huge databases, for example.
219235

220236
#web_extra_exposed_ports:
@@ -251,10 +267,10 @@ web_extra_daemons:
251267
# override_config: false
252268
# By default, config.*.yaml files are *merged* into the configuration
253269
# But this means that some things can't be overridden
254-
# For example, if you have 'nfs_mount_enabled: true'' you can't override it with a merge
270+
# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge
255271
# and you can't erase existing hooks or all environment variables.
256272
# However, with "override_config: true" in a particular config.*.yaml file,
257-
# 'nfs_mount_enabled: false' can override the existing values, and
273+
# 'use_dns_when_possible: false' can override the existing values, and
258274
# hooks:
259275
# post-start: []
260276
# or
@@ -264,8 +280,8 @@ web_extra_daemons:
264280
# can have their intended affect. 'override_config' affects only behavior of the
265281
# config.*.yaml file it exists in.
266282

267-
# Many ddev commands can be extended to run tasks before or after the
268-
# ddev command is executed, for example "post-start", "post-import-db",
283+
# Many DDEV commands can be extended to run tasks before or after the
284+
# DDEV command is executed, for example "post-start", "post-import-db",
269285
# "pre-composer", "post-composer"
270286
# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more
271287
# information on the commands that can be extended and the tasks you can define

test/Test/WebDriver/ChromeDriverNonW3CTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@
3232
class ChromeDriverNonW3CTest extends ChromeDriverTest
3333
{
3434
protected $w3c = false;
35+
protected $testWebDriverRootUrl = 'http://oldchrome:4444';
36+
3537
}

test/Test/WebDriver/ChromeDriverTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
class ChromeDriverTest extends WebDriverTestBase
3737
{
38-
protected $testWebDriverRootUrl = 'http://localhost:9515';
38+
protected $testWebDriverRootUrl = 'http://chrome:4444';
3939
protected $testWebDriverName = 'chromedriver';
4040
protected $w3c = true;
4141
protected $status = null;
@@ -71,8 +71,7 @@ protected function setUp(): void
7171
public function testStatus()
7272
{
7373
$this->assertEquals(1, $this->status['ready'], 'Chromedriver is not ready');
74-
$this->assertEquals('ChromeDriver ready for new sessions.', $this->status['message'], 'Chromedriver is not ready');
75-
$this->assertNotEmpty($this->status['os'], 'OS info not detected');
74+
$this->assertEquals('Selenium Grid ready.', $this->status['message'], 'Chromedriver is not ready');
7675
$this->assertSame($this->w3c, $this->session->isW3c());
7776
}
7877
}

0 commit comments

Comments
 (0)