installable package #9
21 changed files with 43 additions and 45 deletions
16
README.md
16
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
|
||||
|
|
|
|||
8
main.py
8
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"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from abratest.utils import BaseUrl
|
||||
from pytest_abra.utils import BaseUrl
|
||||
|
||||
url_input = {
|
||||
"netloc": "blog.dev.local-it.cloud",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue