From 44bdb82353d1be3f42454d3f72328483ba55cb6a Mon Sep 17 00:00:00 2001 From: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:07:05 +0100 Subject: [PATCH] [Advanced Settings] Change role in security functional tests (#186602) Closes https://github.com/elastic/kibana/issues/184813 ## Summary This PR adds a role-based login in the advanced settings functional tests for security serverless project instead of using normal login where we use operator privileges. It also moves the test file to a more appropriate folder. --- .../test_suites/security/{ => ftr}/advanced_settings.ts | 6 +++--- .../functional/test_suites/security/index.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename x-pack/test_serverless/functional/test_suites/security/{ => ftr}/advanced_settings.ts (88%) diff --git a/x-pack/test_serverless/functional/test_suites/security/advanced_settings.ts b/x-pack/test_serverless/functional/test_suites/security/ftr/advanced_settings.ts similarity index 88% rename from x-pack/test_serverless/functional/test_suites/security/advanced_settings.ts rename to x-pack/test_serverless/functional/test_suites/security/ftr/advanced_settings.ts index 63e3a8a9a6672..c6448aac27ec8 100644 --- a/x-pack/test_serverless/functional/test_suites/security/advanced_settings.ts +++ b/x-pack/test_serverless/functional/test_suites/security/ftr/advanced_settings.ts @@ -7,8 +7,8 @@ import expect from '@kbn/expect'; import { SECURITY_PROJECT_SETTINGS } from '@kbn/serverless-security-settings'; -import { FtrProviderContext } from '../../ftr_provider_context'; -import { isEditorFieldSetting } from '../common/management/advanced_settings'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { isEditorFieldSetting } from '../../common/management/advanced_settings'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const testSubjects = getService('testSubjects'); @@ -18,7 +18,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { describe('Security advanced settings', function () { before(async () => { - await pageObjects.svlCommonPage.login(); + await pageObjects.svlCommonPage.loginWithRole('admin'); await pageObjects.common.navigateToApp('settings'); }); diff --git a/x-pack/test_serverless/functional/test_suites/security/index.ts b/x-pack/test_serverless/functional/test_suites/security/index.ts index fabe48960b111..1639957c901d6 100644 --- a/x-pack/test_serverless/functional/test_suites/security/index.ts +++ b/x-pack/test_serverless/functional/test_suites/security/index.ts @@ -12,7 +12,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./ftr/landing_page')); loadTestFile(require.resolve('./ftr/navigation')); loadTestFile(require.resolve('./ftr/cases')); - loadTestFile(require.resolve('./advanced_settings')); + loadTestFile(require.resolve('./ftr/advanced_settings')); loadTestFile(require.resolve('./ml')); }); }