fix: avoid package.json update during cypress install

This commit is contained in:
Sagar Vora 2025-12-01 21:21:12 +05:30
parent 84af5adecd
commit 83f2368ccd

View file

@ -492,8 +492,17 @@ def run_ui_tests(
"@cypress/code-coverage@^3",
]
)
# save package.json, install, then restore to avoid modifications
package_json_path = frappe.get_app_source_path("frappe", "package.json")
with open(package_json_path) as f:
package_json_contents = f.read()
frappe.commands.popen(f"(cd ../frappe && yarn add {packages} --no-lockfile)")
with open(package_json_path, "w") as f:
f.write(package_json_contents)
# run for headless mode
run_or_open = f"run --browser {browser}" if headless else "open"
if headless and spec: