-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: run cypress headless in ci #30426
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,9 @@ def run_cypress_for_test_file( | |
os.environ["TERM"] = "xterm" | ||
os.environ["ELECTRON_DISABLE_GPU"] = "true" | ||
build_id = generate_build_id() | ||
browser = os.getenv("CYPRESS_BROWSER", "chrome") | ||
browser = os.getenv("CYPRESS_BROWSER", "electron") | ||
|
||
# Add --disable-dev-shm-usage for Chrome browser | ||
chrome_flags = "--disable-dev-shm-usage" | ||
|
||
# Create Cypress command for a single test file | ||
|
@@ -61,7 +63,7 @@ def run_cypress_for_test_file( | |
os.environ.pop("CYPRESS_RECORD_KEY", None) | ||
cmd = ( | ||
f"{XVFB_PRE_CMD} " | ||
f"{cypress_cmd} --browser {browser} " | ||
f"{cypress_cmd} --browser {browser} --headless " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was testing to see if that was the case, but so far haven't seen any test failures related to it. I think it should be able to take screenshots headlessly, is my guess. This is actually the default flag, so this may already be running headlessly. |
||
f'--spec "{test_file}" ' | ||
f"-- {chrome_flags}" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit concerned to bring yet another engine in the mix, specifically for tests/automation. Supporting two is already a challenge, and thinking now that we should just pick one engine, either Chrome or Firefox, and use is consistently for thumbnail-generation, alert & reports and in e2e tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also confused about what electron
--headless
means, isn't electron a "head" by definition? Did a tiny bit of research just now, and Electron uses Blink (a fork of webkit), Chrome/Chromium use Blink as well, and FF uses Gecko. So chrome/chromium/electron in headless more should be pretty much the same AFAIK