installable package (#9)
* turn repo into installable package (pip install -e .) * add hatchling build packend * call it pytest-abra * add pytest entrypoint, so that it gets loaded automatically if installed (and pytest is run) * make fixtures optional, so that pytest can still be used in other context * add cli script -> you can now directly run "pytest-abra" in console Reviewed-on: local-it-infrastructure/e2e_tests#9 Co-authored-by: Daniel <d.brummerloh@gmail.com> Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
parent
4c5a470a70
commit
8685688698
33 changed files with 294 additions and 210 deletions
|
|
@ -3,8 +3,8 @@ import json
|
|||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from abratest.utils import BaseUrl
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
from pytest_abra.utils import BaseUrl
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from abratest.runner import Runner, Test
|
||||
from pytest_abra.runner import Runner, Test
|
||||
|
||||
|
||||
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import re
|
|||
|
||||
from playwright.sync_api import BrowserContext, expect
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from abratest.utils import BaseUrl
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
from pytest_abra.utils import BaseUrl
|
||||
|
||||
ADMIN_USER = os.environ["ADMIN_USER"]
|
||||
ADMIN_PASS = os.environ["ADMIN_PASS"]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ depend on [demo]. For this to work
|
|||
1. the Runner class of the other test needs to define the depencency as seen
|
||||
by referencing RunnerDemo in the dependencies list:
|
||||
|
||||
from abratest.tests_demo.runner_demo import RunnerDemo
|
||||
from pytest_abra.tests_demo.runner_demo import RunnerDemo
|
||||
|
||||
class RunnerOther(Runner):
|
||||
dependencies = [RunnerDemo]
|
||||
|
|
@ -15,7 +15,7 @@ class RunnerOther(Runner):
|
|||
To globally import for all tests in 'other', the import should be done in conftest:
|
||||
|
||||
in 'conftest.py' in 'test_other' dir:
|
||||
from abratest.tests_demo.fixtures_demo import demo_fixture
|
||||
from pytest_abra.tests_demo.fixtures_demo import demo_fixture
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from abratest.runner import Runner, Test
|
||||
from pytest_abra.runner import Runner, Test
|
||||
|
||||
|
||||
class RunnerDemo(Runner):
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import os
|
|||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from abratest.utils import BaseUrl
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
from pytest_abra.utils import BaseUrl
|
||||
|
||||
pytest_plugins = "authentik.tests_authentik.fixtures_authentik"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from abratest.runner import Runner, Test
|
||||
from pytest_abra.runner import Runner, Test
|
||||
|
||||
|
||||
def condition_always_false(dotenv_config: dict[str, str]) -> bool:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from playwright.sync_api import Page, expect
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from abratest.utils import BaseUrl
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
from pytest_abra.utils import BaseUrl
|
||||
|
||||
# url dashboard
|
||||
# https://files.test.dev.local-it.cloud/apps/dashboard/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import pytest
|
|||
from dotenv import dotenv_values
|
||||
from playwright.sync_api import BrowserContext, Page
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
|
||||
pytest_plugins = "authentik.tests_authentik.fixtures_authentik"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from abratest.runner import Runner, Test
|
||||
from pytest_abra.runner import Runner, Test
|
||||
|
||||
|
||||
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
|
||||
|
||||
def test_visit_from_domain(authentik_admin_context: BrowserContext, dotenv_config: dict[str, str]):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from playwright.sync_api import BrowserContext, expect
|
||||
|
||||
from abratest.dir_manager import DirManager
|
||||
from pytest_abra.dir_manager import DirManager
|
||||
|
||||
|
||||
def test_welcome_message(context: BrowserContext, dotenv_config: dict[str, str], DIR: DirManager):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue