forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting] First accessibility test (elastic#104410)
* makeAllReportingPoliciesUnmanaged -> makeAllReportingIndicesUnmanaged * expose the reporting services on the functional services object shared with a11y * added data-test-subjs for a11y test * added reporting a11y test * updated jest test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
889ef64
commit 537eaeb
Showing
7 changed files
with
95 additions
and
6 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
x-pack/plugins/reporting/public/management/__snapshots__/report_listing.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* 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 { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
import { JOB_PARAMS_RISON_CSV_DEPRECATED } from '../../reporting_api_integration/services/fixtures'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const { common } = getPageObjects(['common']); | ||
const retry = getService('retry'); | ||
const a11y = getService('a11y'); | ||
const testSubjects = getService('testSubjects'); | ||
const supertestWithoutAuth = getService('supertestWithoutAuth'); | ||
const reporting = getService('reporting'); | ||
const esArchiver = getService('esArchiver'); | ||
const security = getService('security'); | ||
|
||
describe('Reporting', () => { | ||
const createReportingUser = async () => { | ||
await security.user.create(reporting.REPORTING_USER_USERNAME, { | ||
password: reporting.REPORTING_USER_PASSWORD, | ||
roles: ['reporting_user', 'data_analyst', 'kibana_user'], // Deprecated: using built-in `reporting_user` role grants all Reporting privileges | ||
full_name: 'a reporting user', | ||
}); | ||
}; | ||
|
||
const deleteReportingUser = async () => { | ||
await security.user.delete(reporting.REPORTING_USER_USERNAME); | ||
}; | ||
|
||
before(async () => { | ||
await esArchiver.load('x-pack/test/functional/es_archives/reporting/logs'); | ||
await esArchiver.load('x-pack/test/functional/es_archives/logstash_functional'); | ||
|
||
await createReportingUser(); | ||
await reporting.loginReportingUser(); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/logs'); | ||
await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional'); | ||
|
||
await deleteReportingUser(); | ||
}); | ||
|
||
beforeEach(async () => { | ||
// Add one report | ||
await supertestWithoutAuth | ||
.post(`/api/reporting/generate/csv`) | ||
.auth(reporting.REPORTING_USER_USERNAME, reporting.REPORTING_USER_PASSWORD) | ||
.set('kbn-xsrf', 'xxx') | ||
.send({ jobParams: JOB_PARAMS_RISON_CSV_DEPRECATED }) | ||
.expect(200); | ||
|
||
await retry.waitFor('Reporting app', async () => { | ||
await common.navigateToApp('reporting'); | ||
return testSubjects.exists('reportingPageHeader'); | ||
}); | ||
}); | ||
|
||
afterEach(async () => { | ||
await reporting.deleteAllReports(); | ||
}); | ||
|
||
it('List reports view', async () => { | ||
await retry.waitForWithTimeout('A reporting list item', 5000, () => { | ||
return testSubjects.exists('reportingListItemObjectTitle'); | ||
}); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
}); | ||
} |
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
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