Merge pull request #35002 from sagarvora/save-restore-package-json
fix: avoid package.json update during cypress install
This commit is contained in:
commit
3dadf11bd9
1 changed files with 9 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue