Skip to content

Commit

Permalink
[Infrastructure UI] Metrics Explorer Saved View flaky test fix (#160504)
Browse files Browse the repository at this point in the history
closes [#156513](#156513)

## Summary

Fix flaky Metrics Explorer Saved Views functional test. Based on the
[screenshot](https://buildkiteartifacts.com/e0f3970e-3a75-4621-919f-e6c773e2bb12/b1106efc-ba5e-4e90-a857-11c4a899c05d/0188e3a3-7b0a-4a2b-b305-41f088a36c7b/0188e3a5-5e7d-4cac-9ca2-ad049aa86341/x-pack/test/functional/screenshots/failure/InfraOps%20App%20Metrics%20UI%20Metrics%20Explorer%20Saved%20Views%20should%20update%20the%20current%20s-548c19241effa693af1bdaa2945c1bb8f7a0de0759993758d705b60a14e17c8d.png?response-content-type=image%2Fpng&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQPCP3C7LZDIHP4OQ%2F20230626%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230626T100738Z&X-Amz-Expires=600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjENf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQCWRh%2Bz%2BuUkCNazAWmBVuDmsKyUAOlJ%2F71ynwSjXcFzGwIgBwzs5UgxrUrkki2Bl7ucYrIa0ldQYroVGWCAyxTTGLMq8QMIQBAAGgwwMzIzNzk3MDUzMDMiDMeqhNGm7I4CeupKPyrOA4mOkzowrCIJ9q06o%2B0LNAadRLnRcoUyBFNpVdOOZ0Mz8PCIQv8PxnVFC9c9b0o7zzxXhhIssuWjMG4bjR9PVgAL1xIMwVp9qmsfGELZ4Ctc5Py18PZ6Nsp0IYU9dj58bxyronawXCypdqG%2BaAfcETMYhr7IwusqJQKtJr0XvuWHAABjQp8KLfzU04sKG5XjZtaj%2F9i8ma2ubesispDhEjdsZYr9cy5dLqkHHEBfIi0WHc6wsdlrFge5LVQSe0Cppf7FhKubL39v2FcbPA58ftR075YDIFfgTh4jMaC502WmUBDEI1HhBNPBtGKJQz7gN6iYIlIfW8q1rXPW5KiLU3D%2ByjU0gWAO6xyBb8ShIwxJ8fCRFrpT4487g5VFrJCDwAmhuCpKWu4GtgsWvMr0VNB4M%2BKJKR7%2FicDIEjo6HIDJen1%2FvEwAWRQQOumf5Fpqt3tYYaEtf5BcnFM2EU1q5KQvcaBLvNeXiOBD8qYqfkiDlOc8Zl8C%2F%2FVd%2Fs6LusnDjzrCR%2BiM504i0p6dcjdpIsWQ9HSZKtqAGzJ9%2B34vND8hha%2BXOcuGHTY6TSflpToAv60114tLLfCekIgGhf4397Cgun2HpEB3oHO2hQRuHjDX7%2BSkBjqlAbuJIlwQmjnxEgUXwKpASBJ7B8zgesS8cANKA4i%2FO7g0to4%2FUAhICFkVy1G%2BNLUUrVX2PAMYTAH7iMU8lWxfUcIBMmg%2BCWbL4O4CKUydbwfgojalAN8KksHf%2F3IAHJkH9OrQqG3jQxGlVDUv%2B%2B1WLYwECWczrombRpDVxBl4oX3%2Baq6pvEJdERYNgMU8zfEoOXkV8kfFx7R3utq5vt9lcnB2VDR32w%3D%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=f8c04b64d57c9b317c4ccb68a7961d6aa166a61b38c52b457caf5a2f87b72dfb),
I suspect that the test tries to click the saved object button when it's
still disabled.

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
crespocarlos and kibanamachine authored Jun 27, 2023
1 parent 5ac84d1 commit 3d05f74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/infra/metrics_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.infraSavedViews.ensureViewIsLoaded('view1');
});

it('should laod a clicked view from the manage views section', async () => {
it('should load a clicked view from the manage views section', async () => {
const views = await pageObjects.infraSavedViews.getManageViewsEntries();
await views[0].click();
await pageObjects.infraSavedViews.ensureViewIsLoaded('Default view');
Expand Down
11 changes: 9 additions & 2 deletions x-pack/test/functional/page_objects/infra_saved_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
const browser = getService('browser');

return {
clickSavedViewsButton() {
return testSubjects.click('savedViews-openPopover');
async clickSavedViewsButton() {
const button = await testSubjects.find('savedViews-openPopover');

await retry.waitFor('Wait for button to be enabled', async () => {
const isDisabled = Boolean(await button.getAttribute('disabled'));
return !isDisabled;
});

return button.click();
},
pressEsc() {
return browser.pressKeys([Key.ESCAPE]);
Expand Down

0 comments on commit 3d05f74

Please sign in to comment.