Skip to content

Commit

Permalink
[Infra UI] Saved views test fix (#160718)
Browse files Browse the repository at this point in the history
Closes #157740 
## Summary

This PR fixes the flaky infra saved views test - applies the fix added
metrics explorer.
  • Loading branch information
jennypavlova authored Jun 30, 2023
1 parent 9eb6d1e commit 2615be5
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions x-pack/test/functional/apps/infra/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,48 +225,52 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});

// FLAKY: https://github.com/elastic/kibana/issues/157740
describe.skip('Saved Views', () => {
describe('Saved Views', () => {
this.tags('skipFirefox');
before(async () => {
esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs');
await pageObjects.common.navigateToApp('infraOps');
await pageObjects.infraHome.waitForLoading();
await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs');
await pageObjects.infraHome.goToMetricExplorer();
});

after(() => esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'));

beforeEach(async () => {
await pageObjects.infraSavedViews.clickSavedViewsButton();
});
afterEach(async () => {
await pageObjects.infraSavedViews.closeSavedViewsPopover();
});

it('should render a button with the view name', async () => {
await pageObjects.infraSavedViews.ensureViewIsLoaded('Default view');
});

it('should open/close the views popover menu on button click', async () => {
await pageObjects.infraSavedViews.clickSavedViewsButton();
testSubjects.existOrFail('savedViews-popover');
await testSubjects.existOrFail('savedViews-popover');
await pageObjects.infraSavedViews.closeSavedViewsPopover();
});

it('should create a new saved view and load it', async () => {
await pageObjects.infraSavedViews.clickSavedViewsButton();
await pageObjects.infraSavedViews.createView('view1');
await pageObjects.infraSavedViews.ensureViewIsLoaded('view1');
});

it('should laod a clicked view from the manage views section', async () => {
await pageObjects.infraSavedViews.clickSavedViewsButton();
await pageObjects.infraSavedViews.ensureViewIsLoaded('view1');
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');
});

it('should update the current saved view and load it', async () => {
await pageObjects.infraSavedViews.clickSavedViewsButton();
let views = await pageObjects.infraSavedViews.getManageViewsEntries();
expect(views.length).to.equal(2);
await pageObjects.infraSavedViews.pressEsc();

await pageObjects.infraSavedViews.clickSavedViewsButton();
await pageObjects.infraSavedViews.createView('view2');
await pageObjects.infraSavedViews.ensureViewIsLoaded('view2');

await pageObjects.infraSavedViews.clickSavedViewsButton();
views = await pageObjects.infraSavedViews.getManageViewsEntries();
expect(views.length).to.equal(3);
Expand All @@ -275,6 +279,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.infraSavedViews.clickSavedViewsButton();
await pageObjects.infraSavedViews.updateView('view3');
await pageObjects.infraSavedViews.ensureViewIsLoaded('view3');

await pageObjects.infraSavedViews.clickSavedViewsButton();
views = await pageObjects.infraSavedViews.getManageViewsEntries();
expect(views.length).to.equal(3);
Expand Down

0 comments on commit 2615be5

Please sign in to comment.