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 .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,6 @@ x-pack/solutions/observability/plugins/observability/server/lib/esql_extensions
/x-pack/platform/test/fixtures/es_archives/dashboard/async_search @elastic/kibana-presentation
^/src/platform/test/functional/fixtures/kbn_archiver/dashboard @elastic/kibana-presentation
^/src/platform/test/functional/fixtures/kbn_archiver/canvas @elastic/kibana-presentation
^/src/platform/test/api_integration/apis/dashboards @elastic/kibana-presentation
^/src/platform/test/interpreter_functional/snapshots @elastic/kibana-presentation # Assigned per https://github.com/elastic/kibana/pull/54342
^/src/platform/test/functional/services/inspector.ts @elastic/kibana-presentation
/x-pack/platform/test/functional/services/canvas_element.ts @elastic/kibana-presentation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { servers as defaultConfig } from '../../../default/serverless/es.serverless.config';
import type { ScoutServerConfig } from '../../../../../types';

/**
* Custom Scout server configuration for OAS (OpenAPI Specification) schema validation tests.
* Enables the OAS endpoint which is required for schema validation.
*
* This config is automatically used when running tests from:
* dashboard/test/scout_oas_schema/
*
* Usage:
* node scripts/scout.js start-server --serverless=es --config-dir oas_schema
*/
export const servers: ScoutServerConfig = {
...defaultConfig,
kbnTestServer: {
...defaultConfig.kbnTestServer,
serverArgs: [
...defaultConfig.kbnTestServer.serverArgs,
// Enable OpenAPI specification endpoint for schema validation tests
'--server.oas.enabled=true',
],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { servers as defaultConfig } from '../../../default/serverless/oblt.serverless.config';
import type { ScoutServerConfig } from '../../../../../types';

/**
* Custom Scout server configuration for OAS (OpenAPI Specification) schema validation tests.
* Enables the OAS endpoint which is required for schema validation.
*
* This config is automatically used when running tests from:
* dashboard/test/scout_oas_schema/
*
* Usage:
* node scripts/scout.js start-server --serverless=oblt --config-dir oas_schema
*/
export const servers: ScoutServerConfig = {
...defaultConfig,
kbnTestServer: {
...defaultConfig.kbnTestServer,
serverArgs: [
...defaultConfig.kbnTestServer.serverArgs,
// Enable OpenAPI specification endpoint for schema validation tests
'--server.oas.enabled=true',
],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { servers as defaultConfig } from '../../../default/serverless/security.serverless.config';
import type { ScoutServerConfig } from '../../../../../types';

/**
* Custom Scout server configuration for OAS (OpenAPI Specification) schema validation tests.
* Enables the OAS endpoint which is required for schema validation.
*
* This config is automatically used when running tests from:
* dashboard/test/scout_oas_schema/
*
* Usage:
* node scripts/scout.js start-server --serverless=security --config-dir oas_schema
*/
export const servers: ScoutServerConfig = {
...defaultConfig,
kbnTestServer: {
...defaultConfig.kbnTestServer,
serverArgs: [
...defaultConfig.kbnTestServer.serverArgs,
// Enable OpenAPI specification endpoint for schema validation tests
'--server.oas.enabled=true',
],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import type { ScoutServerConfig } from '../../../../../types';
import { defaultConfig } from '../../../default/stateful/base.config';

/**
* Custom Scout server configuration for OAS (OpenAPI Specification) schema validation tests.
* Enables the OAS endpoint which is required for schema validation.
*
* This config is automatically used when running tests from:
* dashboard/test/scout_oas_schema/
*
* Usage:
* node scripts/scout.js start-server --stateful --config-dir oas_schema
*/
export const servers: ScoutServerConfig = {
...defaultConfig,
kbnTestServer: {
...defaultConfig.kbnTestServer,
serverArgs: [
...defaultConfig.kbnTestServer.serverArgs,
// Enable OpenAPI specification endpoint for schema validation tests
'--server.oas.enabled=true',
],
},
};
2 changes: 2 additions & 0 deletions src/platform/plugins/shared/dashboard/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ fileGroups:
- public/**/*
- server/**/*
- test/scout/**/*
- test/scout_oas_schema/**/*
- test/scout_oas_schema/**/*.json
- '!target/**/*'
tasks:
jest:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

/** The base API path for dashboard endpoints (no leading slash for apiClient). */
export const DASHBOARD_API_PATH = 'api/dashboards/dashboard';

/** Common headers for Dashboard API requests (internal API version 1) */
export const COMMON_HEADERS = {
'kbn-xsrf': 'some-xsrf-token',
'x-elastic-internal-origin': 'kibana',
'elastic-api-version': '1',
} as const;

/** Test data paths */
export const KBN_ARCHIVES = {
BASIC: 'src/platform/test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json',
TAGS: 'src/platform/test/api_integration/fixtures/kbn_archiver/saved_objects/tags.json',
MANY_DASHBOARDS:
'src/platform/test/api_integration/fixtures/kbn_archiver/saved_objects/many-dashboards.json',
} as const;

/** Test dashboard ID used in fixtures - is a saved object loaded by the kbn_archiver */
export const TEST_DASHBOARD_ID = 'be3733a0-9efe-11e7-acb3-3dab96693fab';
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { FtrProviderContext } from '../../ftr_provider_context';
import type { ScoutTestFixtures, ScoutWorkerFixtures } from '@kbn/scout';
import { apiTest as baseApiTest } from '@kbn/scout';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('dashboards', () => {
loadTestFile(require.resolve('./create_dashboard'));
loadTestFile(require.resolve('./delete_dashboard'));
loadTestFile(require.resolve('./get_dashboard'));
loadTestFile(require.resolve('./update_dashboard'));
loadTestFile(require.resolve('./list_dashboards'));
});
}
export const apiTest = baseApiTest.extend<ScoutTestFixtures, ScoutWorkerFixtures>({});

export { COMMON_HEADERS, DASHBOARD_API_PATH, KBN_ARCHIVES, TEST_DASHBOARD_ID } from './constants';
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { createPlaywrightConfig } from '@kbn/scout';

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