[Test] Add tag cloud visualization to dashboard in functional test for reporting (#87600)
* add tag cloud to dashboard in kibana archive * add pdf snapshot testing to downloaded pdfs * update png baseline image * remove pdf snapshot testing * rename mislabeled variable * fix test comparison * remove unnecessary pdf utf8 checks * Update screenshots.ts Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
273ad4e505
commit
abffb19889
Binary file not shown.
Before Width: | Height: | Size: 617 KiB After Width: | Height: | Size: 736 KiB |
|
@ -25,7 +25,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||||
const es = getService('es');
|
const es = getService('es');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
|
|
||||||
describe('Screenshots', () => {
|
describe('Dashboard Reporting Screenshots', () => {
|
||||||
before('initialize tests', async () => {
|
before('initialize tests', async () => {
|
||||||
log.debug('ReportingPage:initTests');
|
log.debug('ReportingPage:initTests');
|
||||||
await esArchiver.loadIfNeeded('reporting/ecommerce');
|
await esArchiver.loadIfNeeded('reporting/ecommerce');
|
||||||
|
@ -93,8 +93,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Preserve Layout', () => {
|
describe('PNG Layout', () => {
|
||||||
it('matches baseline report', async function () {
|
it('downloads a PNG file', async function () {
|
||||||
const writeSessionReport = async (name: string, rawPdf: Buffer, reportExt: string) => {
|
const writeSessionReport = async (name: string, rawPdf: Buffer, reportExt: string) => {
|
||||||
const sessionDirectory = path.resolve(REPORTS_FOLDER, 'session');
|
const sessionDirectory = path.resolve(REPORTS_FOLDER, 'session');
|
||||||
await mkdirAsync(sessionDirectory, { recursive: true });
|
await mkdirAsync(sessionDirectory, { recursive: true });
|
||||||
|
@ -122,14 +122,32 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||||
const reportData = await PageObjects.reporting.getRawPdfReportData(url);
|
const reportData = await PageObjects.reporting.getRawPdfReportData(url);
|
||||||
const reportFileName = 'dashboard_preserve_layout';
|
const reportFileName = 'dashboard_preserve_layout';
|
||||||
const sessionReportPath = await writeSessionReport(reportFileName, reportData, 'png');
|
const sessionReportPath = await writeSessionReport(reportFileName, reportData, 'png');
|
||||||
const percentSimilar = await checkIfPngsMatch(
|
const percentDiff = await checkIfPngsMatch(
|
||||||
sessionReportPath,
|
sessionReportPath,
|
||||||
getBaselineReportPath(reportFileName, 'png'),
|
getBaselineReportPath(reportFileName, 'png'),
|
||||||
config.get('screenshots.directory'),
|
config.get('screenshots.directory'),
|
||||||
log
|
log
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(percentSimilar).to.be.lessThan(0.1);
|
expect(percentDiff).to.be.lessThan(0.09);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Preserve Layout', () => {
|
||||||
|
it('downloads a PDF file', async function () {
|
||||||
|
// Generating and then comparing reports can take longer than the default 60s timeout because the comparePngs
|
||||||
|
// function is taking about 15 seconds per comparison in jenkins.
|
||||||
|
this.timeout(300000);
|
||||||
|
await PageObjects.common.navigateToApp('dashboard');
|
||||||
|
await PageObjects.dashboard.loadSavedDashboard('Ecom Dashboard');
|
||||||
|
await PageObjects.reporting.openPdfReportingPanel();
|
||||||
|
await PageObjects.reporting.clickGenerateReportButton();
|
||||||
|
|
||||||
|
const url = await PageObjects.reporting.getReportURL(60000);
|
||||||
|
const res = await PageObjects.reporting.getResponse(url);
|
||||||
|
|
||||||
|
expect(res.status).to.equal(200);
|
||||||
|
expect(res.get('content-type')).to.equal('application/pdf');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'visEditor',
|
'visEditor',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
describe('Visualize', () => {
|
describe('Visualize Reporting Screenshots', () => {
|
||||||
before('initialize tests', async () => {
|
before('initialize tests', async () => {
|
||||||
log.debug('ReportingPage:initTests');
|
log.debug('ReportingPage:initTests');
|
||||||
await esArchiver.loadIfNeeded('reporting/ecommerce');
|
await esArchiver.loadIfNeeded('reporting/ecommerce');
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue