Merge pull request #35002 from sagarvora/save-restore-package-json

fix: avoid package.json update during cypress install
This commit is contained in:
Sagar Vora 2025-12-01 21:32:31 +05:30 committed by GitHub
commit 3dadf11bd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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: