Skip to content

Commit

Permalink
Add wait for chart to render and fix time picker
Browse files Browse the repository at this point in the history
  • Loading branch information
liza-mae committed Nov 21, 2019
1 parent 399efc2 commit ea79625
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
9 changes: 9 additions & 0 deletions x-pack/test/functional/page_objects/infra_home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,14 @@ export function InfraHomePageProvider({ getService }: FtrProviderContext) {
await testSubjects.click('configureSourceButton');
await testSubjects.exists('sourceConfigurationFlyout');
},

async waitForChartToLoad() {
await retry.try(async () => {
const renderComplete = await find.byCssSelector('[data-ech-render-complete="true"]');
if (! renderComplete ) {
throw new Error('Chart did not render');
}
});
},
};
}
21 changes: 10 additions & 11 deletions x-pack/test/visual_regression/tests/infra/saved_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ export default function ({ getPageObjects, getService }) {
const find = getService('find');

describe('saved views', () => {

before(async function () {
esArchiver.load('infra/metrics_and_logs');
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
});

before(() => esArchiver.load('infra/metrics_and_logs'));
after(() => esArchiver.unload('infra/metrics_and_logs'));

describe('Inventory Test save functionality', () => {
before(async function () {
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
});

it('should have save and load controls', async () => {
await PageObjects.infraHome.getSaveViewButton();
await PageObjects.infraHome.getLoadViewsButton();
Expand Down Expand Up @@ -56,15 +55,15 @@ export default function ({ getPageObjects, getService }) {
});

describe('Metric Explorer Test save functionality', () => {

const fromTime = '2018-10-16 09:00:00.000';
const toTime = '2018-10-18 19:00:00.000';
const fromTime = 'Oct 16, 2018 @ 00:00:00.000';
const toTime = 'Oct 18, 2018 @ 00:00:00.000';

before(async function () {
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToMetricExplorer();
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.infraHome.waitForChartToLoad();
});

it('should have save and load controls', async () => {
Expand Down

0 comments on commit ea79625

Please sign in to comment.