-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add method to wait for loading to complete in Add Panel table #21109
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,11 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { | |
} | ||
} | ||
|
||
async waitForEuiTableLoading() { | ||
const addPanel = await testSubjects.find('dashboardAddPanel'); | ||
await addPanel.waitForDeletedByClassName('euiBasicTable-loading'); | ||
} | ||
|
||
async closeAddPanel() { | ||
log.debug('DashboardAddPanel.closeAddPanel'); | ||
const isOpen = await this.isAddPanelOpen(); | ||
|
@@ -172,7 +177,12 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { | |
} | ||
|
||
async filterEmbeddableNames(name) { | ||
await testSubjects.setValue('savedObjectFinderSearchInput', name); | ||
// The search input field may be disabled while the table is loading so wait for it | ||
await this.waitForEuiTableLoading(); | ||
// This try loop lets us recover it the field wasn't enabled yet | ||
await retry.try(async () => { | ||
await testSubjects.setValue('savedObjectFinderSearchInput', name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this extra retry loop adds anything because there is already a retry loop on the inside of setValue:
We could think about confirming that the value was actually set by adding something in that function call that does like:
But I'm not sure if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't realize that setValue method had a retry loop. But that makes me wonder why it wasn't solving this problem from the beginning. The first error in this case was coming from the clearValue() step in that setValue method; But then the next message says that it failed to find the element. And when the test finally fails and takes a screenshot, we see that it has navigated away from the Add Panel flyout and has opened the New visualization page (which might explain why it can no longer find the element). It seems as if this inner-most retry isn't staying in this loop for some reason, and an outer retry is trying to clicking on "Add" again, or somewhere else that causes the incorrect navigation. What you don't see here is the debug logging I had in place which did show that the euiBasicTable did initially show the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, so my suspicion is that the mechanism for typing selenium uses is accidentally hitting the |
||
}); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
} | ||
|
||
|
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.
Seems like this function could go somewhere more general as it might be useful for other places that use the eui table and want to wait for it to load. I don't see a good spot for it right now. Maybe a new service named
euiComponents
? Could take in an optional selector name to use to narrow down but I wonder if you can use it without an element, directly on remote (just like we do for the global loading indicator - making sure it doesn't exist at all, anywhere on the page).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 thought about that. But the euiBasicTable can get populated from any data source and doesn't necessarily require a request/response to Elasticsearch so I'm not sure what to do.
Again, the retry loop in setValue seems like it should always handle the case where the field isn't initially user-editable.
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.
There is a flyout service and I have a PR out for a combo box service. #21219.