Skip to content

Commit bffa71a

Browse files
authored
Document W3C compliance mode configuration (#85)
Added instructions for configuring W3C compliance mode in tests. This is a follow up on #84.
1 parent 7182eca commit bffa71a

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@ After installation, make sure to commit the `.ddev` directory to version control
4545
- Ensure you have a working site that has the `weitzman/drupal-test-traits` Composer package.
4646
- `ddev exec -d /var/www/html/web "../vendor/bin/phpunit --bootstrap=../vendor/weitzman/drupal-test-traits/src/bootstrap-fast.php --printer '\Drupal\Tests\Listeners\HtmlOutputPrinter' ../vendor/weitzman/drupal-test-traits/tests/ExampleSelenium2DriverTest.php"`
4747

48+
### Configuring W3C compliance mode
49+
50+
By default, WebDriver W3C compliance is enabled (`DRUPAL_TEST_WEBDRIVER_W3C=true`). This controls the `w3c` flag in both `MINK_DRIVER_ARGS_WEBDRIVER` and `DTT_MINK_DRIVER_ARGS`.
51+
52+
If you are running tests on Drupal < 11, you may need to disable W3C mode to avoid WebDriver curl errors (HTTP 400) during test runs. You have a few ways to override it:
53+
54+
**Using `ddev dotenv`** (recommended, keeps it out of version control):
55+
56+
```bash
57+
ddev dotenv set .ddev/.env --drupal-test-webdriver-w3c false
58+
ddev restart
59+
```
60+
61+
**Using `.ddev/config.yaml`** (commit this if the whole team needs the same setting):
62+
63+
```yaml
64+
web_environment:
65+
- DRUPAL_TEST_WEBDRIVER_W3C=false
66+
```
67+
68+
Then run `ddev restart`.
69+
70+
> **Note:** Only disable W3C mode if your tests are failing with HTTP 400 curl errors from the WebDriver endpoint. See [issue #76](https://github.com/ddev/ddev-selenium-standalone-chrome/issues/76) for the original bug report.
71+
4872
## Watching the tests
4973

5074
### The easy way: Use noVNC (built-in)

0 commit comments

Comments
 (0)