Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.3] Improve visualization tests #20783

Merged
merged 12 commits into from
Jul 18, 2018
3 changes: 2 additions & 1 deletion test/functional/apps/getting_started/_shakespeare.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }) {
*/
it('should create initial vertical bar chart', async function () {
log.debug('create shakespeare vertical bar chart');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVerticalBarChart();
await PageObjects.visualize.clickNewSearch('shakes*');
await PageObjects.visualize.waitForVisualization();
Expand Down Expand Up @@ -88,6 +88,7 @@ export default function ({ getService, getPageObjects }) {
*/
it('should configure Terms aggregation on play_name', async function () {
await PageObjects.visualize.clickBucket('X-Axis');
await PageObjects.common.sleep(1000);
Copy link

Choose a reason for hiding this comment

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

There's already a 500ms sleep in the clickBucket method.
https://github.com/liza-mae/kibana/blob/3e3f76d09b6eb916249c1c833b2c7d3613dfa0db/test/functional/page_objects/visualize_page.js#L397

Should we just increase that sleep instead of adding this one to the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately what I found is sometimes specific tests take longer and that was the case here, these were run in a loop and adding the sleep there helped, but I see some changes are pending for clickBucket, so let me take those in.

log.debug('Aggregation = Terms');
await PageObjects.visualize.selectAggregation('Terms');
aggIndex = aggIndex + 1;
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickAreaChart');
await PageObjects.visualize.clickAreaChart();
log.debug('clickNewSearch');
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/visualize/_data_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickDataTable');
await PageObjects.visualize.clickDataTable();
log.debug('clickNewSearch');
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function ({ getService, getPageObjects }) {
});

it('should show correct data for a data table with date histogram', async () => {
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickDataTable();
await PageObjects.visualize.clickNewSearch();
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_experimental_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default ({ getService, getPageObjects }) => {

beforeEach(async () => {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.waitForVisualizationSelectPage();
});

Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_gauge_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickGauge');
await PageObjects.visualize.clickGauge();
await PageObjects.visualize.clickNewSearch();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_heatmap_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickHeatmapChart');
await PageObjects.visualize.clickHeatmapChart();
await PageObjects.visualize.clickNewSearch();
Expand Down
7 changes: 4 additions & 3 deletions test/functional/apps/visualize/_histogram_request_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickDataTable');
await PageObjects.visualize.clickDataTable();
await PageObjects.visualize.clickNewSearch();
Expand All @@ -30,7 +30,8 @@ export default function ({ getService, getPageObjects }) {
log.debug(`Interval = ${providedInterval}`);
await PageObjects.visualize.setNumericInterval(providedInterval);
await PageObjects.visualize.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.common.sleep(1000);
Copy link

Choose a reason for hiding this comment

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

Should we add the sleep to the clickGo() method?
Or add a call to waitForVisualization() in the clickGo method?
https://github.com/liza-mae/kibana/blob/3e3f76d09b6eb916249c1c833b2c7d3613dfa0db/test/functional/page_objects/visualize_page.js#L824

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe I tried both those for this function and the only that helped was a sleep.


const data = await PageObjects.visualize.getDataTableData();
const dataArray = data.replace(/,/g, '').split('\n');
expect(dataArray.length).to.eql(20);
Expand All @@ -45,7 +46,7 @@ export default function ({ getService, getPageObjects }) {
log.debug(`Interval = ${providedInterval}`);
await PageObjects.visualize.setNumericInterval(providedInterval);
await PageObjects.visualize.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.common.sleep(1000);

const data = await PageObjects.visualize.getDataTableData();
const dataArray = data.replace(/,/g, '').split('\n');
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/visualize/_input_control_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ({ getService, getPageObjects }) {

describe('input control visualization', () => {
before(async () => {
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickInputControlVis();
// set time range to time with no documents - input controls do not use time filter be default
await PageObjects.header.setAbsoluteRange('2017-01-01', '2017-01-02');
Expand Down Expand Up @@ -166,7 +166,7 @@ export default function ({ getService, getPageObjects }) {
describe('nested controls', () => {

before(async () => {
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickInputControlVis();
await PageObjects.visualize.clickVisEditorTab('controls');

Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_line_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickLineChart');
await PageObjects.visualize.clickLineChart();
await PageObjects.visualize.clickNewSearch();
Expand Down
11 changes: 3 additions & 8 deletions test/functional/apps/visualize/_linked_saved_searches.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import expect from 'expect.js';

export default function ({ getPageObjects, getService }) {
const retry = getService('retry');
export default function ({ getPageObjects }) {
const PageObjects = getPageObjects(['common', 'discover', 'visualize', 'header']);

describe.skip('visualize app', function () {
describe('visualize app', function () {
const fromTime = '2015-09-19 06:31:44.000';
const toTime = '2015-09-23 18:31:44.000';

Expand All @@ -37,11 +36,7 @@ export default function ({ getPageObjects, getService }) {
});

it('should create a visualization from a saved search', async () => {
retry.try(async () => {
// Sometimes navigation to the page fails, so we have this in a retry
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.waitForVisualizationSelectPage();
});
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickDataTable();
await PageObjects.visualize.clickSavedSearch(savedSearchName);
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_markdown_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ({ getPageObjects, getService }) {

describe('visualize app', async () => {
before(async function () {
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickMarkdownWidget();
await PageObjects.visualize.setMarkdownTxt(markdown);
await PageObjects.visualize.clickGo();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_metric_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickMetric');
await PageObjects.visualize.clickMetric();
await PageObjects.visualize.clickNewSearch();
Expand Down
5 changes: 3 additions & 2 deletions test/functional/apps/visualize/_pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ({ getService, getPageObjects }) {
before(async function () {

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickPieChart');
await PageObjects.visualize.clickPieChart();
await PageObjects.visualize.clickNewSearch();
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }) {
it('should show other and missing bucket', async function () {
const expectedTableData = [ 'win 8', 'win xp', 'win 7', 'ios', 'Missing', 'Other' ];

await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickPieChart');
await PageObjects.visualize.clickPieChart();
await PageObjects.visualize.clickNewSearch();
Expand Down Expand Up @@ -142,6 +142,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.visualize.toggleDisabledAgg(2);
await PageObjects.visualize.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.common.sleep(2000);

const expectedTableData = [
'0', 'win 7', 'win xp', 'win 8', 'ios', 'osx', '40,000', 'win 8', 'ios', 'win 7', 'win xp', 'osx', '80,000',
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_point_series_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickLineChart');
await PageObjects.visualize.clickLineChart();
await PageObjects.visualize.clickNewSearch();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_region_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
before(async function () {

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickRegionMap');
await PageObjects.visualize.clickRegionMap();
await PageObjects.visualize.clickNewSearch();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_spy_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function ({ getService, getPageObjects }) {
const fromTime = '2015-09-19 06:31:44.000';
const toTime = '2015-09-23 18:31:44.000';

await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVerticalBarChart();
await PageObjects.visualize.clickNewSearch();

Expand Down
6 changes: 4 additions & 2 deletions test/functional/apps/visualize/_tag_cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ export default function ({ getService, getPageObjects }) {
before(async function () {

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickTagCloud');
await PageObjects.visualize.clickTagCloud();
await PageObjects.visualize.clickNewSearch();
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
await PageObjects.common.sleep(1000);
log.debug('select Tags');
await PageObjects.visualize.clickBucket('Tags');
await PageObjects.common.sleep(1000);
log.debug('Click aggregation Terms');
await await PageObjects.visualize.selectAggregation('Terms');
log.debug('Click field machine.ram');
Expand Down Expand Up @@ -122,7 +124,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.openControlsByName(termsField);
await PageObjects.settings.setFieldFormat('Bytes');
await PageObjects.settings.controlChangeSave();
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/visualize/_tile_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickTileMap');
await PageObjects.visualize.clickTileMap();
await PageObjects.visualize.clickNewSearch();
Expand Down Expand Up @@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickTileMap');
await PageObjects.visualize.clickTileMap();
await PageObjects.visualize.clickNewSearch();
Expand Down Expand Up @@ -191,7 +191,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.visualize.closeSpyPanel();
});

it('Newly saved visualization retains map bounds', async () => {
it.skip('Newly saved visualization retains map bounds', async () => {
const vizName1 = 'Visualization TileMap';

await PageObjects.visualize.clickMapZoomIn();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_tsvb_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function ({ getService, getPageObjects }) {
expect(text).to.be('1442901600000');
});

it.skip('should allow printing raw value of data', async () => {
it('should allow printing raw value of data', async () => {
await PageObjects.visualBuilder.enterMarkdown('{{ count.data.raw.[0].[1] }}');
const text = await PageObjects.visualBuilder.getMarkdownText();
expect(text).to.be('6');
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_vega_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function ({ getService, getPageObjects }) {
describe('visualize app', () => {
before(async () => {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickVega');
await PageObjects.visualize.clickVega();
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_vertical_bar_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickVerticalBarChart');
await PageObjects.visualize.clickVerticalBarChart();
await PageObjects.visualize.clickNewSearch();
Expand Down
4 changes: 2 additions & 2 deletions test/functional/page_objects/visual_builder_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }) {
const retry = getService('retry');
const log = getService('log');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'header']);
const PageObjects = getPageObjects(['common', 'header', 'visualize']);

class VisualBuilderPage {

async resetPage() {
const fromTime = '2015-09-19 06:31:44.000';
const toTime = '2015-09-22 18:31:44.000';
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToUrl('visualize', 'new');
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.header.waitUntilLoadingHasFinished();
log.debug('clickVisualBuilderChart');
await find.clickByPartialLinkText('Visual Builder');
Expand Down
Loading