-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting/Tests] Unskip "Download reports" test (#195685)
Closes #195144 The flaky test in question uses the default test login account for functional tests. I have moved it to the first test in the configuration to avoid having to re-login. Other changes: * Reduced the size of the `archived_reports` archive by shortening the field values for `output.content` and `payload.headers`. These field values where long strings of text and aren't used for anything in tests. * Changed some report job titles in the `archived_reports` archive to make the tests easier to read and verify.
- Loading branch information
Showing
5 changed files
with
56 additions
and
34 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
x-pack/test/functional/apps/reporting_management/__snapshots__/report_listing.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
-15.7 MB
(0.14%)
x-pack/test/functional/es_archives/reporting/archived_reports/data.json.gz
Binary file not shown.
53 changes: 53 additions & 0 deletions
53
x-pack/test/reporting_functional/reporting_and_security/download.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default ({ getService, getPageObjects }: FtrProviderContext) => { | ||
const PageObjects = getPageObjects(['common', 'reporting', 'dashboard']); | ||
const testSubjects = getService('testSubjects'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
describe('Download report', () => { | ||
// use archived reports to allow reporting_user to view report jobs they've created | ||
before(async () => { | ||
await esArchiver.load('x-pack/test/functional/es_archives/reporting/archived_reports'); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/archived_reports'); | ||
}); | ||
|
||
it('user can access download link', async () => { | ||
const reportId = 'krazcyw4156m0763b503j7f9'; | ||
|
||
await PageObjects.common.navigateToApp('reporting'); | ||
await testSubjects.existOrFail('reportJobListing'); | ||
|
||
const reportInfoLink = await testSubjects.find(`viewReportingLink-${reportId}`); | ||
expect(await reportInfoLink.getVisibleText()).to.be('report jobtype: csv_searchsource'); // report title indicates the jobtype | ||
|
||
// can download the report | ||
await testSubjects.existOrFail(`reportDownloadLink-${reportId}`); | ||
}); | ||
|
||
it('user can access download link for export type that is no longer supported', async () => { | ||
const reportId = 'krb7arhe164k0763b50bjm29'; | ||
|
||
await PageObjects.common.navigateToApp('reporting'); | ||
await testSubjects.existOrFail('reportJobListing'); | ||
|
||
const reportInfoLink = await testSubjects.find(`viewReportingLink-${reportId}`); | ||
expect(await reportInfoLink.getVisibleText()).to.be('report jobtype: csv'); // report title indicates the **removed** jobtype | ||
|
||
// can download the report | ||
await testSubjects.existOrFail(`reportDownloadLink-${reportId}`); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters