[ska][x-pack] Move canvas, watcher and dev_tools functional tests

This commit is contained in:
Charis Kalpakis 2025-06-27 17:20:22 +03:00 committed by GitHub
parent fefaea74fa
commit c75f67970e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 61 additions and 67 deletions

View file

@ -201,13 +201,13 @@ enabled:
- x-pack/test/functional/apps/advanced_settings/config.ts
- x-pack/test/functional/apps/aiops/config.ts
- x-pack/test/functional/apps/api_keys/config.ts
- x-pack/test/functional/apps/canvas/config.ts
- x-pack/platform/test/functional/apps/canvas/config.ts
- x-pack/test/functional/apps/cross_cluster_replication/config.ts
- x-pack/test/functional/apps/dashboard/group1/config.ts
- x-pack/test/functional/apps/dashboard/group2/config.ts
- x-pack/test/functional/apps/dashboard/group3/config.ts
- x-pack/test/functional/apps/data_views/config.ts
- x-pack/test/functional/apps/dev_tools/config.ts
- x-pack/platform/test/functional/apps/dev_tools/config.ts
- x-pack/test/functional/apps/discover/group1/config.ts
- x-pack/test/functional/apps/discover/group2/config.ts
- x-pack/test/functional/apps/discover/group3/config.ts
@ -266,7 +266,7 @@ enabled:
- x-pack/test/functional/apps/upgrade_assistant/config.ts
- x-pack/test/functional/apps/user_profiles/config.ts
- x-pack/test/functional/apps/visualize/config.ts
- x-pack/test/functional/apps/watcher/config.ts
- x-pack/platform/test/functional/apps/watcher/config.ts
- x-pack/platform/test/functional/config_security_basic.ts
- x-pack/test/functional/config.ccs.ts
- x-pack/test/functional/config.firefox.js

19
.github/CODEOWNERS vendored
View file

