-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Improve WebDriver error message #81107
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
Improve WebDriver error message #81107
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
It seems reasonable that this could be test exempt but I would ask in the discord according to the instructions above. |
@Hixie did this get marked as test exempt or not? |
It did not (test-exempt PRs have a comment somewhere that starts with |
The current WebDriver message is incomplete. Add link to the documentation on WebDrivers for different browsers to help troubleshooting.
Add a simple test to verify that the WebDriver error message includes a link to the documentation.
bd9ef65
to
a480ed9
Compare
I just added a simple test to check that the error message contains the link that was added. However I must be missing the error in the PR that was mentioned; @Hixie would you mind elaborating to save some time? Is there more that I should be explicitly testing for in this change? Thanks for the help! |
packages/flutter_tools/test/general.shard/drive/drive_service_test.dart
Outdated
Show resolved
Hide resolved
@@ -111,6 +111,8 @@ class WebDriverService extends DriverService { | |||
'Unable to start WebDriver Session for Flutter for Web testing. \n' | |||
'Make sure you have the correct WebDriver Server running at $driverPort. \n' | |||
'Make sure the WebDriver Server matches option --browser-name. \n' | |||
'For more information see: ' | |||
'https://flutter.dev/docs/testing/integration-tests#running-in-a-browser \n' |
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.
the trailing space before the newline here is what i was referring to
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.
Okay, thanks for pointing it out. I assumed this was the correct style based on the existing message, but let me know if you prefer otherwise and I can remove the trailing spaces for the entire message.
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.
Friendly ping @Hixie
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.
The existing text also needs fixing, I hadn't noticed that.
There shouldn't be a trailing space before a newline.
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.
I removed all of the trailing spaces before new lines in this message 👍
The previous implementation was vulnerable to false positives when a ToolExit exception isn't thrown. Change to fail when no ToolExit is thrown.
Specify types to meet style rules.
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.
LGTM if lg to @Hixie
<String, String>{}, | ||
PackageConfig(<Package>[Package('test', Uri.base)]), | ||
browserName: 'chrome', | ||
), throwsToolExit(message: RegExp(' $link '))); |
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.
I would probably make this test more strict. It's not just that there's a link that matters, it's also that the text is correct around the link, right?
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.
Good point, I made the test more strict by including the preamble 👍
Remove trailing spaces before newlines to follow style guide.
Test that the link in the error message includes an appropriate preamble and follows style rules.
This branch unfortunately has merge conflicts that need to be handled before we could land it. |
I don't know why this got stuck so I'm merging it |
The current WebDriver error message is too vague, since it's a generic message with no specific guidance for each browser. Adding a link to the documentation on WebDrivers to help troubleshooting. This same pattern exists elsewhere in the code and works well in directing people to the right information for resolving the error.
An example of the new message including the link:
This PR fixes issue #78472.
Pre-launch Checklist
///
).