mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
move apps lower in tree, add metricbeat dashboard screenshot test (#79001)
This commit is contained in:
parent
d0f8e5cbea
commit
0a7462dc4a
31 changed files with 81 additions and 8 deletions
|
@ -38,7 +38,7 @@ export async function FailureDebuggingProvider({ getService }: FtrProviderContex
|
||||||
const log = getService('log');
|
const log = getService('log');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
|
|
||||||
if (process.env.CI !== 'true') {
|
if (process.env.CI !== 'true' && !process.env.stack_functional_integration) {
|
||||||
await del(config.get('failureDebugging.htmlDirectory'));
|
await del(config.get('failureDebugging.htmlDirectory'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ export async function ScreenshotsProvider({ getService }: FtrProviderContext) {
|
||||||
const FAILURE_DIRECTORY = resolve(config.get('screenshots.directory'), 'failure');
|
const FAILURE_DIRECTORY = resolve(config.get('screenshots.directory'), 'failure');
|
||||||
const BASELINE_DIRECTORY = resolve(config.get('screenshots.directory'), 'baseline');
|
const BASELINE_DIRECTORY = resolve(config.get('screenshots.directory'), 'baseline');
|
||||||
|
|
||||||
if (process.env.CI !== 'true') {
|
if (process.env.CI !== 'true' && !process.env.stack_functional_integration) {
|
||||||
await del([SESSION_DIRECTORY, FAILURE_DIRECTORY]);
|
await del([SESSION_DIRECTORY, FAILURE_DIRECTORY]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ export async function SnapshotsProvider({ getService }: FtrProviderContext) {
|
||||||
const SESSION_DIRECTORY = resolve(config.get('snapshots.directory'), 'session');
|
const SESSION_DIRECTORY = resolve(config.get('snapshots.directory'), 'session');
|
||||||
const BASELINE_DIRECTORY = resolve(config.get('snapshots.directory'), 'baseline');
|
const BASELINE_DIRECTORY = resolve(config.get('snapshots.directory'), 'baseline');
|
||||||
|
|
||||||
if (process.env.CI !== 'true') {
|
if (process.env.CI !== 'true' && !process.env.stack_functional_integration) {
|
||||||
await del([SESSION_DIRECTORY]);
|
await del([SESSION_DIRECTORY]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
|
* or more contributor license agreements. Licensed under the Elastic License;
|
||||||
|
* you may not use this file except in compliance with the Elastic License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import expect from '@kbn/expect';
|
||||||
|
import { REPO_ROOT } from '@kbn/dev-utils';
|
||||||
|
|
||||||
|
export default function ({ getService, getPageObjects, updateBaselines }) {
|
||||||
|
const screenshot = getService('screenshots');
|
||||||
|
const browser = getService('browser');
|
||||||
|
const esArchiver = getService('esArchiver');
|
||||||
|
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']);
|
||||||
|
|
||||||
|
describe('check metricbeat Dashboard', function () {
|
||||||
|
before(async function () {
|
||||||
|
await esArchiver.load(`${REPO_ROOT}/../integration-test/test/es_archives/metricbeat`);
|
||||||
|
|
||||||
|
// this navigateToActualURL takes the place of navigating to the dashboard landing page,
|
||||||
|
// filtering on the dashboard name, selecting it, setting the timepicker, and going to full screen
|
||||||
|
await PageObjects.common.navigateToActualUrl(
|
||||||
|
'dashboard',
|
||||||
|
'view/Metricbeat-system-overview-ecs?_g=(filters:!(),refreshInterval:(pause:!t,value:0),' +
|
||||||
|
'time:(from:%272020-09-29T19:02:37.902Z%27,to:%272020-09-29T19:06:43.218Z%27))&_a=' +
|
||||||
|
'(description:%27Overview%20of%20system%20metrics%27,filters:!(),fullScreenMode:!t,' +
|
||||||
|
'options:(darkTheme:!f),query:(language:kuery,query:%27%27),timeRestore:!f,' +
|
||||||
|
'title:%27%5BMetricbeat%20System%5D%20Overview%20ECS%27,viewMode:view)',
|
||||||
|
{
|
||||||
|
ensureCurrentUrl: false,
|
||||||
|
shouldLoginIfPrompted: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// await PageObjects.common.navigateToApp('dashboard', { insertTimestamp: false });
|
||||||
|
// await PageObjects.dashboard.loadSavedDashboard('[Metricbeat System] Overview ECS');
|
||||||
|
// await PageObjects.timePicker.setAbsoluteRange(
|
||||||
|
// 'Sep 29, 2020 @ 14:02:37.902',
|
||||||
|
// 'Sep 29, 2020 @ 14:06:43.218'
|
||||||
|
// );
|
||||||
|
// await PageObjects.dashboard.clickFullScreenMode();
|
||||||
|
|
||||||
|
await PageObjects.common.sleep(2000);
|
||||||
|
await PageObjects.dashboard.waitForRenderComplete();
|
||||||
|
await browser.setScreenshotSize(1000, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[Metricbeat System] Overview ECS should match snapshot', async function () {
|
||||||
|
try {
|
||||||
|
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||||
|
'metricbeat_dashboard',
|
||||||
|
updateBaselines
|
||||||
|
);
|
||||||
|
expect(percentDifference).to.be.lessThan(0.01);
|
||||||
|
} finally {
|
||||||
|
await PageObjects.dashboard.clickExitFullScreenLogoButton();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -7,5 +7,6 @@
|
||||||
export default function ({ loadTestFile }) {
|
export default function ({ loadTestFile }) {
|
||||||
describe('metricbeat app', function () {
|
describe('metricbeat app', function () {
|
||||||
loadTestFile(require.resolve('./_metricbeat'));
|
loadTestFile(require.resolve('./_metricbeat'));
|
||||||
|
loadTestFile(require.resolve('./_metricbeat_dashboard'));
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import buildState from './build_state';
|
import buildState from './build_state';
|
||||||
import { ToolingLog } from '@kbn/dev-utils';
|
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { esTestConfig, kbnTestConfig } from '@kbn/test';
|
import { esTestConfig, kbnTestConfig } from '@kbn/test';
|
||||||
|
|
||||||
const reportName = 'Stack Functional Integration Tests';
|
const reportName = 'Stack Functional Integration Tests';
|
||||||
const testsFolder = '../test/functional/apps';
|
const testsFolder = '../apps';
|
||||||
const log = new ToolingLog({
|
const log = new ToolingLog({
|
||||||
level: 'info',
|
level: 'info',
|
||||||
writeTo: process.stdout,
|
writeTo: process.stdout,
|
||||||
|
@ -19,13 +19,14 @@ const log = new ToolingLog({
|
||||||
log.info(`WORKSPACE in config file ${process.env.WORKSPACE}`);
|
log.info(`WORKSPACE in config file ${process.env.WORKSPACE}`);
|
||||||
const stateFilePath = process.env.WORKSPACE
|
const stateFilePath = process.env.WORKSPACE
|
||||||
? `${process.env.WORKSPACE}/qa/envvars.sh`
|
? `${process.env.WORKSPACE}/qa/envvars.sh`
|
||||||
: '../../../../../integration-test/qa/envvars.sh';
|
: `${REPO_ROOT}/../integration-test/qa/envvars.sh`;
|
||||||
|
|
||||||
const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`);
|
const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`);
|
||||||
|
|
||||||
export default async ({ readConfigFile }) => {
|
export default async ({ readConfigFile }) => {
|
||||||
const defaultConfigs = await readConfigFile(require.resolve('../../functional/config'));
|
const defaultConfigs = await readConfigFile(require.resolve('../../functional/config'));
|
||||||
const { tests, ...provisionedConfigs } = buildState(resolve(__dirname, stateFilePath));
|
const { tests, ...provisionedConfigs } = buildState(resolve(__dirname, stateFilePath));
|
||||||
|
process.env.stack_functional_integration = true;
|
||||||
|
|
||||||
const servers = {
|
const servers = {
|
||||||
kibana: kbnTestConfig.getUrlParts(),
|
kibana: kbnTestConfig.getUrlParts(),
|
||||||
|
@ -43,6 +44,14 @@ export default async ({ readConfigFile }) => {
|
||||||
// If we need to do things like disable animations, we can do it in configure_start_kibana.sh, in the provisioner...which lives in the integration-test private repo
|
// If we need to do things like disable animations, we can do it in configure_start_kibana.sh, in the provisioner...which lives in the integration-test private repo
|
||||||
uiSettings: {},
|
uiSettings: {},
|
||||||
security: { disableTestUser: true },
|
security: { disableTestUser: true },
|
||||||
|
// choose where screenshots should be saved
|
||||||
|
screenshots: {
|
||||||
|
directory: resolve(`${REPO_ROOT}/../integration-test`, 'test/screenshots'),
|
||||||
|
},
|
||||||
|
// choose where esArchiver should load archives from
|
||||||
|
esArchiver: {
|
||||||
|
directory: resolve(`${REPO_ROOT}/../integration-test`, 'test/es_archives'),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
return settings;
|
return settings;
|
||||||
};
|
};
|
||||||
|
@ -55,7 +64,7 @@ function truncate(testPath) {
|
||||||
return dropKibanaPath(testPath);
|
return dropKibanaPath(testPath);
|
||||||
}
|
}
|
||||||
function highLight(testPath) {
|
function highLight(testPath) {
|
||||||
const dropTestsPath = splitRight(/^.+test[\\/]functional[\\/]apps[\\/](.*)[\\/]/gm);
|
const dropTestsPath = splitRight(/^.+apps[\\/](.*)[\\/]/gm);
|
||||||
const cleaned = dropTestsPath(testPath);
|
const cleaned = dropTestsPath(testPath);
|
||||||
const colored = chalk.greenBright.bold(cleaned);
|
const colored = chalk.greenBright.bold(cleaned);
|
||||||
return testPath.replace(cleaned, colored);
|
return testPath.replace(cleaned, colored);
|
||||||
|
|
|
@ -20,7 +20,11 @@ export default (envObj) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (envObj.BEATS.includes('metricbeat')) {
|
if (envObj.BEATS.includes('metricbeat')) {
|
||||||
xs.push('metricbeat');
|
xs.push('metricbeat/_metricbeat');
|
||||||
|
if (envObj.XPACK === 'YES') {
|
||||||
|
// the esArchive and dashboard png are specific to the default distribution (with XPACK)
|
||||||
|
xs.push('metricbeat/_metricbeat_dashboard');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (envObj.BEATS.includes('filebeat')) {
|
if (envObj.BEATS.includes('filebeat')) {
|
||||||
xs.push('filebeat');
|
xs.push('filebeat');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue