rework-output-and-test-logic (#3)
* fix flakey tests in authentik / wordpress * make it possible to rerun tests partially -> passed will be skipped, failed will be repeated * improve organization of all outputs (moving, renaming, keeping multiple versions etc.) * add html reports, replace .txt tracebacks * combine all html reports into one * add demo runner with comments for documentation purposes Reviewed-on: local-it-infrastructure/e2e_tests#3 Co-authored-by: Daniel <d.brummerloh@gmail.com> Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
parent
d2cd6ba47f
commit
8172f685de
24 changed files with 588 additions and 418 deletions
|
|
@ -5,18 +5,22 @@ from playwright.sync_api import BrowserContext
|
|||
|
||||
from src.dirmanager import DirManager
|
||||
|
||||
TIMEOUT = 5000
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def admin_session(context: BrowserContext, DIR: DirManager) -> BrowserContext:
|
||||
def admin_context(context: BrowserContext, DIR: DirManager) -> BrowserContext:
|
||||
state_file = DIR.STATES / "admin_state.json"
|
||||
storage_state = json.loads(state_file.read_bytes())
|
||||
context.add_cookies(storage_state["cookies"])
|
||||
context.set_default_timeout(TIMEOUT)
|
||||
return context
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def user_session(context: BrowserContext, DIR: DirManager) -> BrowserContext:
|
||||
def user_context(context: BrowserContext, DIR: DirManager) -> BrowserContext:
|
||||
state_file = DIR.STATES / "user_state.json"
|
||||
storage_state = json.loads(state_file.read_bytes())
|
||||
context.add_cookies(storage_state["cookies"])
|
||||
context.set_default_timeout(TIMEOUT)
|
||||
return context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue