Skip to content

Commit

Permalink
✅ Add functional test for reporting URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Mar 29, 2023
1 parent 2b3d9e9 commit d73df1e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions x-pack/test/functional/apps/lens/group3/lens_reporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const listingTable = getService('listingTable');
const security = getService('security');
const browser = getService('browser');

describe('lens reporting', () => {
before(async () => {
Expand Down Expand Up @@ -117,6 +118,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.existOrFail('shareReportingCopyURL');
expect(await testSubjects.getVisibleText('shareReportingCopyURL')).to.eql('Copy POST URL');
});

it('should produce a valid URL for reporting', async () => {
await PageObjects.reporting.clickGenerateReportButton();
await PageObjects.reporting.getReportURL(60000);
// navigate to the reporting page
await PageObjects.common.navigateToUrl('management', '/insightsAndAlerting');
await testSubjects.click('reporting');
// find the latest Lens report
await testSubjects.click('reportJobRow > euiCollapsedItemActionsButton');
// click on Open in Kibana and check that all is ok
await testSubjects.click('reportOpenInKibanaApp');

const [reportingWindowHandler, lensWindowHandle] = await browser.getAllWindowHandles();
await browser.switchToWindow(lensWindowHandle);
// verify some configuration
expect(await PageObjects.lens.getDimensionTriggerText('lnsXY_yDimensionPanel')).to.eql(
'Average of bytes'
);
await browser.closeCurrentWindow();
await browser.switchToWindow(reportingWindowHandler);
});
}
});
}

0 comments on commit d73df1e

Please sign in to comment.