File tree Expand file tree Collapse file tree 7 files changed +391
-0
lines changed Expand file tree Collapse file tree 7 files changed +391
-0
lines changed Original file line number Diff line number Diff line change 7474 $f || exit 1
7575 done
7676
77+ - name : Run GUI tests
78+ run : ./dockerfiles/run-gui-tests.sh
79+
7780 - name : Clean up the database
7881 run : docker-compose down --volumes
7982
83+ steps :
84+ - uses : actions/checkout@master
85+
8086 build_tests :
8187 runs-on : ubuntu-latest
8288 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+ RUN mkdir out
67+
68+ # For now, we need to use `--unsafe-perm=true` to go around an issue when npm tries
69+ # to create a new folder. For reference:
70+ # https://github.com/puppeteer/puppeteer/issues/375
71+ #
72+ # 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
74+
75+ EXPOSE 3000
76+
77+ 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+
14+ # In case we don't have a `.env`, we create one.
15+ if [ ! -f .env ]
16+ then
17+ cp .env.sample .env
18+ source .env
19+ fi
20+
21+ cargo run -- start-web-server &
22+ SERVER_PID=$!
23+
24+ docker build . -f dockerfiles/Dockerfile-gui-tests -t gui_tests
25+
26+ echo " Sleeping a bit to be sure the web server will be started..."
27+ sleep 5
28+
29+ # status="docker run . -v `pwd`:/build/out:ro gui_tests"
30+ docker-compose run gui_tests
31+ status=$?
32+ kill -9 $SERVER_PID
33+ 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