Kaynağa Gözat

fix: make --record optional for cypress tests (#18332)

version-14
Revant Nandgaonkar 2 yıl önce
committed by GitHub
ebeveyn
işleme
db3736eff3
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 6 ekleme ve 2 silme
  1. +6
    -2
      frappe/commands/utils.py

+ 6
- 2
frappe/commands/utils.py Dosyayı Görüntüle

@@ -841,9 +841,10 @@ def run_parallel_tests(
@click.option("--parallel", is_flag=True, help="Run UI Test in parallel 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("--with-coverage", is_flag=True, help="Generate coverage report")
@click.option("--ci-build-id") @click.option("--ci-build-id")
@click.option("--record", is_flag=True, help="Record using Cypress Dashboard")
@pass_context @pass_context
def run_ui_tests( 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, record=False
): ):
"Run UI tests" "Run UI tests"
site = get_site(context) site = get_site(context)
@@ -888,9 +889,12 @@ def run_ui_tests(
frappe.commands.popen(f"yarn add {packages} --no-lockfile") frappe.commands.popen(f"yarn add {packages} --no-lockfile")


# run for headless mode # run for headless mode
run_or_open = "run --browser chrome --record" if headless else "open"
run_or_open = "run --browser chrome" if headless else "open"
formatted_command = f"{site_env} {password_env} {coverage_env} {cypress_path} {run_or_open}" formatted_command = f"{site_env} {password_env} {coverage_env} {cypress_path} {run_or_open}"


if record:
run_or_open += " --record"

if parallel: if parallel:
formatted_command += " --parallel" formatted_command += " --parallel"




Yükleniyor…
İptal
Kaydet