rename src to abratest
This commit is contained in:
parent
d2f50fb791
commit
01c294d44b
26 changed files with 43 additions and 43 deletions
|
|
@ -2,12 +2,12 @@ from pathlib import Path
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.env_manager import EnvFile, EnvManager
|
from abratest.env_manager import EnvFile, EnvManager
|
||||||
from src.html_helper import merge_html_files
|
from abratest.html_helper import merge_html_files
|
||||||
from src.runner import Runner
|
from abratest.runner import Runner
|
||||||
from src.runner_dict import RUNNER_DICT
|
from abratest.runner_dict import RUNNER_DICT
|
||||||
from src.utils import rmtree
|
from abratest.utils import rmtree
|
||||||
|
|
||||||
|
|
||||||
class Coordinator:
|
class Coordinator:
|
||||||
|
|
@ -4,9 +4,9 @@ from typing import NamedTuple
|
||||||
|
|
||||||
from dotenv import dotenv_values
|
from dotenv import dotenv_values
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.runner_dict import RUNNER_DICT
|
from abratest.runner_dict import RUNNER_DICT
|
||||||
from src.runner_manager import RunnerManager
|
from abratest.runner_manager import RunnerManager
|
||||||
|
|
||||||
|
|
||||||
class EnvFile(NamedTuple):
|
class EnvFile(NamedTuple):
|
||||||
|
|
@ -14,8 +14,8 @@ from dotenv import dotenv_values
|
||||||
from playwright.sync_api import BrowserContext, expect
|
from playwright.sync_api import BrowserContext, expect
|
||||||
from pytest import Parser
|
from pytest import Parser
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.utils import BaseUrl
|
from abratest.utils import BaseUrl
|
||||||
|
|
||||||
# global timeout and LOCALE
|
# global timeout and LOCALE
|
||||||
LOCALE = {"Accept-Language": "de_DE"}
|
LOCALE = {"Accept-Language": "de_DE"}
|
||||||
|
|
@ -6,7 +6,7 @@ import pytest
|
||||||
from dotenv import dotenv_values
|
from dotenv import dotenv_values
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
@ -64,7 +64,7 @@ class Runner:
|
||||||
# condition_met: true / false
|
# condition_met: true / false
|
||||||
|
|
||||||
identifier_string = self.combine_names(self.name, test.test_file)
|
identifier_string = self.combine_names(self.name, test.test_file)
|
||||||
full_test_path = self.DIR.RECIPES / self.test_dir_name / test.test_file
|
full_test_path = self.DIR.RECIPES / self.name / self.test_dir_name / test.test_file
|
||||||
|
|
||||||
# check if test aleady passed
|
# check if test aleady passed
|
||||||
if self._is_test_passed(identifier_string, remove_existing=True):
|
if self._is_test_passed(identifier_string, remove_existing=True):
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from tests_authentik.runner_authentik import RunnerAuthentik
|
from authentik.tests_authentik.runner_authentik import RunnerAuthentik
|
||||||
from tests_nextcloud.runner_nextcloud import RunnerNextcloud
|
from nextcloud.tests_nextcloud.runner_nextcloud import RunnerNextcloud
|
||||||
from tests_wordpress.runner_wordpress import RunnerWordpress
|
from wordpress.tests_wordpress.runner_wordpress import RunnerWordpress
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from src.runner import Runner
|
from abratest.runner import Runner
|
||||||
|
|
||||||
# Register all runners here. Each .env file with TYPE=authentik will be run with RunnerAuthentik
|
# Register all runners here. Each .env file with TYPE=authentik will be run with RunnerAuthentik
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
|
||||||
from icecream import ic
|
from icecream import ic
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from src.env_manager import EnvFile, EnvManager
|
from abratest.env_manager import EnvFile, EnvManager
|
||||||
|
|
||||||
|
|
||||||
class RunnerManager:
|
class RunnerManager:
|
||||||
10
main.py
10
main.py
|
|
@ -4,9 +4,9 @@ from pathlib import Path
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from src.coordinator import Coordinator
|
from abratest.coordinator import Coordinator
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.utils import get_session_id
|
from abratest.utils import get_session_id
|
||||||
|
|
||||||
# ----------------------------- lookup env files ----------------------------- #
|
# ----------------------------- lookup env files ----------------------------- #
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ ENV_FILES = [
|
||||||
|
|
||||||
|
|
||||||
OUTPUT_DIR = Path("./test-output").resolve()
|
OUTPUT_DIR = Path("./test-output").resolve()
|
||||||
RECIPES_DIR = Path("./src-tests").resolve()
|
RECIPES_DIR = Path("./recipes").resolve()
|
||||||
|
|
||||||
|
|
||||||
# --------------------- load credentials to env variables -------------------- #
|
# --------------------- load credentials to env variables -------------------- #
|
||||||
|
|
@ -49,7 +49,7 @@ for key, value in CREDENTIALS.items():
|
||||||
|
|
||||||
|
|
||||||
# add abra-testing dir
|
# add abra-testing dir
|
||||||
os.environ["PYTEST_PLUGINS"] = "src.plugin-abra" # "src.plugin,src.other"
|
os.environ["PYTEST_PLUGINS"] = "abratest.plugin-abra" # "abratest.plugin,abratest.other"
|
||||||
# os.environ["PWDEBUG"] = "1"
|
# os.environ["PWDEBUG"] = "1"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from playwright.sync_api import BrowserContext, expect
|
from playwright.sync_api import BrowserContext, expect
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
|
|
||||||
|
|
||||||
def test_wordpress(admin_session: BrowserContext, dotenv_config: dict[str, str], DIR: DirManager):
|
def test_wordpress(admin_session: BrowserContext, dotenv_config: dict[str, str], DIR: DirManager):
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import pytest
|
||||||
from dotenv import dotenv_values
|
from dotenv import dotenv_values
|
||||||
from playwright.sync_api import BrowserContext, Page
|
from playwright.sync_api import BrowserContext, Page
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from src.runner import Runner, Test
|
from abratest.runner import Runner, Test
|
||||||
|
|
||||||
|
|
||||||
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
|
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import re
|
||||||
|
|
||||||
from playwright.sync_api import BrowserContext, expect
|
from playwright.sync_api import BrowserContext, expect
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.utils import BaseUrl
|
from abratest.utils import BaseUrl
|
||||||
|
|
||||||
ADMIN_USER = os.environ["ADMIN_USER"]
|
ADMIN_USER = os.environ["ADMIN_USER"]
|
||||||
ADMIN_PASS = os.environ["ADMIN_PASS"]
|
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
|
1. the Runner class of the other test needs to define the depencency as seen
|
||||||
by referencing RunnerDemo in the dependencies list:
|
by referencing RunnerDemo in the dependencies list:
|
||||||
|
|
||||||
from src.tests_demo.runner_demo import RunnerDemo
|
from abratest.tests_demo.runner_demo import RunnerDemo
|
||||||
|
|
||||||
class RunnerOther(Runner):
|
class RunnerOther(Runner):
|
||||||
dependencies = [RunnerDemo]
|
dependencies = [RunnerDemo]
|
||||||
|
|
@ -15,7 +15,7 @@ class RunnerOther(Runner):
|
||||||
To globally import for all tests in 'other', the import should be done in conftest:
|
To globally import for all tests in 'other', the import should be done in conftest:
|
||||||
|
|
||||||
in 'conftest.py' in 'test_other' dir:
|
in 'conftest.py' in 'test_other' dir:
|
||||||
from src.tests_demo.fixtures_demo import demo_fixture
|
from abratest.tests_demo.fixtures_demo import demo_fixture
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from src.runner import Runner, Test
|
from abratest.runner import Runner, Test
|
||||||
|
|
||||||
|
|
||||||
class RunnerDemo(Runner):
|
class RunnerDemo(Runner):
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import os
|
||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page
|
from playwright.sync_api import BrowserContext, Page
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.utils import BaseUrl
|
from abratest.utils import BaseUrl
|
||||||
|
|
||||||
pytest_plugins = "tests_authentik.fixtures_authentik"
|
pytest_plugins = "tests_authentik.fixtures_authentik"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from src.runner import Runner, Test
|
from abratest.runner import Runner, Test
|
||||||
|
|
||||||
|
|
||||||
def condition_always_false(dotenv_config: dict[str, str]) -> bool:
|
def condition_always_false(dotenv_config: dict[str, str]) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from playwright.sync_api import Page, expect
|
from playwright.sync_api import Page, expect
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
from src.utils import BaseUrl
|
from abratest.utils import BaseUrl
|
||||||
|
|
||||||
# url dashboard
|
# url dashboard
|
||||||
# https://files.test.dev.local-it.cloud/apps/dashboard/
|
# https://files.test.dev.local-it.cloud/apps/dashboard/
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import pytest
|
||||||
from dotenv import dotenv_values
|
from dotenv import dotenv_values
|
||||||
from playwright.sync_api import BrowserContext, Page
|
from playwright.sync_api import BrowserContext, Page
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
|
|
||||||
pytest_plugins = "tests_authentik.fixtures_authentik"
|
pytest_plugins = "tests_authentik.fixtures_authentik"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from src.runner import Runner, Test
|
from abratest.runner import Runner, Test
|
||||||
|
|
||||||
|
|
||||||
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
|
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
|
|
||||||
|
|
||||||
def test_visit_from_domain(authentik_admin_context: BrowserContext, dotenv_config: dict[str, str]):
|
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 playwright.sync_api import BrowserContext, expect
|
||||||
|
|
||||||
from src.dir_manager import DirManager
|
from abratest.dir_manager import DirManager
|
||||||
|
|
||||||
|
|
||||||
def test_welcome_message(context: BrowserContext, dotenv_config: dict[str, str], DIR: DirManager):
|
def test_welcome_message(context: BrowserContext, dotenv_config: dict[str, str], DIR: DirManager):
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
# from src.env_file_helper import DependencyRule, EnvFile, sort_env_files_by_rule
|
# from abratest.env_file_helper import DependencyRule, EnvFile, sort_env_files_by_rule
|
||||||
from src.env_manager import DependencyRule, EnvFile, EnvManager
|
from abratest.env_manager import DependencyRule, EnvFile, EnvManager
|
||||||
|
|
||||||
|
|
||||||
def test_complex_sorting() -> None:
|
def test_complex_sorting() -> None:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from src.utils import BaseUrl
|
from abratest.utils import BaseUrl
|
||||||
|
|
||||||
url_input = {
|
url_input = {
|
||||||
"netloc": "blog.dev.local-it.cloud",
|
"netloc": "blog.dev.local-it.cloud",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue