[7.x] [xpack/ftr/common] follow service provider conventions (… (#52315)

* [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:
Spencer 2019-12-05 11:38:33 -07:00 committed by GitHub
parent 85b2400deb
commit 15a425617b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 157 additions and 180 deletions

View file

@ -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() {

View file

@ -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() {

View file

@ -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());

View file

@ -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 () => {

View file

@ -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', () => {

View file

@ -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) => {

View file

@ -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);

View file

@ -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';

View file

@ -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';

View file

@ -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) => {

View file

@ -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);

View file

@ -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,
};

View 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, {}>;

View file

@ -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,
};

View file

@ -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';

View 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);
})();
}

View 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}`);
}
})();
}

View file

@ -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);
}

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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',

View file

@ -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',

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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']);

View file

@ -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');

View file

@ -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');

View file

@ -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']);

View file

@ -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');

View file

@ -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']);

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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,

View file

@ -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,

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,

View file

@ -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,

View file

@ -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,
};

View file

@ -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() {

View file

@ -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');

View file

@ -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() {