mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
test user with specific roles and permissions- for create index pattern wizard test (#107984)
* test user with specific roles and permissions * added SO method logging, added test data stream to the role and modified createindexpattern function * removed unused method added in settings page * removed unused index name- logs-* * remove unused function from settings page Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
34080b20b0
commit
320fc8b650
3 changed files with 36 additions and 8 deletions
|
@ -357,7 +357,12 @@ export class SettingsPageObject extends FtrService {
|
|||
}
|
||||
|
||||
await this.header.waitUntilLoadingHasFinished();
|
||||
await this.clickAddNewIndexPatternButton();
|
||||
const flyOut = await this.testSubjects.exists('createAnyway');
|
||||
if (flyOut) {
|
||||
await this.testSubjects.click('createAnyway');
|
||||
} else {
|
||||
await this.clickAddNewIndexPatternButton();
|
||||
}
|
||||
await this.header.waitUntilLoadingHasFinished();
|
||||
if (!isStandardIndexPattern) {
|
||||
await this.selectRollupIndexPatternType();
|
||||
|
|
|
@ -8,14 +8,20 @@
|
|||
export default function ({ getService, getPageObjects }) {
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const es = getService('es');
|
||||
const security = getService('security');
|
||||
const PageObjects = getPageObjects(['settings', 'common']);
|
||||
const soInfo = getService('savedObjectInfo');
|
||||
const log = getService('log');
|
||||
|
||||
describe('"Create Index Pattern" wizard', function () {
|
||||
before(async function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
await soInfo.logSoTypes(log);
|
||||
await security.testUser.setRoles([
|
||||
'global_index_pattern_management_all',
|
||||
'test_logs_data_reader',
|
||||
]);
|
||||
await kibanaServer.uiSettings.replace({});
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||
});
|
||||
|
||||
describe('data streams', () => {
|
||||
|
@ -43,13 +49,19 @@ export default function ({ getService, getPageObjects }) {
|
|||
method: 'PUT',
|
||||
});
|
||||
|
||||
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||
await PageObjects.settings.createIndexPattern('test_data_stream');
|
||||
|
||||
await es.transport.request({
|
||||
path: '/_data_stream/test_data_stream',
|
||||
method: 'DELETE',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await kibanaServer.savedObjects.clean({ types: ['index-pattern'] });
|
||||
await es.transport.request({
|
||||
path: '/_data_stream/test_data_stream',
|
||||
method: 'DELETE',
|
||||
});
|
||||
await security.testUser.restoreDefaults();
|
||||
await soInfo.logSoTypes(log);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -384,6 +384,17 @@ export default async function ({ readConfigFile }) {
|
|||
},
|
||||
},
|
||||
|
||||
test_logs_data_reader: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['test_data_stream'],
|
||||
privileges: ['read', 'view_index_metadata'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
geoall_data_writer: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue