run the tests
This commit is contained in:
parent
63fcdbc922
commit
4e3c267656
24
.gitea/workflows/execute.yml
Normal file
24
.gitea/workflows/execute.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: Execute
|
||||||
|
|
||||||
|
on: [ push ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-gitea
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [ "3.12" ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install -r requirements.txt
|
||||||
|
- name: Run the pytests
|
||||||
|
run: pytest -c pytest.ini
|
||||||
|
- name: Run the behave tests
|
||||||
|
run: behave
|
@ -25,6 +25,7 @@ def firefox(headless=True):
|
|||||||
options = webdriver.FirefoxOptions()
|
options = webdriver.FirefoxOptions()
|
||||||
options.accept_insecure_certs = True
|
options.accept_insecure_certs = True
|
||||||
options.headless = headless
|
options.headless = headless
|
||||||
|
options.add_argument('--ignore-certificate-errors')
|
||||||
return webdriver.Firefox(options=options)
|
return webdriver.Firefox(options=options)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
import configparser
|
import configparser
|
||||||
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session", autouse=True)
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
def headless():
|
def headless():
|
||||||
return _str_to_bool(_read_config_section("fixtures.ini", "dev")["headless"])
|
config_file = os.path.join(CWD, "fixtures.ini")
|
||||||
|
dev_config = _read_config_section(config_file, 'dev')
|
||||||
|
return _str_to_bool(dev_config["headless"])
|
||||||
|
|
||||||
|
|
||||||
def _read_config_section(source, section):
|
def _read_config_section(source, section):
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
[dev]
|
[dev]
|
||||||
headless = True
|
headless=true
|
||||||
|
@ -1,29 +1,32 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
from browserdriver import BrowserDriver
|
from browserdriver import BrowserDriver
|
||||||
|
|
||||||
|
|
||||||
def test_firefox_browser(headless):
|
def test_firefox_browser(headless):
|
||||||
bd = BrowserDriver().get("firefox", headless=headless)
|
bd = BrowserDriver().get("firefox", headless=headless)
|
||||||
bd.get('https://test.io')
|
bd.get('https://test.io')
|
||||||
assert "QA Testing as a Service | test IO" == bd.title
|
assert bd.title == "Home | Test IO"
|
||||||
bd.quit()
|
bd.quit()
|
||||||
|
|
||||||
|
|
||||||
def test_chrome_browser(headless):
|
def test_chrome_browser(headless):
|
||||||
bd = BrowserDriver().get("chrome", headless=headless)
|
bd = BrowserDriver().get("chrome", headless=headless)
|
||||||
bd.get('https://test.io')
|
bd.get('https://test.io')
|
||||||
assert "QA Testing as a Service | test IO" == bd.title
|
assert bd.title == "Home | Test IO"
|
||||||
bd.quit()
|
bd.quit()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Safari is not available")
|
||||||
def test_safari_browser():
|
def test_safari_browser():
|
||||||
bd = BrowserDriver().get("safari", headless=False)
|
bd = BrowserDriver().get("safari", headless=False)
|
||||||
bd.get('https://test.io')
|
bd.get('https://test.io')
|
||||||
assert "QA Testing as a Service | test IO" == bd.title
|
assert bd.title == "Home | Test IO"
|
||||||
bd.quit()
|
bd.quit()
|
||||||
|
|
||||||
|
|
||||||
def test_edge_browser(headless):
|
def test_edge_browser(headless):
|
||||||
bd = BrowserDriver().get("edge", headless=headless)
|
bd = BrowserDriver().get("edge", headless=headless)
|
||||||
bd.get('https://test.io')
|
bd.get('https://test.io')
|
||||||
assert "QA Testing as a Service | test IO" == bd.title
|
assert bd.title == "Home | Test IO"
|
||||||
bd.quit()
|
bd.quit()
|
||||||
|
Loading…
Reference in New Issue
Block a user