Skip to content

Commit

Permalink
Update infra visual test (#108621) (#108635)
Browse files Browse the repository at this point in the history
Co-authored-by: liza-mae <liza-mae@users.noreply.github.com>
  • Loading branch information
kibanamachine and liza-mae committed Aug 14, 2021
1 parent a27b3cf commit 0f406c0
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions x-pack/test/visual_regression/tests/infra/saved_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DATES } from '../../../functional/apps/infra/constants';
const DATE_WITH_DATA = DATES.metricsAndLogs.hosts.withData;

export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['common', 'infraHome', 'infraMetricExplorer']);
const PageObjects = getPageObjects(['common', 'infraHome', 'infraMetricsExplorer']);
const visualTesting = getService('visualTesting');
const esArchiver = getService('esArchiver');

Expand Down Expand Up @@ -47,34 +47,40 @@ export default function ({ getPageObjects, getService }) {
});
});

describe('Metric Explorer Test save functionality', () => {
it('should have save and load controls', async () => {
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToMetricExplorer();
await PageObjects.infraMetricExplorer.getSaveViewButton();
await PageObjects.infraMetricExplorer.getLoadViewsButton();
await visualTesting.snapshot();
});

it('should open flyout list', async () => {
await PageObjects.infraMetricExplorer.openSaveViewsFlyout();
await visualTesting.snapshot();
await PageObjects.infraMetricExplorer.closeSavedViewFlyout();
});
describe('Metric Explorer Test Saved Views', () => {
before(() => esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'));
after(() => esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'));
describe('save functionality', () => {
it('should have saved views component', async () => {
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToMetricExplorer();
await PageObjects.infraSavedViews.getSavedViewsButton();
await PageObjects.infraSavedViews.ensureViewIsLoaded('Default view');
await visualTesting.snapshot();
});

it('should open saved view modal', async () => {
await PageObjects.infraMetricExplorer.openCreateSaveViewModal();
await visualTesting.snapshot();
});
it('should open popover', async () => {
await PageObjects.infraSavedViews.clickSavedViewsButton();
await visualTesting.snapshot();
await PageObjects.infraSavedViews.closeSavedViewsPopover();
});

it('should be able to enter a view name', async () => {
await PageObjects.infraMetricExplorer.openEnterViewNameAndSave();
await visualTesting.snapshot();
});
it('should create new saved view and load it', async () => {
await PageObjects.infraSavedViews.clickSavedViewsButton();
await PageObjects.infraSavedViews.clickSaveNewViewButton();
await PageObjects.infraSavedViews.getCreateSavedViewModal();
await PageObjects.infraSavedViews.createNewSavedView('view1');
await PageObjects.infraSavedViews.ensureViewIsLoaded('view1');
await visualTesting.snapshot();
});

it('should see a saved view in list', async () => {
await PageObjects.infraMetricExplorer.openSaveViewsFlyout();
await visualTesting.snapshot();
it('should new views should be listed in the load views list', async () => {
await PageObjects.infraSavedViews.clickSavedViewsButton();
await PageObjects.infraSavedViews.clickLoadViewButton();
await PageObjects.infraSavedViews.ensureViewIsLoadable('view1');
await visualTesting.snapshot();
await PageObjects.infraSavedViews.closeSavedViewsLoadModal();
});
});
});
});
Expand Down

0 comments on commit 0f406c0

Please sign in to comment.