From 1f9b01af0e09a7fcc9ade1bae32bef59036c64c1 Mon Sep 17 00:00:00 2001 From: wojtaszczyk Date: Fri, 9 Aug 2024 16:57:14 +0200 Subject: [PATCH] Nowy workflow, cz4 --- .github/workflows/ci-selenium.yml | 32 +++++++++++++++++++++++++++++++ tests/TestExample.py | 19 ++++++++++++++++++ wymagania.txt | 1 + 3 files changed, 52 insertions(+) create mode 100644 .github/workflows/ci-selenium.yml create mode 100644 tests/TestExample.py diff --git a/.github/workflows/ci-selenium.yml b/.github/workflows/ci-selenium.yml new file mode 100644 index 0000000..f18daaf --- /dev/null +++ b/.github/workflows/ci-selenium.yml @@ -0,0 +1,32 @@ + name: Selenium Python CI + #chcemy żeby zaczął się po push'u + on: [push] + jobs: + build: + runs-on: ubuntu-latest + + services: + selenium: + image: selenium/standalone-chrome:latest + options: >- + --shm-size 2g + ports: + - 4444:4444 + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: action/setup-python@v4 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade.pip + pip install -r wymagania.txt + - name: Run tests + env: + SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub + run: | + pytest --driver Remote --capability browserName chrome \ No newline at end of file diff --git a/tests/TestExample.py b/tests/TestExample.py new file mode 100644 index 0000000..13a83b4 --- /dev/null +++ b/tests/TestExample.py @@ -0,0 +1,19 @@ +import unittest + +from selenium import webdriver + + +class TestExample(unittest.TestCase): + + def setUp(self): + self.driver = webdriver.Chrome() + + def test_title(self): + driver = self.driver + driver.get("http://demo-store.seleniumacademy.com/") + + def tearDown(self): + self.driver.close() + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/wymagania.txt b/wymagania.txt index 890259a..31d39bd 100644 --- a/wymagania.txt +++ b/wymagania.txt @@ -1,2 +1,3 @@ currencies pytest +selenium \ No newline at end of file