Skip to content
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

Allow visually debugging webdriver tests locally #3343

Merged
merged 1 commit into from
Feb 3, 2023
Merged

Conversation

bduffany
Copy link
Member

@bduffany bduffany commented Feb 2, 2023

When running bazel tests with --config=webdriver-debug, tests will now spawn the GUI for chrome (instead of running in --headless mode), so you can see what the test is doing.

If the test fails, the browser window will stay open for 3s so you can see what state the app is in when the failure happened. This duration can be extended further so you can go in and check devtools etc., by setting --test_arg=-webdriver_end_of_test_delay=1h (this is super rudimentary for now; there is probably a better way to do this).

Also when running under this debug config, pass --verbose to chromedriver, so that if chrome crashes on startup, the root cause will be logged (by default, it logs a super opaque error just saying that chrome has crashed).

Tangentially related: this PR also updates the Go repo version for rules_webtesting to match the http_archive version in /WORKSPACE (the Go repo was behind the WORKSPACE repo due to bazelbuild/rules_webtesting#452)

rec-2023-02-02_14.12.35.mp4

Version bump: Patch

@bduffany bduffany changed the title Add a Bazel config for debugging webdriver tests locally Allow visually debugging webdriver tests locally Feb 2, 2023
@bduffany bduffany force-pushed the webdriver-debug branch 2 times, most recently from f16e2ff to f92315d Compare February 2, 2023 19:07
Copy link
Contributor

@maggie-lou maggie-lou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I kept manually adding support for this while developing the webdriver tests - will be much nicer to have a config

@bduffany bduffany merged commit 50a1af4 into master Feb 3, 2023
@bduffany bduffany deleted the webdriver-debug branch February 3, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants