From 080bee61ef37ab390c3e8ff982d4df2b36b2f3f6 Mon Sep 17 00:00:00 2001 From: Ilmari Marttila Date: Sun, 24 Mar 2024 17:45:59 +0200 Subject: [PATCH] Run robot tests on CI --- .github/workflows/robot.yml | 32 ++++++++++++++++++++++++++++++++ web/robot/perustoiminnot.robot | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/robot.yml diff --git a/.github/workflows/robot.yml b/.github/workflows/robot.yml new file mode 100644 index 00000000..ca598cae --- /dev/null +++ b/.github/workflows/robot.yml @@ -0,0 +1,32 @@ +--- +name: Robot framework tests + +on: push + +jobs: + basic-funtionality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: start SUT + run: docker compose up --quiet-pull --detach --build + - name: Set up Python 3.12.1 + uses: actions/setup-python@v5 + with: + python-version: 3.12.1 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install robotframework + pip install robotframework-seleniumlibrary + - name: wait SUT to start + run: while ! curl -s -f 'http://localhost:3000/kipa' ; do sleep 2; docker ps; done + shell: bash + - name: run robot + run: robot --outputdir ./test-report --variable BROWSER:headlessfirefox --exitonfailure web/robot/perustoiminnot.robot + - name: report + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-report + path: ./test-report diff --git a/web/robot/perustoiminnot.robot b/web/robot/perustoiminnot.robot index 41034782..c1cf2cd8 100644 --- a/web/robot/perustoiminnot.robot +++ b/web/robot/perustoiminnot.robot @@ -5,7 +5,7 @@ Suite Teardown Close All Browsers And Stop Selenium Server Test Setup Open Competition Test Teardown Close Browser Force Tags regression smoke -Library Selenium2Library +Library SeleniumLibrary Resource yhteiset_resurssit.resource Variables kipa_sivuosoitteet_ja_otsikot.py