test: allow passing arbitrary args to cypress (#17997)
This commit is contained in:
parent
5e6fbc4d99
commit
4944246a0d
1 changed files with 17 additions and 2 deletions
|
|
@ -837,15 +837,27 @@ def run_parallel_tests(
|
|||
ParallelTestRunner(app, site=site, build_number=build_number, total_builds=total_builds)
|
||||
|
||||
|
||||
@click.command("run-ui-tests")
|
||||
@click.command(
|
||||
"run-ui-tests",
|
||||
context_settings=dict(
|
||||
ignore_unknown_options=True,
|
||||
),
|
||||
)
|
||||
@click.argument("app")
|
||||
@click.argument("cypressargs", nargs=-1, type=click.UNPROCESSED)
|
||||
@click.option("--headless", is_flag=True, help="Run UI Test in headless mode")
|
||||
@click.option("--parallel", is_flag=True, help="Run UI Test in parallel mode")
|
||||
@click.option("--with-coverage", is_flag=True, help="Generate coverage report")
|
||||
@click.option("--ci-build-id")
|
||||
@pass_context
|
||||
def run_ui_tests(
|
||||
context, app, headless=False, parallel=True, with_coverage=False, ci_build_id=None
|
||||
context,
|
||||
app,
|
||||
headless=False,
|
||||
parallel=True,
|
||||
with_coverage=False,
|
||||
ci_build_id=None,
|
||||
cypressargs=None,
|
||||
):
|
||||
"Run UI tests"
|
||||
site = get_site(context)
|
||||
|
|
@ -901,6 +913,9 @@ def run_ui_tests(
|
|||
if ci_build_id:
|
||||
formatted_command += f" --ci-build-id {ci_build_id}"
|
||||
|
||||
if cypressargs:
|
||||
formatted_command += " " + " ".join(cypressargs)
|
||||
|
||||
click.secho("Running Cypress...", fg="yellow")
|
||||
frappe.commands.popen(formatted_command, cwd=app_base_path, raise_err=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue