mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Visualize] Fixes functional tests to run for vislib and es-charts (#101461)
This commit is contained in:
parent
f670fd23d6
commit
1cd88f4a44
9 changed files with 24 additions and 18 deletions
|
@ -34,8 +34,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
);
|
||||
|
||||
describe('area charts', function indexPatternCreation() {
|
||||
let isNewChartsLibraryEnabled = false;
|
||||
before(async () => {
|
||||
await PageObjects.visualize.initTests();
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
});
|
||||
const initAreaChart = async () => {
|
||||
log.debug('navigateToApp visualize');
|
||||
|
|
|
@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
]);
|
||||
|
||||
describe('line charts - split chart', function () {
|
||||
let isNewChartsLibraryEnabled = false;
|
||||
const initLineChart = async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
await PageObjects.visualize.navigateToNewAggBasedVisualization();
|
||||
|
@ -44,7 +45,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
await PageObjects.visualize.initTests();
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
await initLineChart();
|
||||
});
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
]);
|
||||
|
||||
describe('line charts - split series', function () {
|
||||
let isNewChartsLibraryEnabled = false;
|
||||
const initLineChart = async function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
await PageObjects.visualize.navigateToNewAggBasedVisualization();
|
||||
|
@ -42,7 +43,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
await PageObjects.visualize.initTests();
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
await initLineChart();
|
||||
});
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const filterBar = getService('filterBar');
|
||||
const pieChart = getService('pieChart');
|
||||
const inspector = getService('inspector');
|
||||
const browser = getService('browser');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
const PageObjects = getPageObjects([
|
||||
'common',
|
||||
|
@ -33,13 +31,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const vizName1 = 'Visualization PieChart';
|
||||
before(async function () {
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests();
|
||||
if (isNewChartsLibraryEnabled) {
|
||||
await kibanaServer.uiSettings.update({
|
||||
'visualization:visualize:legacyChartsLibrary': false,
|
||||
});
|
||||
await browser.refresh();
|
||||
}
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
|
||||
log.debug('navigateToApp visualize');
|
||||
await PageObjects.visualize.navigateToNewAggBasedVisualization();
|
||||
log.debug('clickPieChart');
|
||||
|
|
|
@ -60,9 +60,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.visEditor.clickGo();
|
||||
}
|
||||
|
||||
describe('vlad point series', function describeIndexTests() {
|
||||
describe('point series', function describeIndexTests() {
|
||||
let isNewChartsLibraryEnabled = false;
|
||||
before(async () => {
|
||||
await PageObjects.visualize.initTests();
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
await initChart();
|
||||
});
|
||||
|
||||
|
|
|
@ -19,8 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']);
|
||||
|
||||
describe('vertical bar chart', function () {
|
||||
let isNewChartsLibraryEnabled = false;
|
||||
before(async () => {
|
||||
await PageObjects.visualize.initTests();
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
});
|
||||
|
||||
const vizName1 = 'Visualization VerticalBarChart';
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('vertical bar chart with index without time filter', function () {
|
||||
const vizName1 = 'Visualization VerticalBarChart without time filter';
|
||||
let isNewChartsLibraryEnabled = false;
|
||||
|
||||
const initBarChart = async () => {
|
||||
log.debug('navigateToApp visualize');
|
||||
|
@ -40,7 +41,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
await PageObjects.visualize.initTests();
|
||||
isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled();
|
||||
await PageObjects.visualize.initTests(isNewChartsLibraryEnabled);
|
||||
await initBarChart();
|
||||
});
|
||||
|
||||
|
|
|
@ -47,13 +47,14 @@ export class VisualizePageObject extends FtrService {
|
|||
LOGSTASH_NON_TIME_BASED: 'logstash*',
|
||||
};
|
||||
|
||||
public async initTests() {
|
||||
public async initTests(isNewLibrary = false) {
|
||||
await this.kibanaServer.savedObjects.clean({ types: ['visualization'] });
|
||||
await this.kibanaServer.importExport.load('visualize');
|
||||
|
||||
await this.kibanaServer.uiSettings.replace({
|
||||
defaultIndex: 'logstash-*',
|
||||
[UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b',
|
||||
'visualization:visualize:legacyChartsLibrary': !isNewLibrary,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ export class PieChartService extends FtrService {
|
|||
const pieWidth = pieSize.width;
|
||||
await pie.clickMouseButton({
|
||||
xOffset: pieSlice.coords[0] - Math.floor(pieWidth / 2),
|
||||
yOffset: Math.floor(pieHeight / 2) - pieSlice.coords[1],
|
||||
yOffset: pieSlice.coords[1] - Math.floor(pieHeight / 2),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue