kibana/x-pack/test_serverless/functional/config.base.ts
Davis McPhee be7d748845
[Discover] Add context awareness telemetry tests for Observability profiles (#201310)
## Summary

As suggested in
https://github.com/elastic/kibana/pull/199255#discussion_r1842804292,
I've copied and modified the existing Discover context awareness
telemetry tests to work for Observability profiles. This helps test that
solution root profiles are picked up as expected, as well as giving us
some serverless coverage.

@elastic/appex-qa It didn't seem like there were any config specific
services for serverless tests yet, so I added the EBT to services to the
main serverless config. If there's a better way to do this, please let
me know and I can update it.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-11-28 20:12:26 -04:00

143 lines
4.5 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import { resolve } from 'path';
import { pageObjects } from './page_objects';
import { services } from './services';
import type { CreateTestConfigOptions } from '../shared/types';
export function createTestConfig<TServices extends {} = typeof services>(
options: CreateTestConfigOptions<TServices>
) {
return async ({ readConfigFile }: FtrConfigProviderContext) => {
const svlSharedConfig = await readConfigFile(require.resolve('../shared/config.base.ts'));
return {
...svlSharedConfig.getAll(),
pageObjects,
services: { ...services, ...options.services },
esTestCluster: {
...svlSharedConfig.get('esTestCluster'),
serverArgs: [
...svlSharedConfig.get('esTestCluster.serverArgs'),
// custom native roles are enabled only for search and security projects
...(options.serverlessProject !== 'oblt'
? ['xpack.security.authc.native_roles.enabled=true']
: []),
...(options.esServerArgs ?? []),
],
},
kbnTestServer: {
...svlSharedConfig.get('kbnTestServer'),
serverArgs: [
...svlSharedConfig.get('kbnTestServer.serverArgs'),
`--serverless=${options.serverlessProject}`,
// Ensures the existing E2E tests are backwards compatible with the old rule create flyout
// Remove this experiment once all of the migration has been completed
`--xpack.trigger_actions_ui.enableExperimental=${JSON.stringify([
'isUsingRuleCreateFlyout',
])}`,
...(options.kbnServerArgs ?? []),
],
},
testFiles: options.testFiles,
uiSettings: {
defaults: {
'accessibility:disableAnimations': true,
'dateFormat:tz': 'UTC',
},
},
// the apps section defines the urls that
// `PageObjects.common.navigateTo(appKey)` will use.
// Merge urls for your plugin with the urls defined in
// Kibana's config in order to use this helper
apps: {
home: {
pathname: '/app/home',
hash: '/',
},
landingPage: {
pathname: '/',
},
observability: {
pathname: '/app/observability',
},
observabilityLogsExplorer: {
pathname: '/app/observability-logs-explorer',
},
observabilityOnboarding: {
pathname: '/app/observabilityOnboarding',
},
management: {
pathname: '/app/management',
},
indexManagement: {
pathname: '/app/management/data/index_management',
},
ingestPipelines: {
pathname: '/app/management/ingest/ingest_pipelines',
},
transform: {
pathname: '/app/management/data/transform',
},
connectors: {
pathname: '/app/management/insightsAndAlerting/triggersActionsConnectors/',
},
triggersActions: {
pathname: '/app/management/insightsAndAlerting/triggersActions',
},
settings: {
pathname: '/app/management/kibana/settings',
},
login: {
pathname: '/login',
},
reportingManagement: {
pathname: '/app/management/insightsAndAlerting/reporting',
},
securitySolution: {
pathname: '/app/security',
},
dashboard: {
pathname: '/app/dashboards',
},
discover: {
pathname: '/app/discover',
},
context: {
pathname: '/app/discover',
hash: '/context',
},
searchProfiler: {
pathname: '/app/dev_tools',
hash: '/searchprofiler',
},
maintenanceWindows: {
pathname: '/app/management/insightsAndAlerting/maintenanceWindows',
},
fleet: {
pathname: '/app/fleet',
},
integrations: {
pathname: '/app/integrations',
},
...(options.apps ?? {}),
},
// choose where screenshots should be saved
screenshots: {
directory: resolve(__dirname, 'screenshots'),
},
failureDebugging: {
htmlDirectory: resolve(__dirname, 'failure_debug', 'html'),
},
junit: options.junit,
suiteTags: options.suiteTags,
};
};
}