File tree Expand file tree Collapse file tree 7 files changed +388
-0
lines changed Expand file tree Collapse file tree 7 files changed +388
-0
lines changed Original file line number Diff line number Diff line change 7777 - name : Clean up the database
7878 run : docker-compose down --volumes
7979
80+ gui_tests :
81+ runs-on : ubuntu-latest
82+ needs : build
83+
84+ steps :
85+ - name : Run GUI tests
86+ run : ./dockerfiles/run-gui-tests.sh
87+
8088 build_tests :
8189 runs-on : ubuntu-latest
8290 needs : build
Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ services:
8989 timeout : 5s
9090 retries : 10
9191
92+ gui_tests :
93+ build :
94+ context : .
95+ dockerfile : ./dockerfiles/Dockerfile-gui-tests
96+ network_mode : " host"
97+ volumes :
98+ - " ${PWD}:/build/out"
99+
92100volumes :
93101 postgres-data : {}
94102 minio-data : {}
Original file line number Diff line number Diff line change 1+ FROM ubuntu:16.04 as build
2+ SHELL ["/bin/bash", "-c"]
3+
4+ RUN apt-get update && apt-get install -y \
5+ ca-certificates \
6+ curl \
7+ docker.io \
8+ gcc \
9+ git \
10+ libssl-dev \
11+ pkg-config \
12+ xz-utils
13+
14+ # Install dependencies for chromium browser
15+ RUN apt-get install -y \
16+ gconf-service \
17+ libasound2 \
18+ libatk1.0-0 \
19+ libatk-bridge2.0-0 \
20+ libc6 \
21+ libcairo2 \
22+ libcups2 \
23+ libdbus-1-3 \
24+ libexpat1 \
25+ libfontconfig1 \
26+ libgbm-dev \
27+ libgcc1 \
28+ libgconf-2-4 \
29+ libgdk-pixbuf2.0-0 \
30+ libglib2.0-0 \
31+ libgtk-3-0 \
32+ libnspr4 \
33+ libpango-1.0-0 \
34+ libpangocairo-1.0-0 \
35+ libstdc++6 \
36+ libx11-6 \
37+ libx11-xcb1 \
38+ libxcb1 \
39+ libxcomposite1 \
40+ libxcursor1 \
41+ libxdamage1 \
42+ libxext6 \
43+ libxfixes3 \
44+ libxi6 \
45+ libxrandr2 \
46+ libxrender1 \
47+ libxss1 \
48+ libxtst6 \
49+ fonts-liberation \
50+ libappindicator1 \
51+ libnss3 \
52+ lsb-release \
53+ xdg-utils \
54+ wget
55+
56+ # Install rust
57+ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly --no-modify-path --profile minimal
58+ ENV PATH="/root/.cargo/bin:${PATH}"
59+
60+ RUN curl -sL https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz | tar -xJ
61+ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
62+ ENV NODE_PATH="/node-v14.4.0-linux-x64/lib/node_modules/"
63+
64+ WORKDIR /build
65+
66+ COPY .env.sample .env
67+
68+ RUN source .env
69+ RUN mkdir out
70+
71+ # For now, we need to use `--unsafe-perm=true` to go around an issue when npm tries
72+ # to create a new folder. For reference:
73+ # https://github.com/puppeteer/puppeteer/issues/375
74+ #
75+ # We also specify the version in case we need to update it to go around cache limitations.
76+ RUN npm install -g browser-ui-test@0.8.5 --unsafe-perm=true
77+
78+ EXPOSE 3000
79+
80+ CMD ["node", "/build/out/gui-tests/tester.js"]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Just in case it's running, we stop the web server.
4+ docker-compose stop web
5+
6+ docker-compose up -d db s3
7+
8+ # We add the information we need.
9+ cargo run -- database migrate
10+ cargo run -- build crate sysinfo 0.23.4
11+ cargo run -- build crate sysinfo 0.23.5
12+ cargo run -- build add-essential-files
13+ cargo run -- start-web-server &
14+ SERVER_PID=$!
15+
16+ docker build . -f dockerfiles/Dockerfile-gui-tests -t gui_tests
17+
18+ echo " Sleeping a bit to be sure the web server will be started..."
19+ sleep 5
20+
21+ # status="docker run . -v `pwd`:/build/out:ro gui_tests"
22+ docker-compose run gui_tests
23+ status=$?
24+ kill -9 $SERVER_PID
25+ exit $status
Original file line number Diff line number Diff line change 1+ // Checks the content of the 404 page.
2+ goto: |DOC_PATH|/non-existing-crate
3+ assert-text: ("#crate-title", "The requested crate does not exist")
Original file line number Diff line number Diff line change 1+ // Checks that the "latest" URL leads us to the last version of the `sysinfo` crate.
2+ goto: |DOC_PATH|/sysinfo
3+ // We first check if the redirection worked as expected:
4+ assert-document-property: ({"URL": "/sysinfo/latest/sysinfo/"}, ENDS_WITH)
5+ assert: "//*[@class='title' and text()='sysinfo-0.23.5']"
6+ // And we also confirm we're on a rustdoc page.
7+ assert: "#rustdoc_body_wrapper"
8+
9+ // Let's go to the docs.rs page of the crate.
10+ goto: |DOC_PATH|/crate/sysinfo/latest
11+ assert-false: "#rustdoc_body_wrapper"
12+ assert-text: ("#crate-title", "sysinfo 0.23.5", CONTAINS)
You can’t perform that action at this time.
0 commit comments