1
1
# file: noinspection YAMLSchemaValidation
2
2
version : ' 3'
3
+
4
+ vars :
5
+ DOCROOT : ' {{ default "web" .DOCROOT }}'
6
+
3
7
tasks :
4
8
run :
5
9
desc : " Runs playwright functional tests."
45
49
46
50
task playwright:prepare test_id=456
47
51
48
- will import the database into `web/sites/simpletest/456/.ht.sqlite`.
52
+ will import the database into `web/sites/simpletest/456/.ht.sqlite` or
53
+ `docroot/sites/simpletest/456/.ht.sqlite` depending on the DOCROOT
54
+ configuration.
49
55
preconditions :
50
56
- sh : test -f /tmp/sqlite/.ht.sqlite
51
57
msg : ' playwright:install needs to be run before tests can run.'
@@ -54,16 +60,16 @@ tasks:
54
60
export PLAYWRIGHT_SETUP=1
55
61
56
62
# Recreate the sites directory.
57
- rm -rf web /sites/simpletest/{{ shellQuote .test_id }}/
58
- mkdir -p web /sites/simpletest/{{ shellQuote .test_id }}/
63
+ rm -rf {{ .DOCROOT }} /sites/simpletest/{{ shellQuote .test_id }}/
64
+ mkdir -p {{ .DOCROOT }} /sites/simpletest/{{ shellQuote .test_id }}/
59
65
mkdir -p /tmp/sqlite/{{ shellQuote .test_id }}/
60
66
61
67
# On locals, copying in only the files we need (and not all assets
62
68
# downloaded via stage file proxy) saves several seconds.
63
69
64
70
# Copy in settings.php and our services files.
65
- cp -a web /sites/default/*.php web /sites/simpletest/{{ shellQuote .test_id }}/
66
- cp -a web /sites/default/*.yml web /sites/simpletest/{{ shellQuote .test_id }}/
71
+ cp -a {{ .DOCROOT }} /sites/default/*.php {{ .DOCROOT }} /sites/simpletest/{{ shellQuote .test_id }}/
72
+ cp -a {{ .DOCROOT }} /sites/default/*.yml {{ .DOCROOT }} /sites/simpletest/{{ shellQuote .test_id }}/
67
73
68
74
# Copy the database.
69
75
cp -a /tmp/sqlite/.ht.sqlite /tmp/sqlite/{{ shellQuote .test_id }}/
@@ -115,8 +121,8 @@ tasks:
115
121
# Delete the files and settings directories.
116
122
# Fast tests that do not require a full page render may finish before Drupal
117
123
# has fully written files like aggregated JavaScript to disk.
118
- while [ -d web /sites/simpletest/{{ shellQuote .test_id }}/ ]; do
119
- rm -rf web /sites/simpletest/{{ shellQuote .test_id }}/ 2>/dev/null || true
124
+ while [ -d {{ .DOCROOT }} /sites/simpletest/{{ shellQuote .test_id }}/ ]; do
125
+ rm -rf {{ .DOCROOT }} /sites/simpletest/{{ shellQuote .test_id }}/ 2>/dev/null || true
120
126
done;
121
127
122
128
# Delete the database.
0 commit comments