Skip to content

Commit

Permalink
[FTR] Mv test subjs svc to shared location (elastic#174048)
Browse files Browse the repository at this point in the history
## Summary

Refactoring general ui service to a kbn package.

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
wayneseymour and kibanamachine authored Jan 9, 2024
1 parent 8186fc7 commit 46707e4
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,7 @@
"sass-embedded": "^1.69.5",
"sass-loader": "^10.5.1",
"selenium-webdriver": "^4.16.0",
"sharp": "0.32.6",
"simple-git": "^3.16.0",
"sinon": "^7.4.2",
"sort-package-json": "^1.53.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export type {
CustomCheerioStatic,
} from './services/web_element_wrapper/custom_cheerio_api';
export { Browsers } from './services/remote/browsers';
export { type Browser } from './services/browser';
export {
NETWORK_PROFILES,
type NetworkOptions,
type NetworkProfile,
} from './services/remote/network_profiles';
export type { TimeoutOpt } from './types';
export { TestSubjects } from './services/test_subjects';
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
import { RetryOnStaleProvider } from './retry_on_stale';
import { RemoteProvider } from './remote';
import { FindProvider } from './find';
import { TestSubjects } from './test_subjects';
import { BrowserProvider } from './browser';

export const services = {
retryOnStale: RetryOnStaleProvider,
__webdriver__: RemoteProvider,
find: FindProvider,
testSubjects: TestSubjects,
browser: BrowserProvider,
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {
NETWORK_PROFILES,
type NetworkOptions,
type NetworkProfile,
} from '@kbn/ftr-common-functional-ui-services';
import { FtrService, type FtrProviderContext } from '../../ftr_provider_context';
} from '..';
import { FtrService, type FtrProviderContext } from './ftr_provider_context';

export type Browser = BrowserService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ const services = {
retry: RetryService,
};

type Services = typeof services;

export type FtrProviderContext = GenericFtrProviderContext<Services, {}>;
export type FtrProviderContext = GenericFtrProviderContext<typeof services, {}>;
export class FtrService extends GenericFtrService<FtrProviderContext> {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*/

import { subj as testSubjSelector } from '@kbn/test-subj-selector';
import { WebElementWrapper, type TimeoutOpt } from '@kbn/ftr-common-functional-ui-services';
import { FtrService } from '../../ftr_provider_context';
import { WebElementWrapper } from './web_element_wrapper';
import type { TimeoutOpt } from '../types';
import { FtrService } from './ftr_provider_context';

interface ExistsOptions {
timeout?: number;
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-ftr-common-functional-ui-services/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@kbn/tooling-log",
"@kbn/repo-info",
"@kbn/test-subj-selector",
"@kbn/ftr-common-functional-services"
"@kbn/ftr-common-functional-services",
"@kbn/std"
]
}
3 changes: 1 addition & 2 deletions test/common/services/security/test_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
import { format as formatUrl } from 'url';
import supertest from 'supertest';

import { type Browser, TestSubjects } from '@kbn/ftr-common-functional-ui-services';
import { Role } from './role';
import { User } from './user';
import { FtrService, FtrProviderContext } from '../../ftr_provider_context';
import { Browser } from '../../../functional/services/common';
import { TestSubjects } from '../../../functional/services/common';

const TEST_USER_NAME = 'test_user';
const TEST_USER_PASSWORD = 'changeme';
Expand Down
3 changes: 0 additions & 3 deletions test/functional/services/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
* Side Public License, v 1.
*/

export type { Browser } from './browser';
export { BrowserProvider } from './browser';
export { FailureDebuggingProvider } from './failure_debugging';
export { PngService } from './png';
export { ScreenshotsService } from './screenshots';
export { SnapshotsService } from './snapshots';
export { TestSubjects } from './test_subjects';
4 changes: 0 additions & 4 deletions test/functional/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import { services as commonServiceProviders } from '../../common/services';

import { AppsMenuService } from './apps_menu';
import {
BrowserProvider,
FailureDebuggingProvider,
PngService,
ScreenshotsService,
SnapshotsService,
TestSubjects,
} from './common';
import { ComboBoxService } from './combo_box';
import {
Expand Down Expand Up @@ -61,7 +59,6 @@ export const services = {
...commonFunctionalUIServices,
filterBar: FilterBarService,
queryBar: QueryBarService,
testSubjects: TestSubjects,
docTable: DocTableService,
png: PngService,
screenshots: ScreenshotsService,
Expand All @@ -83,7 +80,6 @@ export const services = {
dataGrid: DataGridService,
embedding: EmbeddingService,
renderable: RenderableService,
browser: BrowserProvider,
pieChart: PieChartService,
inspector: InspectorService,
fieldEditor: FieldEditorService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { Browser } from '../../../../../../../test/functional/services/common/browser';
import type { Browser } from '@kbn/ftr-common-functional-ui-services';
import { CommonPageObject } from '../../../../../../../test/functional/page_objects/common_page';

type PerformanceResourceTimingWithHttpStatus = PerformanceResourceTiming & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import expect from '@kbn/expect';
import type { Browser } from '@kbn/ftr-common-functional-ui-services';
import { AppSearchService, IEngine } from '../../../../services/app_search_service';
import { Browser } from '../../../../../../../test/functional/services/common';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function enterpriseSearchSetupEnginesTests({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services';
import { TestSubjects } from '@kbn/ftr-common-functional-ui-services';
import { FtrProviderContext } from '../ftr_provider_context';
import { TestSubjects } from '../../../../test/functional/services/common';

export function AppSearchPageProvider({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common']);
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4993,7 +4993,8 @@
uid ""

"@kbn/lens-inline-editing-example-plugin@link:x-pack/examples/lens_embeddable_inline_editing_example":

version "0.0.0"
uid ""

"@kbn/lens-plugin@link:x-pack/plugins/lens":
version "0.0.0"
Expand Down Expand Up @@ -27629,7 +27630,7 @@ [email protected]:
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"

sharp@^0.32.6:
sharp@0.32.6, sharp@^0.32.6:
version "0.32.6"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.32.6.tgz#6ad30c0b7cd910df65d5f355f774aa4fce45732a"
integrity sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==
Expand Down

0 comments on commit 46707e4

Please sign in to comment.