Skip to content

Commit

Permalink
update visual test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlemeshko committed Nov 26, 2019
1 parent 8d82ba6 commit da4f78a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/functional/page_objects/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
const config = getService('config');
const defaultFindTimeout = config.get('timeouts.find');
const comboBox = getService('comboBox');
const elasticChart = getService('elasticChart');

class DiscoverPage {
async getQueryField() {
Expand Down Expand Up @@ -292,6 +293,9 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
await testSubjects.missingOrFail('filterSelectionPanel', { allowHidden: true });
}

async waitForChartLoadingComplete(renderCount) {
await elasticChart.waitForRenderingCount('discoverChart', renderCount);
}
}

return new DiscoverPage();
Expand Down
10 changes: 10 additions & 0 deletions test/visual_regression/tests/discover/chart_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ export default function ({ getService, getPageObjects }) {

describe('query', function () {
this.tags(['skipFirefox']);
let renderCounter = 0;

it('should show bars in the correct time zone', async function () {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -61,6 +63,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Hourly');
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -70,6 +73,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Daily');
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -79,6 +83,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Weekly');
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -92,6 +97,7 @@ export default function ({ getService, getPageObjects }) {
});
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -101,6 +107,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Monthly');
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -110,6 +117,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Yearly');
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -119,6 +127,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Auto');
await PageObjects.discover.waitForChartLoadingComplete(++renderCounter);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -133,6 +142,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.timePicker.setDefaultAbsoluteRange();
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.waitForChartLoadingComplete(1);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand Down

0 comments on commit da4f78a

Please sign in to comment.