Skip to content

Commit 02fb42f

Browse files
Cross cluster search functional test with minimun privileges assigned to the test_user (#70007) (#70268)
* using test_user with limited read permission to search profiler test * gitcheck * search profiler test using test_user * using limited roles and privileges for CCR * changed the global ccr role kibana section to be consistent with other roles with no feature controls * removed canvas role * changes to include pagination for 100 rows Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 2e07eb4 commit 02fb42f

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

x-pack/test/functional/apps/cross_cluster_replication/home_page.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ import { FtrProviderContext } from '../../ftr_provider_context';
1010
export default ({ getPageObjects, getService }: FtrProviderContext) => {
1111
const pageObjects = getPageObjects(['common', 'crossClusterReplication']);
1212
const log = getService('log');
13+
const security = getService('security');
1314

1415
describe('Home page', function () {
1516
before(async () => {
17+
await security.testUser.setRoles(['global_ccr_role']);
1618
await pageObjects.common.navigateToApp('crossClusterReplication');
1719
});
1820

21+
after(async () => {
22+
await security.testUser.restoreDefaults();
23+
});
24+
1925
it('Loads the app', async () => {
20-
await log.debug(`Checking for app title to be Cross-Cluster Replication`);
26+
log.debug(`Checking for app title to be Cross-Cluster Replication`);
2127
const appTitleText = await pageObjects.crossClusterReplication.appTitleText();
2228
expect(appTitleText).to.be('Cross-Cluster Replication');
2329

x-pack/test/functional/config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,20 @@ export default async function ({ readConfigFile }) {
242242
],
243243
},
244244

245+
global_ccr_role: {
246+
elasticsearch: {
247+
cluster: ['manage', 'manage_ccr'],
248+
},
249+
kibana: [
250+
{
251+
feature: {
252+
discover: ['read'],
253+
},
254+
spaces: ['*'],
255+
},
256+
],
257+
},
258+
245259
//Kibana feature privilege isn't specific to advancedSetting. It can be anything. https://github.com/elastic/kibana/issues/35965
246260
test_api_keys: {
247261
elasticsearch: {

x-pack/test/functional/page_objects/security_page.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ export function SecurityPageProvider({ getService, getPageObjects }: FtrProvider
315315

316316
async getElasticsearchUsers() {
317317
const users = [];
318+
await testSubjects.click('tablePaginationPopoverButton');
319+
await testSubjects.click('tablePagination-100-rows');
318320
for (const user of await testSubjects.findAll('userRow')) {
319321
const fullnameElement = await user.findByTestSubject('userRowFullName');
320322
const usernameElement = await user.findByTestSubject('userRowUserName');
@@ -339,6 +341,8 @@ export function SecurityPageProvider({ getService, getPageObjects }: FtrProvider
339341

340342
async getElasticsearchRoles() {
341343
const roles = [];
344+
await testSubjects.click('tablePaginationPopoverButton');
345+
await testSubjects.click('tablePagination-100-rows');
342346
for (const role of await testSubjects.findAll('roleRow')) {
343347
const [rolename, reserved, deprecated] = await Promise.all([
344348
role.findByTestSubject('roleRowName').then((el) => el.getVisibleText()),

0 commit comments

Comments
 (0)