E2E test: Improve fill method in driver#22652
Merged
HowardBraham merged 13 commits intodevelopfrom Jan 25, 2024
Merged
Conversation
Contributor
|
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. |
DDDDDanica
previously approved these changes
Jan 24, 2024
Contributor
|
LTGM! It's a great improvement and fix ~ |
chloeYue
commented
Jan 24, 2024
|
|
||
| // editing gas fee | ||
| const editBtn = await driver.findElements({ | ||
| const editBtn = await driver.findElement({ |
Contributor
Author
There was a problem hiding this comment.
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. |
Collaborator
Builds ready [905efb5]
Page Load Metrics (831 ± 42 ms)
Bundle size diffs
|
DDDDDanica
approved these changes
Jan 25, 2024
HowardBraham
approved these changes
Jan 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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