-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
config.base.ts
141 lines (137 loc) · 4.44 KB
/
config.base.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
* 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(options: CreateTestConfigOptions) {
return async ({ readConfigFile }: FtrConfigProviderContext) => {
const svlSharedConfig = await readConfigFile(require.resolve('../shared/config.base.ts'));
return {
...svlSharedConfig.getAll(),
pageObjects,
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,
};
};
}