Skip to content

Commit b237ad5

Browse files
committedMar 25, 2021
Add notes from screenshare
1 parent 95c87e8 commit b237ad5

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed
 

‎README.md

+26
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ Example of using Drupal's Nightwatch.js test suite
66

77
## Notes
88

9+
### Setting this up for Drupal core contribution
10+
11+
This repository is based on a Composer build and not meant for core contributions, it is fine for contrib.
12+
13+
To set up your own core contribution environments follow the following:
14+
15+
16+
```
17+
git clone https://git.drupalcode.org/project/drupal.git
18+
cd drupal
19+
20+
# If lando
21+
wget https://raw.githubusercontent.com/bluehorndigital/drupal-testing-workshop/main/.lando.yml
22+
23+
# if DDEV
24+
ddev config --yes
25+
cd .ddev
26+
wget https://raw.githubusercontent.com/bluehorndigital/drupal-testing-workshop/main/.ddev/docker-compose.testing.yaml
27+
```
28+
929
### Chromedriver `--no-sandbox` in containers
1030

1131
When running headless Chrome via Chromedriver in a container, you must specify
@@ -17,6 +37,10 @@ Source: https://developers.google.com/web/updates/2017/04/headless-chrome
1737

1838
* The example provided by Google shows an example from [Lighthouse Bot](https://github.com/GoogleChromeLabs/lighthousebot/blob/master/builder/Dockerfile#L35-L40) that sets the user to `chrome`. The `drupalci/chromedriver` performs nearly the same operation but as `chromeuser`. I have opened an issue for the DrupalCI image here: https://www.drupal.org/project/drupalci_environments/issues/3205271
1939

40+
### Nightwatch error on installProfileTest
41+
42+
Probably memory. Umami demo takes a lot to install.
43+
2044
## TODO
2145

2246
* Write up how to do this locally
@@ -45,6 +69,8 @@ ddev phpunit core/modules/action
4569
ddev nightwatch --tag core
4670
```
4771

72+
Commands documented: https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#container-commands
73+
4874
Blogs:
4975

5076
* [Running Drupal's PHPUnit test suites on DDEV](https://mglaman.dev/blog/running-drupals-phpunit-test-suites-ddev)

‎docs/getting-tests-running/ddev.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ that could be replaced if we upgrade Drupal core.
1515

1616
In `.ddev/docker-compose.testing.yaml`
1717

18+
See https://ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/
19+
1820
```
1921
---
2022
# Adds Chromedriver and Drupal PHPUnit test environment variables for running tests.

‎docs/getting-tests-running/locally.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,31 @@ nav_order: 2
77

88
# Locally
99

10-
TODO, with subpage
10+
In one terminal window
11+
12+
```
13+
cd web
14+
php -S 127.0.0.1:8080 .ht.router.php
15+
```
16+
17+
In another terminal, launched chromedriver
18+
19+
```
20+
chromedriver
21+
```
22+
23+
Then install dependencies
24+
25+
```
26+
cd web/core
27+
yarn install
28+
# Ensure compatible chromedriver, probably. Or install Chromedriver
29+
yarn add -D chromedriver@latest
30+
```
31+
32+
Run tests
33+
34+
```
35+
cd web/core
36+
yarn test:nightwatch --tag core
37+
```

0 commit comments

Comments
 (0)
Please sign in to comment.