mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[xpack/ftr/common] follow service provider conventions (#52236)
* [xpack/ftr/common] follow conventions, expose a config file In order to make xpack/test/common ftr config easier to work with, this updates it to follow the conventions established by most other configs of exposing all services from the services module as an object that can be easily merges into local services modules. * common config file and FtrProviderConfig are unused and unnecessary * turns out FtrProviderContext was used...
This commit is contained in:
parent
05fd394325
commit
b66415e416
53 changed files with 157 additions and 180 deletions
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SpacesService, SecurityService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
import { isCustomRoleSpecification } from '../../common/types';
|
||||
import { Spaces, Users } from '../scenarios';
|
||||
|
@ -14,8 +13,8 @@ export default function alertingApiIntegrationTests({
|
|||
loadTestFile,
|
||||
getService,
|
||||
}: FtrProviderContext) {
|
||||
const securityService: SecurityService = getService('security');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const securityService = getService('security');
|
||||
const spacesService = getService('spaces');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('alerting api integration security and spaces enabled', function() {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
import { Spaces } from '../scenarios';
|
||||
|
||||
|
@ -13,7 +12,7 @@ export default function alertingApiIntegrationTests({
|
|||
loadTestFile,
|
||||
getService,
|
||||
}: FtrProviderContext) {
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('alerting api integration spaces only', function() {
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService, SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function featureControlsTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const security = getService('security');
|
||||
const spaces = getService('spaces');
|
||||
const log = getService('log');
|
||||
|
||||
const start = encodeURIComponent(new Date(Date.now() - 10000).toISOString());
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SecurityService, SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function securityTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const security = getService('security');
|
||||
const spaces = getService('spaces');
|
||||
|
||||
describe('/api/console/proxy', () => {
|
||||
it('cannot be accessed by an anonymous user', async () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { Feature } from '../../../../../plugins/features/server';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
|
@ -13,7 +12,7 @@ export default function({ getService }: FtrProviderContext) {
|
|||
const supertest = getService('supertest');
|
||||
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
|
||||
describe('/api/features', () => {
|
||||
describe('with the "global all" privilege', () => {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import gql from 'graphql-tag';
|
||||
import { SecurityService, SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
const introspectionQuery = gql`
|
||||
|
@ -21,8 +20,8 @@ const introspectionQuery = gql`
|
|||
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const security = getService('security');
|
||||
const spaces = getService('spaces');
|
||||
const clientFactory = getService('infraOpsGraphQLClientFactory');
|
||||
|
||||
const expectGraphQL404 = (result: any) => {
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import { SuperTest } from 'supertest';
|
||||
import { SecurityService, SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function featureControlsTests({ getService }: FtrProviderContext) {
|
||||
const supertest: SuperTest<any> = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const security = getService('security');
|
||||
const spaces = getService('spaces');
|
||||
|
||||
const expect403 = (result: any) => {
|
||||
expect(result.error).to.be(undefined);
|
||||
|
|
|
@ -6,11 +6,10 @@
|
|||
|
||||
import { Cookie, cookie } from 'request';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { SecurityService } from '../../../common/services/security';
|
||||
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
|
||||
const mockUserName = 'test-user';
|
||||
const mockUserPassword = 'test-password';
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function featureControlsTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
|
||||
describe('feature controls', () => {
|
||||
const kibanaUsername = 'kibana_user';
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import gql from 'graphql-tag';
|
||||
import { SecurityService, SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
const introspectionQuery = gql`
|
||||
|
@ -22,8 +21,8 @@ const introspectionQuery = gql`
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const config = getService('config');
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const security = getService('security');
|
||||
const spaces = getService('spaces');
|
||||
const clientFactory = getService('siemGraphQLClientFactory');
|
||||
|
||||
const expectGraphQL404 = (result: any) => {
|
||||
|
|
|
@ -6,14 +6,13 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import { docCountQueryString } from '../../../../legacy/plugins/uptime/public/queries';
|
||||
import { SecurityService, SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { PINGS_DATE_RANGE_END, PINGS_DATE_RANGE_START } from './constants';
|
||||
|
||||
export default function featureControlsTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const security: SecurityService = getService('security');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const security = getService('security');
|
||||
const spaces = getService('spaces');
|
||||
|
||||
const expect404 = (result: any) => {
|
||||
expect(result.error).to.be(undefined);
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
*/
|
||||
|
||||
import { services as kibanaApiIntegrationServices } from '../../../../test/api_integration/services';
|
||||
import { services as kibanaCommonServices } from '../../../../test/common/services';
|
||||
|
||||
import { SecurityServiceProvider, SpacesServiceProvider } from '../../common/services';
|
||||
import { services as commonServices } from '../../common/services';
|
||||
|
||||
// @ts-ignore not ts yet
|
||||
import { LegacyEsProvider } from './legacy_es';
|
||||
|
@ -25,7 +23,7 @@ import { SiemGraphQLClientProvider, SiemGraphQLClientFactoryProvider } from './s
|
|||
import { InfraOpsSourceConfigurationProvider } from './infraops_source_configuration';
|
||||
|
||||
export const services = {
|
||||
...kibanaCommonServices,
|
||||
...commonServices,
|
||||
|
||||
esSupertest: kibanaApiIntegrationServices.esSupertest,
|
||||
supertest: kibanaApiIntegrationServices.supertest,
|
||||
|
@ -35,10 +33,8 @@ export const services = {
|
|||
infraOpsGraphQLClient: InfraOpsGraphQLClientProvider,
|
||||
infraOpsGraphQLClientFactory: InfraOpsGraphQLClientFactoryProvider,
|
||||
infraOpsSourceConfiguration: InfraOpsSourceConfigurationProvider,
|
||||
security: SecurityServiceProvider,
|
||||
siemGraphQLClient: SiemGraphQLClientProvider,
|
||||
siemGraphQLClientFactory: SiemGraphQLClientFactoryProvider,
|
||||
spaces: SpacesServiceProvider,
|
||||
supertestWithoutAuth: SupertestWithoutAuthProvider,
|
||||
usageAPI: UsageAPIProvider,
|
||||
};
|
||||
|
|
11
x-pack/test/common/ftr_provider_context.ts
Normal file
11
x-pack/test/common/ftr_provider_context.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
|
||||
|
||||
import { services } from './services';
|
||||
|
||||
export type FtrProviderContext = GenericFtrProviderContext<typeof services, {}>;
|
|
@ -4,5 +4,14 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export { SecurityServiceProvider, SecurityService } from './security';
|
||||
export { SpacesServiceProvider, SpacesService } from './spaces';
|
||||
import { services as kibanaCommonServices } from '../../../../test/common/services';
|
||||
|
||||
import { SecurityServiceProvider } from './security';
|
||||
import { SpacesServiceProvider } from './spaces';
|
||||
|
||||
export const services = {
|
||||
...kibanaCommonServices,
|
||||
|
||||
security: SecurityServiceProvider,
|
||||
spaces: SpacesServiceProvider,
|
||||
};
|
||||
|
|
|
@ -3,26 +3,5 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { format as formatUrl } from 'url';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
|
||||
import { Role } from './role';
|
||||
import { User } from './user';
|
||||
|
||||
export class SecurityService {
|
||||
public role: Role;
|
||||
public user: User;
|
||||
|
||||
constructor(url: string, log: ToolingLog) {
|
||||
this.role = new Role(url, log);
|
||||
this.user = new User(url, log);
|
||||
}
|
||||
}
|
||||
|
||||
export function SecurityServiceProvider({ getService }: GenericFtrProviderContext<{}, {}>) {
|
||||
const log = getService('log');
|
||||
const config = getService('config');
|
||||
const url = formatUrl(config.get('servers.kibana'));
|
||||
|
||||
return new SecurityService(url, log);
|
||||
}
|
||||
export { SecurityServiceProvider } from './security';
|
||||
|
|
21
x-pack/test/common/services/security/security.ts
Normal file
21
x-pack/test/common/services/security/security.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { format as formatUrl } from 'url';
|
||||
|
||||
import { Role } from './role';
|
||||
import { User } from './user';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export function SecurityServiceProvider({ getService }: FtrProviderContext) {
|
||||
const log = getService('log');
|
||||
const config = getService('config');
|
||||
const url = formatUrl(config.get('servers.kibana'));
|
||||
|
||||
return new (class SecurityService {
|
||||
role = new Role(url, log);
|
||||
user = new User(url, log);
|
||||
})();
|
||||
}
|
48
x-pack/test/common/services/spaces.ts
Normal file
48
x-pack/test/common/services/spaces.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import Axios from 'axios';
|
||||
import { format as formatUrl } from 'url';
|
||||
import util from 'util';
|
||||
import { FtrProviderContext } from '../ftr_provider_context';
|
||||
|
||||
export function SpacesServiceProvider({ getService }: FtrProviderContext) {
|
||||
const log = getService('log');
|
||||
const config = getService('config');
|
||||
const url = formatUrl(config.get('servers.kibana'));
|
||||
|
||||
const axios = Axios.create({
|
||||
headers: { 'kbn-xsrf': 'x-pack/ftr/services/spaces/space' },
|
||||
baseURL: url,
|
||||
maxRedirects: 0,
|
||||
validateStatus: () => true, // we do our own validation below and throw better error messages
|
||||
});
|
||||
|
||||
return new (class SpacesService {
|
||||
public async create(space: any) {
|
||||
log.debug('creating space');
|
||||
const { data, status, statusText } = await axios.post('/api/spaces/space', space);
|
||||
|
||||
if (status !== 200) {
|
||||
throw new Error(
|
||||
`Expected status code of 200, received ${status} ${statusText}: ${util.inspect(data)}`
|
||||
);
|
||||
}
|
||||
log.debug('created space');
|
||||
}
|
||||
|
||||
public async delete(spaceId: string) {
|
||||
log.debug(`deleting space: ${spaceId}`);
|
||||
const { data, status, statusText } = await axios.delete(`/api/spaces/space/${spaceId}`);
|
||||
|
||||
if (status !== 204) {
|
||||
throw new Error(
|
||||
`Expected status code of 204, received ${status} ${statusText}: ${util.inspect(data)}`
|
||||
);
|
||||
}
|
||||
log.debug(`deleted space: ${spaceId}`);
|
||||
}
|
||||
})();
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import { format as formatUrl } from 'url';
|
||||
import util from 'util';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
|
||||
|
||||
export class SpacesService {
|
||||
private log: ToolingLog;
|
||||
private axios: AxiosInstance;
|
||||
|
||||
constructor(url: string, log: ToolingLog) {
|
||||
this.log = log;
|
||||
this.axios = axios.create({
|
||||
headers: { 'kbn-xsrf': 'x-pack/ftr/services/spaces/space' },
|
||||
baseURL: url,
|
||||
maxRedirects: 0,
|
||||
validateStatus: () => true, // we do our own validation below and throw better error messages
|
||||
});
|
||||
}
|
||||
|
||||
public async create(space: any) {
|
||||
this.log.debug('creating space');
|
||||
const { data, status, statusText } = await this.axios.post('/api/spaces/space', space);
|
||||
|
||||
if (status !== 200) {
|
||||
throw new Error(
|
||||
`Expected status code of 200, received ${status} ${statusText}: ${util.inspect(data)}`
|
||||
);
|
||||
}
|
||||
this.log.debug('created space');
|
||||
}
|
||||
|
||||
public async delete(spaceId: string) {
|
||||
this.log.debug(`deleting space: ${spaceId}`);
|
||||
const { data, status, statusText } = await this.axios.delete(`/api/spaces/space/${spaceId}`);
|
||||
|
||||
if (status !== 204) {
|
||||
throw new Error(
|
||||
`Expected status code of 204, received ${status} ${statusText}: ${util.inspect(data)}`
|
||||
);
|
||||
}
|
||||
this.log.debug(`deleted space: ${spaceId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export function SpacesServiceProvider({ getService }: GenericFtrProviderContext<{}, {}>) {
|
||||
const log = getService('log');
|
||||
const config = getService('config');
|
||||
const url = formatUrl(config.get('servers.kibana'));
|
||||
return new SpacesService(url, log);
|
||||
}
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'settings', 'security', 'spaceSelector']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const PageObjects = getPageObjects(['common', 'error', 'security']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'error', 'timePicker', 'security']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'canvas', 'security', 'spaceSelector']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
||||
|
|
|
@ -9,12 +9,11 @@ import {
|
|||
createDashboardEditUrl,
|
||||
DashboardConstants,
|
||||
} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'spaceSelector', 'share']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const panelActions = getService('dashboardPanelActions');
|
||||
|
|
|
@ -9,12 +9,11 @@ import {
|
|||
createDashboardEditUrl,
|
||||
DashboardConstants,
|
||||
} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'spaceSelector']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const PageObjects = getPageObjects(['common', 'console', 'security']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'spaceSelector']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const globalNav = getService('globalNav');
|
||||
const PageObjects = getPageObjects([
|
||||
'common',
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects([
|
||||
'common',
|
||||
'discover',
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const PageObjects = getPageObjects(['common', 'graph', 'security', 'error']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'graph', 'security', 'error']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'settings', 'security']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
import { DATES } from '../constants';
|
||||
|
||||
|
@ -12,7 +11,7 @@ const DATE_WITH_DATA = DATES.metricsAndLogs.hosts.withData;
|
|||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'infraHome', 'security', 'spaceSelector']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'infraHome', 'security', 'spaceSelector']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const appsMenu = getService('appsMenu');
|
||||
const PageObjects = getPageObjects(['common', 'security']);
|
||||
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'error']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'maps', 'security']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const appsMenu = getService('appsMenu');
|
||||
const PageObjects = getPageObjects(['common', 'security']);
|
||||
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'error']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
const find = getService('find');
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function spaceSelectorFunctonalTests({
|
||||
|
@ -12,7 +11,7 @@ export default function spaceSelectorFunctonalTests({
|
|||
getPageObjects,
|
||||
}: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spaces: SpacesService = getService('spaces');
|
||||
const spaces = getService('spaces');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const PageObjects = getPageObjects(['security', 'settings', 'copySavedObjectsToSpace']);
|
||||
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'timelion', 'security', 'spaceSelector']);
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SecurityService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const security: SecurityService = getService('security');
|
||||
const security = getService('security');
|
||||
const PageObjects = getPageObjects(['common', 'error', 'timePicker', 'security']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import expect from '@kbn/expect';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'error', 'timePicker', 'security']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -6,12 +6,11 @@
|
|||
import expect from '@kbn/expect';
|
||||
// eslint-disable-next-line max-len
|
||||
import { VisualizeConstants } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize/visualize_constants';
|
||||
import { SpacesService } from '../../../../common/services';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'security', 'spaceSelector']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const appsMenu = getService('appsMenu');
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import { services as kibanaFunctionalServices } from '../../../../test/functional/services';
|
||||
import { services as kibanaApiIntegrationServices } from '../../../../test/api_integration/services';
|
||||
import { services as commonServices } from '../../common/services';
|
||||
|
||||
import {
|
||||
MonitoringNoDataProvider,
|
||||
|
@ -49,13 +50,13 @@ import { InfraLogStreamProvider } from './infra_log_stream';
|
|||
import { MachineLearningProvider } from './ml';
|
||||
import { TransformProvider } from './transform';
|
||||
|
||||
import { SecurityServiceProvider, SpacesServiceProvider } from '../../common/services';
|
||||
|
||||
// define the name and providers for services that should be
|
||||
// available to your tests. If you don't specify anything here
|
||||
// only the built-in services will be available
|
||||
export const services = {
|
||||
...kibanaFunctionalServices,
|
||||
...commonServices,
|
||||
|
||||
esSupertest: kibanaApiIntegrationServices.esSupertest,
|
||||
monitoringNoData: MonitoringNoDataProvider,
|
||||
monitoringClusterList: MonitoringClusterListProvider,
|
||||
|
@ -83,8 +84,6 @@ export const services = {
|
|||
random: RandomProvider,
|
||||
aceEditor: AceEditorProvider,
|
||||
grokDebugger: GrokDebuggerProvider,
|
||||
security: SecurityServiceProvider,
|
||||
spaces: SpacesServiceProvider,
|
||||
userMenu: UserMenuProvider,
|
||||
uptime: UptimeProvider,
|
||||
infraSourceConfigurationForm: InfraSourceConfigurationFormProvider,
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { services as commonServices } from '../common/services';
|
||||
import { services as apiIntegrationServices } from '../api_integration/services';
|
||||
|
||||
export const services = {
|
||||
...commonServices,
|
||||
legacyEs: apiIntegrationServices.legacyEs,
|
||||
esSupertest: apiIntegrationServices.esSupertest,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { services as commonServices } from '../common/services';
|
||||
import { services as apiIntegrationServices } from '../api_integration/services';
|
||||
|
||||
export const services = {
|
||||
...commonServices,
|
||||
legacyEs: apiIntegrationServices.legacyEs,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
};
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { services as commonServices } from '../common/services';
|
||||
import { services as apiIntegrationServices } from '../api_integration/services';
|
||||
|
||||
export const services = {
|
||||
...commonServices,
|
||||
esSupertest: apiIntegrationServices.esSupertest,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
};
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { services as commonServices } from '../common/services';
|
||||
import { services as apiIntegrationServices } from '../api_integration/services';
|
||||
|
||||
export const services = {
|
||||
...commonServices,
|
||||
randomness: apiIntegrationServices.randomness,
|
||||
legacyEs: apiIntegrationServices.legacyEs,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
// @ts-ignore not ts yet
|
||||
import { LegacyEsProvider } from './legacy_es';
|
||||
|
||||
import { services as commonServices } from '../../../common/services';
|
||||
import { services as apiIntegrationServices } from '../../../api_integration/services';
|
||||
import { services as kibanaApiIntegrationServices } from '../../../../../test/api_integration/services';
|
||||
import { services as kibanaFunctionalServices } from '../../../../../test/functional/services';
|
||||
|
||||
export const services = {
|
||||
...commonServices,
|
||||
legacyEs: LegacyEsProvider,
|
||||
esSupertestWithoutAuth: apiIntegrationServices.esSupertestWithoutAuth,
|
||||
supertest: kibanaApiIntegrationServices.supertest,
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
import { FeaturesProvider } from './features';
|
||||
import { UICapabilitiesProvider } from './ui_capabilities';
|
||||
import { SecurityServiceProvider, SpacesServiceProvider } from '../../../common/services';
|
||||
import { services as commonServices } from '../../../common/services';
|
||||
|
||||
export const services = {
|
||||
security: SecurityServiceProvider,
|
||||
spaces: SpacesServiceProvider,
|
||||
...commonServices,
|
||||
|
||||
uiCapabilities: UICapabilitiesProvider,
|
||||
features: FeaturesProvider,
|
||||
};
|
||||
|
|
|
@ -4,16 +4,14 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SpacesService } from '../../../common/services';
|
||||
import { SecurityService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
import { FeaturesService } from '../../common/services';
|
||||
import { isCustomRoleSpecification } from '../../common/types';
|
||||
import { Spaces, Users } from '../scenarios';
|
||||
|
||||
export default function uiCapabilitiesTests({ loadTestFile, getService }: FtrProviderContext) {
|
||||
const securityService: SecurityService = getService('security');
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const securityService = getService('security');
|
||||
const spacesService = getService('spaces');
|
||||
const featuresService: FeaturesService = getService('features');
|
||||
|
||||
describe('ui capabilities', function() {
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SecurityService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
import { isCustomRoleSpecification } from '../../common/types';
|
||||
import { UserScenarios } from '../scenarios';
|
||||
|
||||
export default function uiCapabilitesTests({ loadTestFile, getService }: FtrProviderContext) {
|
||||
const securityService: SecurityService = getService('security');
|
||||
const securityService = getService('security');
|
||||
|
||||
describe('ui capabilities', function() {
|
||||
this.tags('ciGroup9');
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SpacesService } from '../../../common/services';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
import { FeaturesService } from '../../common/services';
|
||||
import { SpaceScenarios } from '../scenarios';
|
||||
|
||||
export default function uiCapabilitesTests({ loadTestFile, getService }: FtrProviderContext) {
|
||||
const spacesService: SpacesService = getService('spaces');
|
||||
const spacesService = getService('spaces');
|
||||
const featuresService: FeaturesService = getService('features');
|
||||
|
||||
describe('ui capabilities', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue