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

[RAC] [Observability] Set up functional test service to provide preconfigured users #110627

Closed
weltenwort opened this issue Aug 31, 2021 · 1 comment · Fixed by #110849
Closed
Assignees
Labels
Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services test Theme: rac label obsolete

Comments

@weltenwort
Copy link
Member

📓 Summary

Since several functional tests of the alerts page will need to use similar user/role/capabilities setups, we could pave the way for them by creating a functional test service that encapsulates the creation of users and role with common observability permission permutations.

✔️ Acceptance criteria

  • A test service exist in x-pack/test/functional/services/observability that
    • provides a function to create and log in users with a role with given permissions suitable for use in a before hook
    • provides a function to log out and delete the created users and roles suitable for use in an after hook
    • provides predefined permission objects with all and read permissions for individual observability solutions separately
    • provides a predefined permission object all and read for all individual observability solutions at once
  • The test observability service is registered in the overall functional test service mapping at https://github.com/elastic/kibana/blob/c510288c05089699a897e43c34b28c319ce9a472/x-pack/test/functional/services/index.ts

💡 Implementation hints

  • Examples of user/role creation as well as login/logout can be found in
    before(async () => {
    await security.role.create('cases_observability_all_role', {
    elasticsearch: { cluster: [], indices: [], run_as: [] },
    kibana: [
    { spaces: ['*'], base: [], feature: { observabilityCases: ['all'], logs: ['all'] } },
    ],
    });
    await security.user.create('cases_observability_all_user', {
    password: 'cases_observability_all_user-password',
    roles: ['cases_observability_all_role'],
    full_name: 'test user',
    });
    await PageObjects.security.forceLogout();
    await PageObjects.security.login(
    'cases_observability_all_user',
    'cases_observability_all_user-password',
    {
    expectSpaceSelector: false,
    }
    );
    });
    after(async () => {
    await PageObjects.security.forceLogout();
    await Promise.all([
    security.role.delete('cases_observability_all_role'),
    security.user.delete('cases_observability_all_user'),
    ]);
    });
@weltenwort weltenwort added test Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Theme: rac label obsolete labels Aug 31, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services test Theme: rac label obsolete
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants