Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -27,6 +27,7 @@ export default function ({ getService, getPageObjects }) {
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
const visualTesting = getService('visualTesting');
const find = getService('find');
const defaultSettings = {
defaultIndex: 'logstash-*',
'discover:sampleSize': 1
Expand All @@ -48,10 +49,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 find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the change, but maybe it is good to wrap it in service since elastic-charts will be used in multiple viz across Kibana. Then we can re-use functions in multiple tests 8d82ba6

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suite may look like da4f78a

await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -61,6 +64,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Hourly');
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -70,6 +74,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Daily');
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -79,6 +84,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Weekly');
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -92,6 +98,7 @@ export default function ({ getService, getPageObjects }) {
});
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -101,6 +108,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Monthly');
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -110,6 +118,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Yearly');
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand All @@ -119,6 +128,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.setChartInterval('Auto');
await find.byCssSelector(`.echChart[data-ech-render-count="${++renderCounter}"]`);
await visualTesting.snapshot({
show: ['discoverChart'],
});
Expand Down