Skip to content

Commit

Permalink
Remove unused helpers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mykolaharmash committed Oct 18, 2023
1 parent c4d7dc3 commit 253f4d0
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions x-pack/test/functional/apps/infra/hosts_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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();
Expand Down

0 comments on commit 253f4d0

Please sign in to comment.