Skip to content

Commit

Permalink
FTR: move basic services under common folder (#66563)
Browse files Browse the repository at this point in the history
* [CODEOWNERS] set kibana-qa to own test/functional/services

* [functional/services] move low-level services to common folder

* update codeowners

* update imports

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
dmlemeshko and elasticmachine authored May 15, 2020
1 parent 62e8214 commit f575913
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@

# Quality Assurance
/src/dev/code_coverage @elastic/kibana-qa
/test/functional/services/common @elastic/kibana-qa
/test/functional/services/lib @elastic/kibana-qa
/test/functional/services/remote @elastic/kibana-qa

# Platform
/src/core/ @elastic/kibana-platform
Expand Down
4 changes: 2 additions & 2 deletions test/common/services/security/test_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import { Role } from './role';
import { User } from './user';
import { FtrProviderContext } from '../../ftr_provider_context';
import { Browser } from '../../../functional/services/browser';
import { TestSubjects } from '../../../functional/services/test_subjects';
import { Browser } from '../../../functional/services/common';
import { TestSubjects } from '../../../functional/services/common';

export async function createTestUserService(
role: Role,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import { LegacyActionSequence } from 'selenium-webdriver/lib/actions';
import { ProvidedType } from '@kbn/test/types/ftr';

import Jimp from 'jimp';
import { modifyUrl } from '../../../src/core/utils';
import { WebElementWrapper } from './lib/web_element_wrapper';
import { FtrProviderContext } from '../ftr_provider_context';
import { Browsers } from './remote/browsers';
import { modifyUrl } from '../../../../src/core/utils';
import { WebElementWrapper } from '../lib/web_element_wrapper';
import { FtrProviderContext } from '../../ftr_provider_context';
import { Browsers } from '../remote/browsers';

export type Browser = ProvidedType<typeof BrowserProvider>;
export async function BrowserProvider({ getService }: FtrProviderContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { writeFile, mkdir } from 'fs';
import { promisify } from 'util';

import del from 'del';
import { FtrProviderContext } from '../ftr_provider_context';
import { FtrProviderContext } from '../../ftr_provider_context';

interface Test {
fullTitle(): string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

import { WebDriver, WebElement, By, until } from 'selenium-webdriver';
import { FtrProviderContext } from '../ftr_provider_context';
import { WebElementWrapper } from './lib/web_element_wrapper';
import { FtrProviderContext } from '../../ftr_provider_context';
import { WebElementWrapper } from '../lib/web_element_wrapper';

export async function FindProvider({ getService }: FtrProviderContext) {
const log = getService('log');
Expand Down
25 changes: 25 additions & 0 deletions test/functional/services/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export { BrowserProvider, Browser } from './browser';
export { FailureDebuggingProvider } from './failure_debugging';
export { FindProvider } from './find';
export { ScreenshotsProvider } from './screenshots';
export { SnapshotsProvider } from './snapshots';
export { TestSubjectsProvider, TestSubjects } from './test_subjects';
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { promisify } from 'util';

import del from 'del';

import { comparePngs } from './lib/compare_pngs';
import { FtrProviderContext } from '../ftr_provider_context';
import { WebElementWrapper } from './lib/web_element_wrapper';
import { comparePngs } from '../lib/compare_pngs';
import { FtrProviderContext } from '../../ftr_provider_context';
import { WebElementWrapper } from '../lib/web_element_wrapper';

const mkdirAsync = promisify(mkdir);
const writeFileAsync = promisify(writeFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { promisify } from 'util';

import expect from '@kbn/expect';
import del from 'del';
import { FtrProviderContext } from '../ftr_provider_context';
import { FtrProviderContext } from '../../ftr_provider_context';

const mkdirAsync = promisify(mkdir);
const writeFileAsync = promisify(writeFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import testSubjSelector from '@kbn/test-subj-selector';
import { map as mapAsync } from 'bluebird';
import { ProvidedType } from '@kbn/test/types/ftr';
import { WebElementWrapper } from './lib/web_element_wrapper';
import { FtrProviderContext } from '../ftr_provider_context';
import { WebElementWrapper } from '../lib/web_element_wrapper';
import { FtrProviderContext } from '../../ftr_provider_context';

interface ExistsOptions {
timeout?: number;
Expand Down
14 changes: 8 additions & 6 deletions test/functional/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
import { services as commonServiceProviders } from '../../common/services';

import { AppsMenuProvider } from './apps_menu';
import { BrowserProvider } from './browser';
import {
BrowserProvider,
FailureDebuggingProvider,
FindProvider,
ScreenshotsProvider,
SnapshotsProvider,
TestSubjectsProvider,
} from './common';
import { ComboBoxProvider } from './combo_box';
import {
DashboardAddPanelProvider,
Expand All @@ -33,19 +40,14 @@ import {
import { DocTableProvider } from './doc_table';
import { ElasticChartProvider } from './elastic_chart';
import { EmbeddingProvider } from './embedding';
import { FailureDebuggingProvider } from './failure_debugging';
import { FilterBarProvider } from './filter_bar';
import { FindProvider } from './find';
import { FlyoutProvider } from './flyout';
import { GlobalNavProvider } from './global_nav';
import { InspectorProvider } from './inspector';
import { QueryBarProvider } from './query_bar';
import { RemoteProvider } from './remote';
import { RenderableProvider } from './renderable';
import { ScreenshotsProvider } from './screenshots';
import { SnapshotsProvider } from './snapshots';
import { TableProvider } from './table';
import { TestSubjectsProvider } from './test_subjects';
import { ToastsProvider } from './toasts';
// @ts-ignore not TS yet
import { PieChartProvider } from './visualizations';
Expand Down

0 comments on commit f575913

Please sign in to comment.