-
Notifications
You must be signed in to change notification settings - Fork 5.4k
E2E test: Improve fill method in driver #22652
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
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
LTGM! It's a great improvement and fix ~ |
|
|
||
| // editing gas fee | ||
| const editBtn = await driver.findElements({ | ||
| const editBtn = await driver.findElement({ |
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.
we only have one element with text 'Edit' and tag h6, no need to use findElements. So i switched to use findElement instead.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #22652 +/- ##
===========================================
+ Coverage 68.13% 68.13% +0.01%
===========================================
Files 1087 1087
Lines 42665 42665
Branches 11349 11349
===========================================
+ Hits 29066 29069 +3
+ Misses 13599 13596 -3 ☔ View full report in Codecov by Sentry. |
Builds ready [905efb5]
Page Load Metrics (831 ± 42 ms)
Bundle size diffs
|
Description
When investigating flaky tests, I found that some tests are flaky because the input field was not cleared before entering a new value. The issue is that Selenium sometimes doesn't clear input fields effectively. Now, we use sendkeys() to clear input fields, i've added another way to use selenium actions to simulate we select all text with keyboard and replace it with the new value. With both ways, we can clear input fields more effectively, which I believe will stabilize multiple flaky tests.
Examples:
Failing test because input field was not cleared as expected:

Tests failing because although the input field was cleared, the application automatically added a '0'. So when we entered the input value '4000', it was actually entered as '04000'. With my approach, when we find that the input field is not empty, it will select the '0' and replace it with '4000'. This way, we finally get the correct value of '4000'.

I also fixed another flaky test in this PR.
Related issues
Fixes: #22573
Manual testing steps
Run the e2e test.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist