Skip to content

Commit 52f6835

Browse files
Update to newest browser-ui-test version
1 parent 59354e6 commit 52f6835

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

dockerfiles/Dockerfile-gui-tests

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ RUN apt-get install -y \
5454
wget
5555

5656
# Install rust
57-
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly --no-modify-path --profile minimal
57+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain nightly --no-modify-path --profile minimal
5858
ENV PATH="/root/.cargo/bin:${PATH}"
5959

6060
RUN curl -sL https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz | tar -xJ
@@ -70,7 +70,7 @@ RUN mkdir out
7070
# https://github.com/puppeteer/puppeteer/issues/375
7171
#
7272
# We also specify the version in case we need to update it to go around cache limitations.
73-
RUN npm install -g browser-ui-test@0.8.5 --unsafe-perm=true
73+
RUN npm install -g browser-ui-test@0.16.10 --unsafe-perm=true
7474

7575
EXPOSE 3000
7676

dockerfiles/run-gui-tests.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cargo run -- build add-essential-files
1515
if [ ! -f .env ]
1616
then
1717
cp .env.sample .env
18-
source .env
18+
. .env
1919
fi
2020

2121
cargo run -- start-web-server &
@@ -29,5 +29,4 @@ sleep 5
2929
# status="docker run . -v `pwd`:/build/out:ro gui_tests"
3030
docker-compose run gui_tests
3131
status=$?
32-
kill -9 $SERVER_PID
3332
exit $status

gui-tests/404.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Checks the content of the 404 page.
2-
goto: |DOC_PATH|/non-existing-crate
2+
go-to: |DOC_PATH| + "/non-existing-crate"
33
assert-text: ("#crate-title", "The requested crate does not exist")

gui-tests/basic.goml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// Checks that the "latest" URL leads us to the last version of the `sysinfo` crate.
2-
goto: |DOC_PATH|/sysinfo
2+
go-to: |DOC_PATH| + "/sysinfo"
33
// We first check if the redirection worked as expected:
44
assert-document-property: ({"URL": "/sysinfo/latest/sysinfo/"}, ENDS_WITH)
5+
// Now we go to the actual version we're interested into.
6+
go-to: |DOC_PATH| + "/sysinfo/0.23.5/sysinfo/index.html"
57
assert: "//*[@class='title' and text()='sysinfo-0.23.5']"
68
// And we also confirm we're on a rustdoc page.
79
assert: "#rustdoc_body_wrapper"
810

911
// Let's go to the docs.rs page of the crate.
10-
goto: |DOC_PATH|/crate/sysinfo/latest
12+
go-to: |DOC_PATH| + "/crate/sysinfo/0.23.5"
1113
assert-false: "#rustdoc_body_wrapper"
1214
assert-text: ("#crate-title", "sysinfo 0.23.5", CONTAINS)

gui-tests/tester.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ async function main(argv) {
123123
try {
124124
// This is more convenient that setting fields one by one.
125125
let args = [
126-
"--no-screenshot-comparison",
127126
"--no-sandbox",
128127
];
129128
if (typeof process.env.SERVER_URL !== 'undefined') {
@@ -166,14 +165,15 @@ async function main(argv) {
166165
opts["jobs"] = 1;
167166
console.log("`--no-headless` option is active, disabling concurrency for running tests.");
168167
}
169-
170-
console.log(`Running ${files.length} docs.rs GUI (${opts["jobs"]} concurrently) ...`);
168+
let jobs = opts["jobs"];
171169

172170
if (opts["jobs"] < 1) {
171+
jobs = files.length;
173172
process.setMaxListeners(files.length + 1);
174173
} else if (headless) {
175174
process.setMaxListeners(opts["jobs"] + 1);
176175
}
176+
console.log(`Running ${files.length} docs.rs GUI (${jobs} concurrently) ...`);
177177

178178
const tests_queue = [];
179179
let results = {
@@ -185,7 +185,7 @@ async function main(argv) {
185185
for (let i = 0; i < files.length; ++i) {
186186
const file_name = files[i];
187187
const testPath = path.join(__dirname, file_name);
188-
const callback = runTest(testPath, options)
188+
const callback = runTest(testPath, {"options": options})
189189
.then(out => {
190190
const [output, nb_failures] = out;
191191
results[nb_failures === 0 ? "successful" : "failed"].push({

0 commit comments

Comments
 (0)