kibana/x-pack/test/reporting_api_integration/reporting_and_security.config.ts
Tim Sullivan 297e4c365f
[Reporting/Tests] Use reporting default settings in test server config (#111626)
* 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>
2021-09-09 22:13:37 -07:00

44 lines
1.5 KiB
TypeScript

/*
* 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 { FtrConfigProviderContext } from '@kbn/test';
import { resolve } from 'path';
import { ReportingAPIProvider } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const apiConfig = await readConfigFile(require.resolve('../api_integration/config'));
// config for testing network policy
const testPolicyRules = [
{ allow: true, protocol: 'http:' },
{ allow: false, host: 'via.placeholder.com' },
{ allow: true, protocol: 'https:' },
{ allow: true, protocol: 'data:' },
{ allow: false },
];
return {
...apiConfig.getAll(),
junit: { reportName: 'X-Pack Reporting API Integration Tests' },
testFiles: [resolve(__dirname, './reporting_and_security')],
services: {
...apiConfig.get('services'),
reportingAPI: ReportingAPIProvider,
},
kbnTestServer: {
...apiConfig.get('kbnTestServer'),
serverArgs: [
...apiConfig.get('kbnTestServer.serverArgs'),
`--xpack.reporting.capture.networkPolicy.rules=${JSON.stringify(testPolicyRules)}`,
`--xpack.reporting.capture.maxAttempts=1`,
`--xpack.reporting.csv.maxSizeBytes=6000`,
'--xpack.reporting.roles.enabled=false', // Reporting access control is implemented by sub-feature application privileges
],
},
};
}