mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -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.header.waitUntilLoadingHasFinished();
|
||||||
|
const flyOut = await this.testSubjects.exists('createAnyway');
|
||||||
|
if (flyOut) {
|
||||||
|
await this.testSubjects.click('createAnyway');
|
||||||
|
} else {
|
||||||
await this.clickAddNewIndexPatternButton();
|
await this.clickAddNewIndexPatternButton();
|
||||||
|
}
|
||||||
await this.header.waitUntilLoadingHasFinished();
|
await this.header.waitUntilLoadingHasFinished();
|
||||||
if (!isStandardIndexPattern) {
|
if (!isStandardIndexPattern) {
|
||||||
await this.selectRollupIndexPatternType();
|
await this.selectRollupIndexPatternType();
|
||||||
|
|
|
@ -8,14 +8,20 @@
|
||||||
export default function ({ getService, getPageObjects }) {
|
export default function ({ getService, getPageObjects }) {
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const es = getService('es');
|
const es = getService('es');
|
||||||
|
const security = getService('security');
|
||||||
const PageObjects = getPageObjects(['settings', 'common']);
|
const PageObjects = getPageObjects(['settings', 'common']);
|
||||||
|
const soInfo = getService('savedObjectInfo');
|
||||||
|
const log = getService('log');
|
||||||
|
|
||||||
describe('"Create Index Pattern" wizard', function () {
|
describe('"Create Index Pattern" wizard', function () {
|
||||||
before(async 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 kibanaServer.uiSettings.replace({});
|
||||||
await PageObjects.settings.navigateTo();
|
await PageObjects.settings.navigateTo();
|
||||||
await PageObjects.settings.clickKibanaIndexPatterns();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('data streams', () => {
|
describe('data streams', () => {
|
||||||
|
@ -43,13 +49,19 @@ export default function ({ getService, getPageObjects }) {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||||
await PageObjects.settings.createIndexPattern('test_data_stream');
|
await PageObjects.settings.createIndexPattern('test_data_stream');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await kibanaServer.savedObjects.clean({ types: ['index-pattern'] });
|
||||||
await es.transport.request({
|
await es.transport.request({
|
||||||
path: '/_data_stream/test_data_stream',
|
path: '/_data_stream/test_data_stream',
|
||||||
method: 'DELETE',
|
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: {
|
geoall_data_writer: {
|
||||||
elasticsearch: {
|
elasticsearch: {
|
||||||
indices: [
|
indices: [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue