add timeout parameter to cli and to pytest_abra
This commit is contained in:
parent
a499891fe8
commit
8a136e5e6c
4 changed files with 19 additions and 17 deletions
|
|
@ -12,22 +12,15 @@ from pytest_abra.utils import get_datetime_string
|
|||
def run():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--env_paths", type=str, help="List of loaded env files separated with ;")
|
||||
parser.add_argument("--recipes_dir", type=str, help="List of loaded env files separated with ;")
|
||||
parser.add_argument("--output_dir", type=str, help="List of loaded env files separated with ;")
|
||||
|
||||
parser.add_argument("--recipes_dir", type=Path, help="List of loaded env files separated with ;")
|
||||
parser.add_argument("--output_dir", type=Path, help="List of loaded env files separated with ;")
|
||||
parser.add_argument("--timeout", type=int, help="Set Playwright timeout in ms", default=20_000)
|
||||
parser.add_argument("--debug", action="store_true", help="Enable Playwright debug mode")
|
||||
parser.add_argument(
|
||||
"--resume", action="store_true", help="Re-run the most recent test, only running tests without status 'passed'"
|
||||
)
|
||||
parser.add_argument("--resume", action="store_true", help="Re-run the most recent test, skipping passed tests")
|
||||
args = parser.parse_args()
|
||||
|
||||
ENV_FILES = [Path(s) for s in args.env_paths.split(";")]
|
||||
|
||||
# ----------------------------- define ouptut dir ---------------------------- #
|
||||
|
||||
RECIPES_DIR = Path(args.recipes_dir)
|
||||
OUTPUT_DIR = Path(args.output_dir)
|
||||
|
||||
# -------------------------- enable playwright debug ------------------------- #
|
||||
|
||||
if args.debug:
|
||||
|
|
@ -43,14 +36,19 @@ def run():
|
|||
|
||||
# ------------------------------- setup logging ------------------------------ #
|
||||
|
||||
DIR = DirManager(output_dir=OUTPUT_DIR, session_id=session_id)
|
||||
# todo: move to Coordinator
|
||||
DIR = DirManager(output_dir=args.output_dir, session_id=session_id)
|
||||
log_file = DIR.RECORDS / "coordinator.log"
|
||||
logger.add(log_file)
|
||||
|
||||
# ---------------------------- initialize and run ---------------------------- #
|
||||
|
||||
coordinator = Coordinator(
|
||||
env_paths_list=ENV_FILES, output_dir=OUTPUT_DIR, session_id=session_id, recipes_dir=RECIPES_DIR
|
||||
env_paths_list=ENV_FILES,
|
||||
output_dir=args.output_dir,
|
||||
session_id=session_id,
|
||||
recipes_dir=args.recipes_dir,
|
||||
timeout=args.timeout,
|
||||
)
|
||||
coordinator.setup_test()
|
||||
coordinator.run_test()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue