Skip to content

Commit

Permalink
[Reporting/Tests] Use reporting default settings in test server config (
Browse files Browse the repository at this point in the history
#111626) (#111823)

* remove custom kibana server settings for reporting in default x-pack test config

* have tests use the deprecated built-in role granting reporting access

* restore test user default privilege for canvas

* fix app privileges in tests

* fix test_user not able to access canvas in the dashboard test

* simplify some tests setup

* update csv export timerange and snapshot

* update fn tests for app privileges

* fix feature controls test

* Update discover_security.ts

* fix reporting tests

* test using defaults in the security privilege test

* fix read-only privileges with url_create Permalinks

* fix security api anonymous

* fix anonymous capabilities tests

* fix discover csv export tests

* Update screenshots.ts

* update discover csv fn tests

* update snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/test/functional/apps/discover/__snapshots__/reporting.snap
  • Loading branch information
tsullivan authored Sep 10, 2021
1 parent 8dbbe22 commit 78dc420
Show file tree
Hide file tree
Showing 17 changed files with 637 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default function ({ getService }: FtrProviderContext) {
'minimal_read',
'url_create',
'store_search_session',
'generate_report',
];
const trialPrivileges = await supertest
.get('/api/security/privileges')
Expand Down
14 changes: 2 additions & 12 deletions x-pack/test/api_integration/apis/security/privileges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function ({ getService }: FtrProviderContext) {
features: {
graph: ['all', 'read'],
savedObjectsTagging: ['all', 'read'],
canvas: ['all', 'read', 'minimal_all', 'minimal_read', 'generate_report'],
canvas: ['all', 'read'],
maps: ['all', 'read'],
fleet: ['all', 'read'],
actions: ['all', 'read'],
Expand All @@ -45,25 +45,15 @@ export default function ({ getService }: FtrProviderContext) {
'minimal_read',
'url_create',
'store_search_session',
'generate_report',
],
visualize: [
'all',
'read',
'minimal_all',
'minimal_read',
'url_create',
'generate_report',
],
visualize: ['all', 'read', 'minimal_all', 'minimal_read', 'url_create'],
dashboard: [
'all',
'read',
'minimal_all',
'minimal_read',
'url_create',
'store_search_session',
'generate_report',
'download_csv_report',
],
dev_tools: ['all', 'read'],
advancedSettings: ['all', 'read'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
kibana: [
{
feature: {
canvas: ['minimal_all'],
canvas: ['all'],
},
spaces: ['*'],
},
Expand Down
9 changes: 6 additions & 3 deletions x-pack/test/functional/apps/canvas/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('Canvas PDF Report Generation', () => {
before('initialize tests', async () => {
log.debug('ReportingPage:initTests');
await security.role.create('test_reporting_user', {
await security.role.create('test_canvas_user', {
elasticsearch: { cluster: [], indices: [], run_as: [] },
kibana: [
{
spaces: ['*'],
base: [],
feature: { canvas: ['minimal_read', 'generate_report'] },
feature: { canvas: ['read'] },
},
],
});
await security.testUser.setRoles(['kibana_admin', 'test_reporting_user']);
await security.testUser.setRoles([
'test_canvas_user',
'reporting_user', // NOTE: the built-in role granting full reporting access is deprecated. See xpack.reporting.roles.enabled
]);
await kibanaServer.importExport.load(archive);
await browser.setWindowSize(1600, 850);
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 78dc420

Please sign in to comment.