Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test user with specific roles and permissions- for create index pattern wizard test #107984

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
rashmivkulkarni marked this conversation as resolved.
Show resolved Hide resolved
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