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:
Rashmi Kulkarni 2021-08-12 10:15:06 -07:00 committed by GitHub
parent 34080b20b0
commit 320fc8b650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 8 deletions

View file

@ -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();

View file

@ -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);
});
});
}

View file

@ -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: [