-
Notifications
You must be signed in to change notification settings - Fork 406
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
[#6459]improve(test): Use explicit wait for time-based condition #6460
Conversation
lgtm. Good job. |
@zzzk1 can you please fix the CI issue here? |
Yes, |
You can keep |
@@ -82,12 +82,10 @@ protected void clickAndWait(final Object locator) throws InterruptedException { | |||
wait.until(ExpectedConditions.elementToBeClickable(locatorElement(locator))); | |||
|
|||
locatorElement(locator).click(); | |||
Thread.sleep(ACTION_SLEEP_MILLIS); |
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 issue lies in here and L90. You should not delete these two lines unless you have alternatives.
f32360e
to
c3ad38d
Compare
@@ -82,12 +82,12 @@ protected void clickAndWait(final Object locator) throws InterruptedException { | |||
wait.until(ExpectedConditions.elementToBeClickable(locatorElement(locator))); | |||
|
|||
locatorElement(locator).click(); | |||
Thread.sleep(ACTION_SLEEP_MILLIS); | |||
Thread.sleep(ACTION_SLEEP * 1000); |
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.
@zzzk1 @LauraXia123
Can this be replaced with WebDriverWait
since we are going to remove Thread.sleep
in this PR.
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.
@yuqi1129 I have tried, but there is no way to do that.
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 see.
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.
@zzzk1, Please revert the changes here. I will take a final review.
I follow this: run-integration-test to execute the integration test locally, but it failed. (Ubuntu 24.04.2 LTS, JDK17 & JDK8)
|
Running |
sure. |
3ed7102
to
ff3bc2a
Compare
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
return false; | ||
} | ||
String xpath = | ||
"//div[@data-refer='table-grid']//div[contains(@class, 'MuiDataGrid-main')]/div[contains(@class, 'MuiDataGrid-virtualScroller')]/div/div[@role='rowgroup']//div[@data-field='name']"; |
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.
Some lines like here are too long, our format requires that each line should not be longer than 100 characters, can you break such super long line into several lines?
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.
Of course I will.
What changes were proposed in this pull request?
This improvement follows our E2E testing guide by utilizing the wait methods and removing
Thread.sleep(sleepTimeMillis)
.Why are the changes needed?
Fix: #6459
Does this PR introduce any user-facing change?
no
How was this patch tested?
CI