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

[7.x] [QA] Switch tests to use importExport - visualize (#98063) #101361

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_add_to_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
]);

describe('Add to Dashboard', function describeIndexTests() {
before(async () => {
await PageObjects.visualize.initTests();
});
it('adding a new metric to a new dashboard by value', async function () {
await PageObjects.visualize.navigateToNewAggBasedVisualization();
await PageObjects.visualize.clickMetric();
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_area_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);

describe('area charts', function indexPatternCreation() {
before(async () => {
await PageObjects.visualize.initTests();
});
const initAreaChart = async () => {
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_chart_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

import _ from 'lodash';
import expect from '@kbn/expect';

import { FtrProviderContext } from '../../ftr_provider_context';
Expand All @@ -17,6 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('chart types', function () {
before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewVisualization();
});
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_data_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const vizName1 = 'Visualization DataTable';

before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickDataTable');
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_data_table_nontimeindex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const vizName1 = 'Visualization DataTable without time filter';

before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickDataTable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const vizName1 = 'Visualization DataTable w/o time filter';

before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickDataTable');
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_embedding_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('embedding', () => {
describe('a data table', () => {
before(async function () {
await PageObjects.visualize.initTests();
await PageObjects.visualize.navigateToNewAggBasedVisualization();
await PageObjects.visualize.clickDataTable();
await PageObjects.visualize.clickNewSearch();
Expand Down
4 changes: 4 additions & 0 deletions test/functional/apps/visualize/_experimental_vis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize']);

describe('experimental visualizations in visualize app ', function () {
before(async () => {
await PageObjects.visualize.initTests();
});

describe('experimental visualizations', () => {
beforeEach(async () => {
log.debug('navigateToApp visualize');
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_gauge_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']);

describe('gauge chart', function indexPatternCreation() {
before(async () => {
await PageObjects.visualize.initTests();
});
async function initGaugeVis() {
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_heatmap_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const vizName1 = 'Visualization HeatmapChart';

before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickHeatmapChart');
Expand Down
8 changes: 8 additions & 0 deletions test/functional/apps/visualize/_histogram_request_start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');
const esArchiver = getService('esArchiver');

const PageObjects = getPageObjects([
'common',
Expand All @@ -24,6 +25,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('histogram agg onSearchRequestStart', function () {
before(async function () {
// loading back default data
await esArchiver.load('empty_kibana');

await esArchiver.loadIfNeeded('logstash_functional');
await esArchiver.loadIfNeeded('long_window_logstash');

await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickDataTable');
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('inspector', function describeIndexTests() {
before(async function () {
await PageObjects.visualize.initTests();
await PageObjects.visualize.navigateToNewAggBasedVisualization();
await PageObjects.visualize.clickVerticalBarChart();
await PageObjects.visualize.clickNewSearch();
Expand Down
5 changes: 4 additions & 1 deletion test/functional/apps/visualize/_lab_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ import { FtrProviderContext } from '../../ftr_provider_context';

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

describe('visualize lab mode', () => {
before(async () => {
await PageObjects.visualize.initTests();
});
it('disabling does not break loading saved searches', async () => {
await PageObjects.common.navigateToUrl('discover', '', { useActualUrl: true });
await PageObjects.discover.saveSearch('visualize_lab_mode_test');
Expand Down
5 changes: 4 additions & 1 deletion test/functional/apps/visualize/_line_chart_split_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
};

before(initLineChart);
before(async () => {
await PageObjects.visualize.initTests();
await initLineChart();
});

afterEach(async () => {
await inspector.close();
Expand Down
5 changes: 4 additions & 1 deletion test/functional/apps/visualize/_line_chart_split_series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
};

before(initLineChart);
before(async () => {
await PageObjects.visualize.initTests();
await initLineChart();
});

afterEach(async () => {
await inspector.close();
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_linked_saved_searches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
let discoverSavedSearchUrlPath: string;

before(async () => {
await PageObjects.visualize.initTests();
await PageObjects.common.navigateToApp('discover');
await filterBar.addFilter('extension.raw', 'is', 'jpg');
await PageObjects.header.waitUntilLoadingHasFinished();
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_markdown_vis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('markdown app in visualize app', () => {
before(async function () {
await PageObjects.visualize.initTests();
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickMarkdownWidget();
await PageObjects.visEditor.setMarkdownTxt(markdown);
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_metric_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('metric chart', function () {
before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickMetric');
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_pie_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('pie chart', function () {
const vizName1 = 'Visualization PieChart';
before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickPieChart');
Expand Down
5 changes: 4 additions & 1 deletion test/functional/apps/visualize/_point_series_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}

describe('vlad point series', function describeIndexTests() {
before(initChart);
before(async () => {
await PageObjects.visualize.initTests();
await initChart();
});

describe('secondary value axis', function () {
it('should show correct chart', async function () {
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_region_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'visEditor', 'timePicker']);

before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickRegionMap');
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_shared_item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('data-shared-item', function indexPatternCreation() {
before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToApp('visualize');
});
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_tag_cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const termsField = 'machine.ram';

before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewAggBasedVisualization();
log.debug('clickTagCloud');
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_tile_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('tile map visualize app', function () {
describe('incomplete config', function describeIndexTests() {
before(async function () {
await PageObjects.visualize.initTests();
await browser.setWindowSize(1280, 1000);

log.debug('navigateToApp visualize');
Expand Down
18 changes: 12 additions & 6 deletions test/functional/apps/visualize/_tsvb_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const inspector = getService('inspector');
const retry = getService('retry');
const security = getService('security');

const PageObjects = getPageObjects([
'visualize',
'visualBuilder',
Expand All @@ -27,12 +28,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('visual builder', function describeIndexTests() {
this.tags('includeFirefox');

before(async () => {
await PageObjects.visualize.initTests();
});

beforeEach(async () => {
await security.testUser.setRoles([
'kibana_admin',
'test_logstash_reader',
'kibana_sample_admin',
]);
await security.testUser.setRoles(
['kibana_admin', 'test_logstash_reader', 'kibana_sample_admin'],
false
);
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVisualBuilder();
await PageObjects.visualBuilder.checkVisualBuilderIsPresent();
Expand Down Expand Up @@ -141,7 +146,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

after(async () => {
await security.testUser.restoreDefaults();
await esArchiver.unload('index_pattern_without_timefield');
await esArchiver.load('empty_kibana');
await PageObjects.visualize.initTests();
});

const switchIndexTest = async (useKibanaIndexes: boolean) => {
Expand Down
7 changes: 6 additions & 1 deletion test/functional/apps/visualize/_tsvb_markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { visualBuilder, timePicker } = getPageObjects(['visualBuilder', 'timePicker']);
const { visualBuilder, timePicker, visualize } = getPageObjects([
'visualBuilder',
'timePicker',
'visualize',
]);
const retry = getService('retry');

async function cleanupMarkdownData(variableName: 'variable' | 'label', checkedValue: string) {
Expand All @@ -31,6 +35,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('visual builder', function describeIndexTests() {
describe('markdown', () => {
before(async () => {
await visualize.initTests();
await visualBuilder.resetPage();
await visualBuilder.clickMarkdown();
await timePicker.setAbsoluteRange(
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_tsvb_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default function ({ getPageObjects }: FtrProviderContext) {
]);

describe('visual builder', function describeIndexTests() {
before(async () => {
await visualize.initTests();
});
describe('table', () => {
beforeEach(async () => {
await visualBuilder.resetPage('Sep 22, 2015 @ 06:00:00.000', 'Sep 22, 2015 @ 11:00:00.000');
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/visualize/_tsvb_time_series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');

describe('visual builder', function describeIndexTests() {
before(async () => {
await visualize.initTests();
});
beforeEach(async () => {
await visualize.navigateToNewVisualization();
await visualize.clickVisualBuilder();
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_vega_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

describe('vega chart in visualize app', () => {
before(async () => {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickVega');
Expand Down
4 changes: 4 additions & 0 deletions test/functional/apps/visualize/_vertical_bar_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']);

describe('vertical bar chart', function () {
before(async () => {
await PageObjects.visualize.initTests();
});

const vizName1 = 'Visualization VerticalBarChart';

const initBarChart = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
};

before(initBarChart);
before(async () => {
await PageObjects.visualize.initTests();
await initBarChart();
});

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_visualize_listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('create and delete', function () {
before(async function () {
await PageObjects.visualize.initTests();
await PageObjects.visualize.gotoVisualizationLandingPage();
await PageObjects.visualize.deleteAllVisualizations();
});
Expand Down
Loading