-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Asenna automaattitestaustyökalut Docker-imageksi (#93)
- Loading branch information
1 parent
de9eaf8
commit e65198a
Showing
8 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,8 @@ build | |
.version | ||
/.env.test | ||
/coverage | ||
|
||
/test/.report | ||
|
||
/robotenv.py | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
*** Settings *** | ||
Library SeleniumLibrary timeout=10 implicit_wait=1.5 run_on_failure=Capture Page Screenshot | ||
Library XvfbRobot | ||
|
||
Variables ../../../robotenv.py | ||
|
||
*** Variables *** | ||
|
||
${TMP_PATH} /tmp | ||
|
||
*** Keywords *** | ||
Avaa selain | ||
Start Virtual Display 1920 1080 | ||
${options} Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver | ||
Call Method ${options} add_argument --no-sandbox | ||
${prefs} Create Dictionary download.default_directory=${TMP_PATH} | ||
Call Method ${options} add_experimental_option prefs ${prefs} | ||
Create Webdriver Chrome chrome_options=${options} | ||
|
||
Selain on avattu kansalaisen etusivulle | ||
GoTo ${SERVER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
*** Settings *** | ||
Resource ../lib/setup.robot | ||
|
||
Suite Setup Avaa selain | ||
|
||
Test Teardown Run Keyword If Test Failed Capture Page Screenshot | ||
|
||
Suite Teardown Close All Browsers | ||
|
||
*** Variables *** | ||
|
||
*** Test Cases *** | ||
Avaa kansalaisen etusivu | ||
Selain on avattu kansalaisen etusivulle | ||
Sivun otsikon pitäisi olla Hassu | ||
|
||
*** Keywords *** | ||
Sivun otsikon pitäisi olla ${expected_title} | ||
${title}= Get Title | ||
Should Be Equal ${expected_title} ${title} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:3.10.0a6-buster | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y xvfb wget ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 \ | ||
libatspi2.0-0 libcups2 libdbus-1-3 libgbm1 libgtk-3-0 libnspr4 libnss3 \ | ||
libxcomposite1 libxkbcommon0 libxrandr2 xdg-utils ntpdate openssl | ||
|
||
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ | ||
&& dpkg -i google-chrome*.deb \ | ||
&& rm google-chrome*.deb | ||
|
||
RUN python3 -m pip install robotframework && pip install robotframework-requests \ | ||
&& pip install xvfbwrapper && pip install robotframework-xvfb && pip install certifi && pip install asn1crypto \ | ||
&& pip install bcrypt && pip install robotframework-sshlibrary && pip install cryptography && pip install pyOpenSSL \ | ||
&& pip install idna && pip install requests[security] && pip install robotframework-seleniumlibrary | ||
|
||
RUN pip install webdrivermanager | ||
RUN webdrivermanager firefox chrome --linkpath /usr/local/bin | ||
|
||
CMD ["/work/tools/robot/run_suite.sh"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# Run an individual test suite if the TEST_SUITE environmental variable is set. | ||
if [ -z "$TEST_SUITE" ]; then | ||
TEST_SUITE="" | ||
fi | ||
|
||
CMD="robot --console verbose --outputdir /work/test/.report /work/test/suites/$TEST_SUITE" | ||
|
||
echo ${CMD} | ||
|
||
``${CMD}`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 283563576583.dkr.ecr.eu-west-1.amazonaws.com | ||
|
||
IMAGE_TAG=hassu-robot | ||
REPO_TAG=283563576583.dkr.ecr.eu-west-1.amazonaws.com/$IMAGE_TAG:latest | ||
aws ecr create-repository --repository-name $IMAGE_TAG || true | ||
docker pull $REPO_TAG || true | ||
docker build --progress=plain --cache-from $REPO_TAG -t $IMAGE_TAG:latest -f ./tools/robot/Dockerfile . | ||
docker tag $IMAGE_TAG:latest $REPO_TAG | ||
docker push $REPO_TAG |