Skip to content

Commit

Permalink
test user with specific roles and permissions- for create index patte…
Browse files Browse the repository at this point in the history
…rn 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 <[email protected]>
  • Loading branch information
rashmivkulkarni and kibanamachine authored Aug 12, 2021
1 parent 34080b2 commit 320fc8b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
7 changes: 6 additions & 1 deletion test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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);
});
});
}
11 changes: 11 additions & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 320fc8b

Please sign in to comment.