diff --git a/README.md b/README.md index 2ceb297..6e91a5f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# AbraTest +# pytest-abra ...description... # Usage -To use AbraTest, follow these steps: +To use pytest-abra, follow these steps: ## 1. GIT Clone @@ -17,7 +17,7 @@ git submodule update --remote // update submodules ## Run -You can run AbraTest with and without Docker. Choose now and follow the steps accordingly: +You can run pytest-abra with and without Docker. Choose now and follow the steps accordingly: ## 2.1 Run without Docker @@ -33,17 +33,17 @@ playwright install Run the script with ```bash -python main.py # run abratest -pytest # test abratest -pytest --collect-only # debug test abratest +python main.py # run pytest-abra +pytest # test pytest-abra +pytest --collect-only # debug test pytest-abra ``` # 2.2 Run with Docker ```bash docker compose build # build the image -docker compose run --rm app ./run_abratest.sh # run AbraTest -docker compose run --rm app ./test_abratest.sh # test AbraTest +docker compose run --rm app ./run_pytest-abra.sh # run pytest-abra +docker compose run --rm app ./test_pytest-abra.sh # test pytest-abra ``` Force rebuild with cache diff --git a/main.py b/main.py index eb4bc7b..b939aa5 100644 --- a/main.py +++ b/main.py @@ -4,9 +4,9 @@ from pathlib import Path from loguru import logger -from abratest.coordinator import Coordinator -from abratest.dir_manager import DirManager -from abratest.utils import get_session_id +from pytest_abra.coordinator import Coordinator +from pytest_abra.dir_manager import DirManager +from pytest_abra.utils import get_session_id # ----------------------------- lookup env files ----------------------------- # @@ -48,8 +48,6 @@ for key, value in CREDENTIALS.items(): # -------------------------- enable playwright debug ------------------------- # -# add abra-testing dir -# os.environ["PYTEST_PLUGINS"] = "abratest.plugin-abra" # os.environ["PWDEBUG"] = "1" diff --git a/previous-work/wordpress_test.py b/previous-work/wordpress_test.py index bf61351..9f8173f 100644 --- a/previous-work/wordpress_test.py +++ b/previous-work/wordpress_test.py @@ -1,6 +1,6 @@ from playwright.sync_api import BrowserContext, expect -from abratest.dir_manager import DirManager +from pytest_abra.dir_manager import DirManager def test_wordpress(admin_session: BrowserContext, dotenv_config: dict[str, str], DIR: DirManager): diff --git a/pytest_abra/coordinator.py b/pytest_abra/coordinator.py index 28a5102..8dd6f0f 100644 --- a/pytest_abra/coordinator.py +++ b/pytest_abra/coordinator.py @@ -4,11 +4,11 @@ from pathlib import Path from loguru import logger -from abratest.dir_manager import DirManager -from abratest.env_manager import EnvFile, EnvManager -from abratest.html_helper import merge_html_files -from abratest.runner import Runner -from abratest.utils import rmtree +from pytest_abra.dir_manager import DirManager +from pytest_abra.env_manager import EnvFile, EnvManager +from pytest_abra.html_helper import merge_html_files +from pytest_abra.runner import Runner +from pytest_abra.utils import rmtree class Coordinator: diff --git a/pytest_abra/env_manager.py b/pytest_abra/env_manager.py index 780436f..f6f16b5 100644 --- a/pytest_abra/env_manager.py +++ b/pytest_abra/env_manager.py @@ -4,8 +4,8 @@ from typing import NamedTuple from dotenv import dotenv_values -from abratest.dir_manager import DirManager -from abratest.runner import Runner +from pytest_abra.dir_manager import DirManager +from pytest_abra.runner import Runner class EnvFile(NamedTuple): diff --git a/pytest_abra/pytest_abra.py b/pytest_abra/pytest_abra.py index c72b21b..e2f28ae 100644 --- a/pytest_abra/pytest_abra.py +++ b/pytest_abra/pytest_abra.py @@ -14,8 +14,8 @@ from dotenv import dotenv_values from playwright.sync_api import BrowserContext, expect from pytest import Parser -from abratest.dir_manager import DirManager -from abratest.utils import BaseUrl +from pytest_abra.dir_manager import DirManager +from pytest_abra.utils import BaseUrl # global timeout and LOCALE LOCALE = {"Accept-Language": "de_DE"} diff --git a/pytest_abra/runner.py b/pytest_abra/runner.py index c9cbc9e..7486be3 100644 --- a/pytest_abra/runner.py +++ b/pytest_abra/runner.py @@ -6,8 +6,8 @@ import pytest from loguru import logger if TYPE_CHECKING: - from abratest.coordinator import Coordinator - from abratest.env_manager import EnvFile + from pytest_abra.coordinator import Coordinator + from pytest_abra.env_manager import EnvFile @dataclass diff --git a/recipes/authentik/tests_authentik/fixtures_authentik.py b/recipes/authentik/tests_authentik/fixtures_authentik.py index 34ed3d7..fa50e3f 100644 --- a/recipes/authentik/tests_authentik/fixtures_authentik.py +++ b/recipes/authentik/tests_authentik/fixtures_authentik.py @@ -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 diff --git a/recipes/authentik/tests_authentik/runner_authentik.py b/recipes/authentik/tests_authentik/runner_authentik.py index b83da2f..fb8c3b2 100644 --- a/recipes/authentik/tests_authentik/runner_authentik.py +++ b/recipes/authentik/tests_authentik/runner_authentik.py @@ -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: diff --git a/recipes/authentik/tests_authentik/setup_authentik.py b/recipes/authentik/tests_authentik/setup_authentik.py index b7f7f37..680a85d 100644 --- a/recipes/authentik/tests_authentik/setup_authentik.py +++ b/recipes/authentik/tests_authentik/setup_authentik.py @@ -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"] diff --git a/recipes/demo/tests_demo/fixtures_demo.py b/recipes/demo/tests_demo/fixtures_demo.py index b271e60..c650202 100644 --- a/recipes/demo/tests_demo/fixtures_demo.py +++ b/recipes/demo/tests_demo/fixtures_demo.py @@ -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 diff --git a/recipes/demo/tests_demo/runner_demo.py b/recipes/demo/tests_demo/runner_demo.py index 2b9aa78..e735e5f 100644 --- a/recipes/demo/tests_demo/runner_demo.py +++ b/recipes/demo/tests_demo/runner_demo.py @@ -1,4 +1,4 @@ -from abratest.runner import Runner, Test +from pytest_abra.runner import Runner, Test class RunnerDemo(Runner): diff --git a/recipes/nextcloud/tests_nextcloud/conftest.py b/recipes/nextcloud/tests_nextcloud/conftest.py index abdf9f9..ce56379 100644 --- a/recipes/nextcloud/tests_nextcloud/conftest.py +++ b/recipes/nextcloud/tests_nextcloud/conftest.py @@ -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" diff --git a/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py b/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py index 5f7fe27..79b5050 100644 --- a/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py +++ b/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py @@ -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: diff --git a/recipes/nextcloud/tests_nextcloud/setup_nextcloud.py b/recipes/nextcloud/tests_nextcloud/setup_nextcloud.py index 020d56d..f400ce3 100644 --- a/recipes/nextcloud/tests_nextcloud/setup_nextcloud.py +++ b/recipes/nextcloud/tests_nextcloud/setup_nextcloud.py @@ -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/ diff --git a/recipes/wordpress/tests_wordpress/conftest.py b/recipes/wordpress/tests_wordpress/conftest.py index c91a525..77977a9 100644 --- a/recipes/wordpress/tests_wordpress/conftest.py +++ b/recipes/wordpress/tests_wordpress/conftest.py @@ -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" diff --git a/recipes/wordpress/tests_wordpress/runner_wordpress.py b/recipes/wordpress/tests_wordpress/runner_wordpress.py index 846f069..eae53ee 100644 --- a/recipes/wordpress/tests_wordpress/runner_wordpress.py +++ b/recipes/wordpress/tests_wordpress/runner_wordpress.py @@ -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: diff --git a/recipes/wordpress/tests_wordpress/setup_wordpress.py b/recipes/wordpress/tests_wordpress/setup_wordpress.py index 0d8243a..b9fd773 100644 --- a/recipes/wordpress/tests_wordpress/setup_wordpress.py +++ b/recipes/wordpress/tests_wordpress/setup_wordpress.py @@ -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]): diff --git a/recipes/wordpress/tests_wordpress/test_wordpress_localization.py b/recipes/wordpress/tests_wordpress/test_wordpress_localization.py index 1583a9f..a0c76ba 100644 --- a/recipes/wordpress/tests_wordpress/test_wordpress_localization.py +++ b/recipes/wordpress/tests_wordpress/test_wordpress_localization.py @@ -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): diff --git a/tests/test_env_resolution.py b/tests/test_env_resolution.py index 87f6f7c..4b11941 100644 --- a/tests/test_env_resolution.py +++ b/tests/test_env_resolution.py @@ -2,8 +2,8 @@ from pathlib import Path import pytest -from abratest.coordinator import Coordinator -from abratest.env_manager import DependencyRule, EnvFile, EnvManager +from pytest_abra.coordinator import Coordinator +from pytest_abra.env_manager import DependencyRule, EnvFile, EnvManager RECIPES_DIR = Path("./recipes").resolve() RUNNER_DICT = Coordinator.create_runner_dict(RECIPES_DIR) diff --git a/tests/test_url.py b/tests/test_url.py index 680023f..82b9f44 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -1,4 +1,4 @@ -from abratest.utils import BaseUrl +from pytest_abra.utils import BaseUrl url_input = { "netloc": "blog.dev.local-it.cloud",