@ -1251,7 +1251,7 @@ src/platform/plugins/shared/discover/public/context_awareness/profile_providers/
/src/platform/test/api_integration/fixtures/kbn_archiver/event_annotations/event_annotations.json @elastic/kibana-visualizations
/src/platform/test/functional/apps/getting_started/*.ts @elastic/kibana-visualizations # Assigned per https://github.com/elastic/kibana/pull/199767#discussion_r1840485031
/x-pack/test/upgrade/apps/graph @elastic/kibana-visualizations
/x-pack/test/functional/page_objects/log_wrapper.ts @elastic/kibana-visualizations # Assigned per https://github.com/elastic/kibana/pull/36437
/x-pack/platform/test/functional/page_objects/log_wrapper.ts @elastic/kibana-visualizations # Assigned per https://github.com/elastic/kibana/pull/36437
/x-pack/test/functional/page_objects/graph_page.ts @elastic/kibana-visualizations
/x-pack/test/functional/apps/managed_content @elastic/kibana-visualizations
/src/platform/test/functional/services/visualizations @elastic/kibana-visualizations
@ -1262,7 +1262,7 @@ src/platform/plugins/shared/discover/public/context_awareness/profile_providers/
/src/platform/test/functional/page_objects/timelion_page.ts @elastic/kibana-visualizations
/src/platform/test/functional/page_objects/time_to_visualize_page.ts @elastic/kibana-visualizations
/src/platform/test/functional/page_objects/tag_cloud_page.ts @elastic/kibana-visualizations
/x-pack/test/functional/page_objects/lens_page.ts @elastic/kibana-visualizations
/x-pack/platform/test/functional/page_objects/lens_page.ts @elastic/kibana-visualizations
/x-pack/test/functional/es_archives/lens @elastic/kibana-visualizations
/x-pack/test/examples/embedded_lens @elastic/kibana-visualizations
/x-pack/test/api_integration/fixtures/kbn_archiver/lens/ @elastic/kibana-visualizations
@ -1608,7 +1608,7 @@ src/platform/plugins/shared/discover/public/context_awareness/profile_providers/
/src/platform/test/functional/apps/dashboard/ @elastic/kibana-presentation
/src/platform/test/functional/apps/dashboard_elements/ @elastic/kibana-presentation
/src/platform/test/functional/services/dashboard/ @elastic/kibana-presentation
/x-pack/test/functional/apps/canvas/ @elastic/kibana-presentation
/x-pack/platform/test/functional/apps/canvas/ @elastic/kibana-presentation
/x-pack/test_serverless/functional/test_suites/search/dashboards/ @elastic/kibana-presentation
/src/platform/test/plugin_functional/test_suites/panel_actions @elastic/kibana-presentation
/x-pack/test/functional/es_archives/canvas/logstash_lens @elastic/kibana-presentation
@ -1616,7 +1616,7 @@ src/platform/plugins/shared/discover/public/context_awareness/profile_providers/
/x-pack/test/upgrade/services/maps_upgrade_services.ts @elastic/kibana-presentation
/x-pack/test/stack_functional_integration/apps/maps @elastic/kibana-presentation
/x-pack/test/functional/page_objects/geo_file_upload.ts @elastic/kibana-presentation
/x-pack/test/functional/page_objects/gis_page.ts @elastic/kibana-presentation
/x-pack/platform/test/functional/page_objects/gis_page.ts @elastic/kibana-presentation
/x-pack/test/upgrade/apps/maps @elastic/kibana-presentation
/x-pack/platform/test/api_integration/apis/maps/ @elastic/kibana-presentation
/x-pack/test/functional/apps/maps/ @elastic/kibana-presentation
@ -2175,9 +2175,10 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/test/functional_solution_sidenav/tests/search_sidenav.ts @elastic/search-kibana
/x-pack/test/functional/services/search_sessions.ts @elastic/search-kibana
/x-pack/test/functional/page_objects/search_* @elastic/search-kibana
x-pack/platform/test/functional/page_objects/search_profiler_page.ts @elastic/search-kibana
/x-pack/test/functional/apps/search_playground @elastic/search-kibana
/x-pack/test_serverless/functional/page_objects/svl_ingest_pipelines.ts @elastic/search-kibana
/x-pack/test/functional/apps/dev_tools/embedded_console.ts @elastic/search-kibana
/x-pack/platform/test/functional/apps/dev_tools/embedded_console.ts @elastic/search-kibana
/x-pack/test/functional/apps/ingest_pipelines/feature_controls/ingest_pipelines_security.ts @elastic/search-kibana
/x-pack/test/functional/page_objects/embedded_console.ts @elastic/search-kibana
/x-pack/test/functional_enterprise_search/ @elastic/search-kibana
@ -2206,7 +2207,7 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/test/functional/page_objects/remote_clusters_page.ts @elastic/kibana-management
/x-pack/test/stack_functional_integration/apps/ccs @elastic/kibana-management
/x-pack/test/functional/services/data_stream.ts @elastic/kibana-management
/x-pack/test/functional/page_objects/watcher_page.ts @elastic/kibana-management
/x-pack/platform/test/functional/page_objects/watcher_page.ts @elastic/kibana-management
/x-pack/test/functional/page_objects/upgrade_assistant_page.ts @elastic/kibana-management
/x-pack/test/functional/page_objects/snapshot_restore_page.ts @elastic/kibana-management
/x-pack/test/functional/page_objects/rollup_page.ts @elastic/kibana-management
@ -2228,7 +2229,7 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/test/functional/apps/management @elastic/kibana-management
/x-pack/test/functional/apps/remote_clusters @elastic/kibana-management
/x-pack/test/functional/apps/upgrade_assistant @elastic/kibana-management
/x-pack/test/functional/apps/dev_tools @elastic/kibana-management
/x-pack/platform/test/functional/apps/dev_tools @elastic/kibana-management
/src/platform/test/plugin_functional/test_suites/management @elastic/kibana-management
/x-pack/test/upgrade_assistant_integration @elastic/kibana-management
/src/platform/test/plugin_functional/plugins/management_test_plugin @elastic/kibana-management
@ -2244,12 +2245,12 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/src/platform/test/accessibility/apps/management.ts @elastic/kibana-management
/src/platform/test/accessibility/apps/console.ts @elastic/kibana-management
/x-pack/test/api_integration/services/index_management.ts @elastic/kibana-management
/x-pack/test/functional/services/grok_debugger.js @elastic/kibana-management
/x-pack/platform/test/functional/services/grok_debugger.ts @elastic/kibana-management
/x-pack/test/functional/apps/grok_debugger @elastic/kibana-management
/x-pack/test/functional/apps/index_lifecycle_management @elastic/kibana-management
/x-pack/test/functional/apps/index_management @elastic/kibana-management
/x-pack/test/api_integration/services/ingest_pipelines @elastic/kibana-management
/x-pack/test/functional/apps/watcher @elastic/kibana-management
/x-pack/platform/test/functional/apps/watcher @elastic/kibana-management
/x-pack/platform/test/api_integration/apis/watcher @elastic/kibana-management
/x-pack/platform/test/api_integration/apis/upgrade_assistant @elastic/kibana-management
/x-pack/platform/test/api_integration/apis/searchprofiler @elastic/kibana-management

View file

@ -8,7 +8,7 @@
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../config.base.js'));
const functionalConfig = await readConfigFile(require.resolve('../../config.base.ts'));
return {
...functionalConfig.getAll(),

View file

@ -6,8 +6,9 @@
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export default function canvasSmokeTest({ getService, getPageObjects }) {
export default function canvasSmokeTest({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const retry = getService('retry');

View file

@ -8,7 +8,7 @@
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../config.base.js'));
const functionalConfig = await readConfigFile(require.resolve('../../config.base.ts'));
return {
...functionalConfig.getAll(),

View file

@ -8,7 +8,7 @@
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../config.base.js'));
const functionalConfig = await readConfigFile(require.resolve('../../config.base.ts'));
return {
...functionalConfig.getAll(),

View file

@ -4,8 +4,9 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ loadTestFile }) {
export default function ({ loadTestFile }: FtrProviderContext) {
describe('watcher app', () => {
loadTestFile(require.resolve('./watcher_test'));
});

View file

@ -7,11 +7,12 @@
import expect from '@kbn/expect';
import { keyBy } from 'lodash';
import { FtrProviderContext } from '../../ftr_provider_context';
const watchID = 'watchID';
const watchName = 'watch Name';
const updatedName = 'updatedName';
export default function ({ getService, getPageObjects }) {
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
@ -78,14 +79,14 @@ export default function ({ getService, getPageObjects }) {
expect(errorCalloutText).to.be(`There is already a watch with ID '${watchID}'.`);
});
//delete the watch
// delete the watch
it('should delete the watch', async () => {
// Navigate to the main list page
await PageObjects.common.navigateToApp('watcher');
const watchList = keyBy(await PageObjects.watcher.getWatches(), 'id');
log.debug(watchList);
expect(watchList.watchID.name).to.eql([watchName]);
await PageObjects.watcher.deleteWatch(watchID);
await PageObjects.watcher.deleteWatch();
await testSubjects.click('confirmModalConfirmButton');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {

View file

@ -13,7 +13,12 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...chromeConfig.getAll(),
testFiles: [require.resolve('./apps/security'), require.resolve('./apps/spaces')],
testFiles: [
require.resolve('./apps/canvas'),
require.resolve('./apps/security'),
require.resolve('./apps/spaces'),
require.resolve('./apps/watcher'),
],
browser: {
type: 'firefox',

View file

@ -12,8 +12,12 @@ import { SpaceSelectorPageObject } from './space_selector_page';
import { CopySavedObjectsToSpacePageProvider } from './copy_saved_objects_to_space_page';
import { MonitoringPageObject } from './monitoring_page';
import { AccountSettingsPageObject } from './account_settings_page';
import { ReportingPageObject } from './reporting_page';
import { CanvasPageProvider } from './canvas_page';
import { LensPageProvider } from './lens_page';
import { GisPageObject } from './gis_page';
import { ReportingPageObject } from './reporting_page';
import { WatcherPageObject } from './watcher_page';
import { SearchProfilerPageProvider } from './search_profiler_page';
// just like services, PageObjects are defined as a map of
// names to Providers. Merge in Kibana's or pick specific ones
@ -25,6 +29,10 @@ export const pageObjects = {
copySavedObjectsToSpace: CopySavedObjectsToSpacePageProvider,
monitoring: MonitoringPageObject,
accountSetting: AccountSettingsPageObject,
reporting: ReportingPageObject,
canvas: CanvasPageProvider,
lens: LensPageProvider,
maps: GisPageObject,
reporting: ReportingPageObject,
watcher: WatcherPageObject,
searchProfiler: SearchProfilerPageProvider,
};

View file

@ -6,8 +6,9 @@
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
export function GrokDebuggerProvider({ getService }) {
export function GrokDebuggerProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const monacoEditor = getService('monacoEditor');
@ -15,7 +16,6 @@ export function GrokDebuggerProvider({ getService }) {
// test subject selectors
const SUBJ_CONTAINER = 'grokDebuggerContainer';
const SUBJ_UI_ACE_PATTERN_INPUT = `${SUBJ_CONTAINER} > acePatternInput > codeEditorContainer`;
const SUBJ_BTN_TOGGLE_CUSTOM_PATTERNS_INPUT = `${SUBJ_CONTAINER} > btnToggleCustomPatternsInput`;
const SUBJ_BTN_SIMULATE = `${SUBJ_CONTAINER} > btnSimulate`;
@ -24,11 +24,11 @@ export function GrokDebuggerProvider({ getService }) {
await testSubjects.click(SUBJ_BTN_SIMULATE);
}
async setEventInput(value) {
async setEventInput(value: string) {
await monacoEditor.setCodeEditorValue(value, 0);
}
async setPatternInput(value) {
async setPatternInput(value: string) {
await monacoEditor.setCodeEditorValue(value, 1);
}
@ -36,7 +36,7 @@ export function GrokDebuggerProvider({ getService }) {
await testSubjects.click(SUBJ_BTN_TOGGLE_CUSTOM_PATTERNS_INPUT);
}
async setCustomPatternsInput(value) {
async setCustomPatternsInput(value: string) {
await monacoEditor.setCodeEditorValue(value, 2);
}
@ -50,33 +50,11 @@ export function GrokDebuggerProvider({ getService }) {
});
}
async assertEventOutput(expectedValue) {
async assertEventOutput(expectedValue: string) {
await retry.try(async () => {
const value = JSON.parse(await this.getEventOutput());
expect(value).to.eql(expectedValue);
});
}
async assertPatternInputSyntaxHighlighting(expectedHighlights) {
const patternInputElement = await testSubjects.find(SUBJ_UI_ACE_PATTERN_INPUT);
const highlightedElements = await patternInputElement.findAllByXpath(
'.//div[@class="ace_line"]/*'
);
expect(highlightedElements.length).to.be(expectedHighlights.length);
await Promise.all(
highlightedElements.map(async (element, index) => {
const highlightClass = await element.getAttribute('class');
const highlightedContent = await element.getVisibleText();
const expectedHighlight = expectedHighlights[index];
const expectedHighlightClass = `ace_${expectedHighlight.token}`;
const expectedHighlightedContent = expectedHighlight.content;
expect(highlightClass).to.be(expectedHighlightClass);
expect(highlightedContent).to.be(expectedHighlightedContent);
})
);
}
})();
}

View file

@ -11,6 +11,7 @@ import { services as kibanaXPackApiIntegrationServices } from '../../api_integra
import { UserMenuProvider } from './user_menu';
import { AceEditorProvider } from './ace_editor';
import { SampleDataServiceProvider } from './sample_data';
import { GrokDebuggerProvider } from './grok_debugger';
// define the name and providers for services that should be
// available to your tests. If you don't specify anything here
@ -25,4 +26,5 @@ export const services = {
userMenu: UserMenuProvider,
aceEditor: AceEditorProvider,
sampleData: SampleDataServiceProvider,
grokDebugger: GrokDebuggerProvider,
};

View file

@ -95,6 +95,10 @@
"@kbn/stack-alerts-plugin",
"@kbn/triggers-actions-ui-plugin",
"@kbn/alerts-as-data-utils",
"@kbn/maps-plugin",
"@kbn/lens-plugin",
"@kbn/ftr-common-functional-ui-services",
"@kbn/reporting-common",
"@kbn/cases-plugin",
"@kbn/files-plugin",
"@kbn/shared-ux-file-types",
@ -105,13 +109,11 @@
"@kbn/repo-info",
"@kbn/dev-cli-errors",
"@kbn/journeys",
"@kbn/reporting-common",
"@kbn/discover-plugin",
"@kbn/reporting-export-types-csv-common",
"@kbn/rison",
"@kbn/reporting-export-types-pdf-common",
"@kbn/reporting-export-types-png-common",
"@kbn/reporting-server",
"@kbn/lens-plugin",
]
}

View file

@ -6,8 +6,8 @@
*/
import expect from '@kbn/expect';
import { testEmbeddedConsole } from '@kbn/test-suites-xpack-platform/functional/apps/dev_tools/embedded_console';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { testEmbeddedConsole } from '../../dev_tools/embedded_console';
export default function ({ getPageObjects, getService }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');

View file

@ -16,7 +16,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
...functionalConfig.getAll(),
testFiles: [
require.resolve('./apps/canvas'),
require.resolve('@kbn/test-suites-xpack-platform/functional/apps/canvas'),
require.resolve('./apps/lens/group1'),
require.resolve('./apps/remote_clusters/ccs/remote_clusters_index_management_flow'),
require.resolve('./apps/rollup_job'),

View file

@ -11,11 +11,7 @@ export default async function ({ readConfigFile }) {
return {
...chromeConfig.getAll(),
testFiles: [
require.resolve('./apps/canvas'),
require.resolve('./apps/infra'),
require.resolve('./apps/watcher'),
],
testFiles: [require.resolve('./apps/infra')],
browser: {
type: 'firefox',

View file

@ -12,8 +12,12 @@ import { SecurityPageObject } from '@kbn/test-suites-xpack-platform/functional/p
import { CopySavedObjectsToSpacePageProvider } from '@kbn/test-suites-xpack-platform/functional/page_objects/copy_saved_objects_to_space_page';
import { SpaceSelectorPageObject } from '@kbn/test-suites-xpack-platform/functional/page_objects/space_selector_page';
import { RoleMappingsPageProvider } from '@kbn/test-suites-xpack-platform/functional/page_objects/role_mappings_page';
import { CanvasPageProvider } from '@kbn/test-suites-xpack-platform/functional/page_objects/canvas_page';
import { ReportingPageObject } from '@kbn/test-suites-xpack-platform/functional/page_objects/reporting_page';
import { WatcherPageObject } from '@kbn/test-suites-xpack-platform/functional/page_objects/watcher_page';
import { SearchProfilerPageProvider } from '@kbn/test-suites-xpack-platform/functional/page_objects/search_profiler_page';
import { CanvasPageProvider } from '@kbn/test-suites-xpack-platform/functional/page_objects/canvas_page';
import { GisPageObject } from '@kbn/test-suites-xpack-platform/functional/page_objects/gis_page';
import { LensPageProvider } from '@kbn/test-suites-xpack-platform/functional/page_objects/lens_page';
import { ApiKeysPageProvider } from './api_keys_page';
import { AssetDetailsProvider } from './asset_details';
import { BannersPageObject } from './banners_page';
@ -21,7 +25,6 @@ import { CrossClusterReplicationPageProvider } from './cross_cluster_replication
import { DetectionsPageObject } from '../../security_solution_ftr/page_objects/detections';
import { EmbeddedConsoleProvider } from './embedded_console';
import { GeoFileUploadPageObject } from './geo_file_upload';
import { GisPageObject } from './gis_page';
import { GraphPageObject } from './graph_page';
import { GrokDebuggerPageObject } from './grok_debugger_page';
import { IndexLifecycleManagementPageProvider } from './index_lifecycle_management_page';
@ -32,7 +35,6 @@ import { InfraLogsPageProvider } from './infra_logs_page';
import { InfraMetricsExplorerProvider } from './infra_metrics_explorer';
import { InfraSavedViewsProvider } from './infra_saved_views';
import { IngestPipelinesPageProvider } from './ingest_pipelines_page';
import { LensPageProvider } from './lens_page';
import { LicenseManagementPageProvider } from './license_management_page';
import { LogstashPageObject } from './logstash_page';
import { MaintenanceWindowsPageProvider } from './maintenance_windows_page';
@ -51,8 +53,6 @@ import { TagManagementPageObject } from './tag_management_page';
import { UpgradeAssistantFlyoutObject } from './upgrade_assistant_page';
import { UptimePageObject } from './uptime_page';
import { UserProfilePageProvider } from './user_profile_page';
import { WatcherPageObject } from './watcher_page';
import { SearchProfilerPageProvider } from './search_profiler_page';
import { SearchPlaygroundPageProvider } from './search_playground_page';
import { SearchSynonymsPageProvider } from './search_synonyms_page';
import { SearchClassicNavigationProvider } from './search_classic_navigation';

View file

@ -10,6 +10,7 @@ import { services as kibanaApiIntegrationServices } from '@kbn/test-suites-src/a
import { AceEditorProvider } from '@kbn/test-suites-xpack-platform/functional/services/ace_editor';
import { UserMenuProvider } from '@kbn/test-suites-xpack-platform/functional/services/user_menu';
import { SampleDataServiceProvider } from '@kbn/test-suites-xpack-platform/functional/services/sample_data';
import { GrokDebuggerProvider } from '@kbn/test-suites-xpack-platform/functional/services/grok_debugger';
import { ReportingFunctionalProvider } from '@kbn/test-suites-xpack-platform/reporting_functional/services';
import { services as kibanaXPackApiIntegrationServices } from '../../api_integration/services';
import { services as commonServices } from '../../common/services';
@ -55,7 +56,6 @@ import { RandomProvider } from './random';
// @ts-ignore not ts yet
import { CanvasElementProvider } from './canvas_element';
// @ts-ignore not ts yet
import { GrokDebuggerProvider } from './grok_debugger';
// @ts-ignore not ts yet
import { UptimeProvider } from './uptime';
import { InfraSourceConfigurationFormProvider } from './infra_source_configuration_form';

View file

@ -98,7 +98,6 @@
"@kbn/observability-shared-plugin",
"@kbn/server-route-repository",
"@kbn/core-http-common",
"@kbn/lens-plugin",
"@kbn/logs-shared-plugin",
"@kbn/observability-onboarding-plugin",
"@kbn/uptime-plugin",