-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix SearchResultTemplateTest #5177
Conversation
I tested a similar case but with no luck. |
Have you tried to use JS to do the click ? |
No. Since you are trying this, I might try a different fix. |
The first run passed. Try again. |
Mine also passed (use JS to click button). |
Third time. |
@edalex-ian This one is ready for review. |
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.
Looks good @PenghaiZhang , however we need to document the oddity.
getAddResourceButton().click(); | ||
WebElement addResourceButton = | ||
waiter.until(ExpectedConditions.elementToBeClickable(getAddResourceButton())); | ||
((JavascriptExecutor) driver).executeScript("arguments[0].click();", addResourceButton); |
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.
It is odd to have to use JS to click the button. It's worth documenting why with a comment.
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.
Actually, please see this comment I made in @edalex-yinzi 's similar PR: #5176 (review)
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 have made a change to use 'forceButtonClickWithJS'.
My pr is merged. |
Hi @edalex-ian this PR is ready for review. |
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!
Checklist
Description of change
According to the log, click of the Add Resource button is intercepted by the ul above the button. Both are parts of the Attachment control which is a React component but used in the Legacty UI.
I guess when the button is visible and the test is about to click it, the list is not yet. However, when the click happens, the list becomes visible and is displayed in where the button was (and the button is moved down to below the list).
So the first potential fix is to add a wait of element being clickable to the button.