kibana/x-pack/test_serverless/shared
Dzmitry Lemechko 2b49a407f7
[ftr] update common serverless tests to use saml auth (#176221)
## Summary

This PR updates FTR functional tests shared b/w projects to use SAML
authentication instead of login with default user and kibana `/login`
route.

Few notes for reviewers:
- admin role was added to each project roles.yml file and its definition
matches cloud one.
- please check your tests if selected role is as expected: the goal is
to run test with the role that has minimal required permissions, but
some tests were failing with lower access role:
   - `viewer` - read only
   - `editor` / `developer` for write actions (e.g. save search)
   - `admin` if full access required

- svl_common_page.ts was updated:
- `cleanBrowserState()` is added to reset state b/w test suites by
deleting all cookies, clearing session & local storages.
- `loginWithRole(role: string)` starts with `cleanBrowserState()` call,
then sets the new cookie based on provided role and validates the role
is applied correctly. On its finish browser is at Kibana home screen.
- `loginAsAdmin()` and `loginWithPrivilegedRole()` to login as admin and
editor/developer roles.
- `forceLogout()` is only required in tests that use basic
authentication. It starts with `cleanBrowserState()` call and then loads
`/logout` route (we can't load base url because mock-id-plugin will
trigger redirects). On its finish browser is at Cloud login screen.

For @elastic/kibana-operations : 
This change affects the login in the functional serverless tests (18
config files at the moment) and while it seems to be stable enough, it
might be the reason of sudden flakiness/failures on CI.


[Flaky-test-runner
60x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5107)
to verify login via cookie is stable

---------

Co-authored-by: Robert Oskamp <traeluki@gmail.com>
2024-02-09 10:23:24 -07:00
..
lib [Entity Analytics] Asset criticality privileges API (#172441) 2023-12-06 19:50:04 +00:00
services [ftr] update common serverless tests to use saml auth (#176221) 2024-02-09 10:23:24 -07:00
types [kbn-es] move svl roles definition to separate files & start servers accordingly (#174284) 2024-01-22 09:32:55 -07:00
config.base.ts Add Mock IDP login page and role switcher (#172257) 2024-01-12 21:54:51 +01:00