From 253f4d01be989229135faa5c605c7b406a85c249 Mon Sep 17 00:00:00 2001 From: Mykola Harmash Date: Wed, 18 Oct 2023 09:11:00 +0200 Subject: [PATCH] Remove unused helpers in tests --- .../test/functional/apps/infra/hosts_view.ts | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/x-pack/test/functional/apps/infra/hosts_view.ts b/x-pack/test/functional/apps/infra/hosts_view.ts index b505a838eae3e..fa9008bf5cc24 100644 --- a/x-pack/test/functional/apps/infra/hosts_view.ts +++ b/x-pack/test/functional/apps/infra/hosts_view.ts @@ -94,7 +94,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const kibanaServer = getService('kibanaServer'); const observability = getService('observability'); const retry = getService('retry'); - const security = getService('security'); const testSubjects = getService('testSubjects'); const pageObjects = getPageObjects([ 'assetDetails', @@ -111,47 +110,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const setHostViewEnabled = (value: boolean = true) => kibanaServer.uiSettings.update({ [enableInfrastructureHostsView]: value }); - const loginWithReadOnlyUser = async () => { - const roleCreation = await security.role.create('global_hosts_read_privileges_role', { - elasticsearch: { - indices: [{ names: ['metricbeat-*'], privileges: ['read', 'view_index_metadata'] }], - }, - kibana: [ - { - feature: { - infrastructure: ['read'], - advancedSettings: ['read'], - }, - spaces: ['*'], - }, - ], - }); - - const userCreation = security.user.create('global_hosts_read_privileges_user', { - password: 'global_hosts_read_privileges_user-password', - roles: ['global_hosts_read_privileges_role'], - full_name: 'test user', - }); - - await Promise.all([roleCreation, userCreation]); - - await pageObjects.security.forceLogout(); - await pageObjects.security.login( - 'global_hosts_read_privileges_user', - 'global_hosts_read_privileges_user-password', - { - expectSpaceSelector: false, - } - ); - }; - - const logoutAndDeleteReadOnlyUser = () => - Promise.all([ - pageObjects.security.forceLogout(), - security.role.delete('global_hosts_read_privileges_role'), - security.user.delete('global_hosts_read_privileges_user'), - ]); - const returnTo = async (path: string, timeout = 2000) => retry.waitForWithTimeout('returned to hosts view', timeout, async () => { await browser.goBack();