Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ enabled:
- x-pack/platform/test/functional_cloud/intercepts.config.ts
- x-pack/platform/test/licensing_plugin/config.public.ts
- x-pack/platform/test/licensing_plugin/config.ts
- x-pack/platform/test/plugin_functional/config.ts
- x-pack/platform/test/product_intercepts_functional/config.ts
- x-pack/platform/test/reporting_api_integration/reporting_and_security.config.ts
- x-pack/platform/test/reporting_api_integration/reporting_without_security.config.ts
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scout_ci_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugins:
- transform
- dashboard
- workflows_extensions
- global_search
disabled:

packages:
Expand Down
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,6 @@ x-pack/platform/test/plugin_api_integration/plugins/event_log @elastic/response-
x-pack/platform/test/plugin_api_integration/plugins/feature_usage_test @elastic/kibana-security
x-pack/platform/test/plugin_api_integration/plugins/sample_task_plugin @elastic/response-ops
x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance @elastic/response-ops
x-pack/platform/test/plugin_functional/plugins/global_search_test @elastic/kibana-core
x-pack/platform/test/reporting_api_integration/plugins/reporting_fixture @elastic/response-ops
x-pack/platform/test/reporting_api_integration/plugins/reporting_test_routes @elastic/response-ops
x-pack/platform/test/saved_object_api_integration/common/plugins/saved_object_test_plugin @elastic/kibana-security
Expand Down Expand Up @@ -3179,7 +3178,6 @@ x-pack/solutions/observability/plugins/observability_shared/public/components/pr
/src/platform/test/accessibility/apps/home.ts @elastic/appex-sharedux # Assigned per https://github.com/elastic/kibana/pull/199771/files#r1840077237
/src/platform/test/api_integration/apis/home/*.ts @elastic/appex-sharedux # Assigned per https://github.com/elastic/kibana/pull/199771/files#r1840077065
/src/platform/test/functional/apps/home @elastic/appex-sharedux # Assigned per https://github.com/elastic/kibana/pull/199771/files#r1840075278
/x-pack/platform/test/plugin_functional/plugins/global_search_test @elastic/appex-sharedux
/src/platform/test/functional/services/saved_objects_finder.ts @elastic/appex-sharedux
/src/platform/test/functional/apps/kibana_overview @elastic/appex-sharedux
/x-pack/platform/test/functional_cloud @elastic/appex-sharedux
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@
"@kbn/global-search-bar-plugin": "link:x-pack/platform/plugins/private/global_search_bar",
"@kbn/global-search-plugin": "link:x-pack/platform/plugins/shared/global_search",
"@kbn/global-search-providers-plugin": "link:x-pack/platform/plugins/private/global_search_providers",
"@kbn/global-search-test-plugin": "link:x-pack/platform/test/plugin_functional/plugins/global_search_test",
"@kbn/graph-plugin": "link:x-pack/platform/plugins/private/graph",
"@kbn/grid-example-plugin": "link:examples/grid_example",
"@kbn/grid-layout": "link:src/platform/packages/private/kbn-grid-layout",
Expand Down
4 changes: 0 additions & 4 deletions packages/kbn-plugin-generator/src/ask_questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ export const INTERNAL_PLUGIN_LOCATIONS: Array<{ name: string; value: string }> =
name: `X-Pack ${solution}`,
value: Path.resolve(REPO_ROOT, `x-pack/solutions/${solution}/plugins`),
})),
{
name: 'X-Pack Functional Testing',
value: Path.resolve(REPO_ROOT, 'x-pack/platform/test/plugin_functional/plugins'),
},
];

export const QUESTIONS = [
Expand Down
2 changes: 0 additions & 2 deletions src/dev/code_coverage/docs/team_assignment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ _notice the coverage delimiter `#CC# ...`_

```
/x-pack/solutions/security/test/fixtures/es_archives/endpoint/ @elastic/endpoint-app-team @elastic/siem
/x-pack/platform/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team @elastic/siem
/x-pack/platform/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem
#CC# /x-pack/legacy/plugins/siem/ @elastic/siem
#CC# /x-pack/plugins/siem/ @elastic/siem
#CC# /x-pack/solutions/security/plugins/security_solution/ @elastic/siem
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,6 @@
"@kbn/global-search-plugin/*": ["x-pack/platform/plugins/shared/global_search/*"],
"@kbn/global-search-providers-plugin": ["x-pack/platform/plugins/private/global_search_providers"],
"@kbn/global-search-providers-plugin/*": ["x-pack/platform/plugins/private/global_search_providers/*"],
"@kbn/global-search-test-plugin": ["x-pack/platform/test/plugin_functional/plugins/global_search_test"],
"@kbn/global-search-test-plugin/*": ["x-pack/platform/test/plugin_functional/plugins/global_search_test/*"],
"@kbn/graph-plugin": ["x-pack/platform/plugins/private/graph"],
"@kbn/graph-plugin/*": ["x-pack/platform/plugins/private/graph/*"],
"@kbn/grid-example-plugin": ["examples/grid_example"],
Expand Down
2 changes: 2 additions & 0 deletions x-pack/platform/plugins/shared/global_search/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependsOn:
- '@kbn/utility-types'
- '@kbn/core-test-helpers-test-utils'
- '@kbn/licensing-types'
- '@kbn/scout'
tags:
- plugin
- prod
Expand All @@ -37,6 +38,7 @@ fileGroups:
- public/**/*
- server/**/*
- common/**/*
- test/**/*
- '!target/**/*'
tasks:
jest:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const KBN_ARCHIVES = {
BASIC:
'x-pack/platform/plugins/shared/global_search/test/scout/ui/fixtures/kbn_archives/basic.json',
SEARCH_SYNTAX:
'x-pack/platform/plugins/shared/global_search/test/scout/ui/fixtures/kbn_archives/search_syntax.json',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { ScoutPage, ScoutTestFixtures, ScoutWorkerFixtures } from '@kbn/scout';
import { test as baseTest } from '@kbn/scout';
import type { GlobalSearchPageObjects } from './page_objects';
import { extendPageObjects } from './page_objects';

export interface GlobalSearchTestFixtures extends ScoutTestFixtures {
pageObjects: GlobalSearchPageObjects;
}

export const test = baseTest.extend<GlobalSearchTestFixtures, ScoutWorkerFixtures>({
pageObjects: async (
{
pageObjects,
page,
}: {
pageObjects: GlobalSearchPageObjects;
page: ScoutPage;
},
use: (pageObjects: GlobalSearchPageObjects) => Promise<void>
) => {
const extendedPageObjects = extendPageObjects(pageObjects, page);
await use(extendedPageObjects);
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { expect } from '@kbn/scout/ui';
import type { ScoutPage } from '@kbn/scout';

interface SearchResult {
label: string;
}

export class GlobalSearch {
constructor(private readonly page: ScoutPage) {}

async navigateToHome() {
await this.page.gotoApp('home');
}

async focus() {
await this.page.testSubj.click('nav-search-input');
}

async blur() {
// Click help menu button twice to close the search popover
await this.page.testSubj.click('helpMenuButton');
await this.page.testSubj.click('helpMenuButton');
await this.page.locator('.navSearch__panel').waitFor({ state: 'hidden', timeout: 5000 });
}

async searchFor(
term: string,
{ clear = true, wait = true }: { clear?: boolean; wait?: boolean } = {}
) {
if (clear) {
await this.clearField();
}
await this.page.testSubj.fill('nav-search-input', term);
if (wait) {
await this.waitForResultsLoaded();
}
}

async getFieldValue() {
return await this.page.testSubj.locator('nav-search-input').inputValue();
}

async clearField() {
await this.page.testSubj.locator('nav-search-input').clear();
}

async isPopoverDisplayed() {
return await this.page.locator('.navSearch__panel').isVisible();
}

async clickOnOption(index: number) {
const options = await this.page.testSubj.locator('nav-search-option').all();
await options[index].click();
}

async waitForResultsLoaded() {
// Wait for at least one option to appear
await this.page.testSubj.waitForSelector('nav-search-option');

// Results are emitted in multiple batches. Poll the result count to ensure
// all batches have been received (count stabilizes when no more results are coming).
await expect(async () => {
const count = await this.page.testSubj.locator('nav-search-option').count();
expect(count).toBeGreaterThan(0);
}).toPass({ timeout: 10000, intervals: [500, 1000] });
}

async getDisplayedResults(): Promise<SearchResult[]> {
const resultElements = await this.page.testSubj.locator('nav-search-option').all();
const results: SearchResult[] = [];

for (const resultEl of resultElements) {
const labelEl = resultEl.locator('.euiSelectableTemplateSitewide__listItemTitle');
const label = await labelEl.textContent();
if (label) {
results.push({ label: label.trim() });
}
}

return results;
}

async isNoResultsPlaceholderDisplayed() {
await this.page.getByRole('status').getByTestId('nav-search-no-results').waitFor({
state: 'visible',
timeout: 5000,
});
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { PageObjects, ScoutPage } from '@kbn/scout';
import { createLazyPageObject } from '@kbn/scout';
import { GlobalSearch } from './global_search';

export interface GlobalSearchPageObjects extends PageObjects {
globalSearch: GlobalSearch;
}

export function extendPageObjects(
pageObjects: PageObjects,
page: ScoutPage
): GlobalSearchPageObjects {
return {
...pageObjects,
globalSearch: createLazyPageObject(GlobalSearch, page),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
* 2.0.
*/

export { pageObjects } from '../functional/page_objects';
import { createPlaywrightConfig } from '@kbn/scout';

export default createPlaywrightConfig({
testDir: './tests',
});
Loading
Loading