[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout#251163
Conversation
…n't exist in serverless
The OAS endpoint (/api/oas) is only enabled in stateful config (server.oas.enabled=true), not serverless. Test returns 404 on serverless deployments.
| // Enable OpenAPI specification endpoint for schema validation tests | ||
| '--server.oas.enabled=true', |
There was a problem hiding this comment.
We need to check if the tests are working against ECH, and if not - move this argument to custom servers config and run only in local CI env. @steliosmavro could you create 9.4-snapshot deployment and run the new tests?
| expect(response).toHaveStatusCode(400); | ||
| expect(response.body.statusCode).toBe(400); |
There was a problem hiding this comment.
isn't it a duplicated check?
There was a problem hiding this comment.
I tried keeping it the same as it was to be secure, but I think you are right - we shouldn't check body.statusCode again if we've already checked response.
Unless @elastic/kibana-presentation has a good reason for this, I’ll proceed updating this and the other occurrences of the same pattern. 👍
| expect(response).toHaveStatusCode(400); | ||
| expect(response.body.statusCode).toBe(400); |
There was a problem hiding this comment.
isn't it a duplicated check?
| expect(response).toHaveStatusCode(404); | ||
| expect(response.body).toStrictEqual({ | ||
| statusCode: 404, | ||
| error: 'Not Found', | ||
| message: 'A dashboard with ID non-existent-dashboard was not found.', |
There was a problem hiding this comment.
I think we can drop one of status code checks?
| expect(response.body.dashboards[0].id).toBe('test-dashboard-00'); | ||
| expect(response.body.dashboards).toHaveLength(20); |
There was a problem hiding this comment.
we probably want to change order of check to validate dashboards .length before unwrapping the first item
There was a problem hiding this comment.
Nice catch, I'll update accordingly!
| expect(response).toHaveStatusCode(404); | ||
| expect(response.body).toStrictEqual({ | ||
| statusCode: 404, |
There was a problem hiding this comment.
identical check, one to drop?
| expect(response).toHaveStatusCode(400); | ||
| expect(response.body.statusCode).toBe(400); |
| expect(response).toHaveStatusCode(400); | ||
| expect(response.body.statusCode).toBe(400); |
| apiTest.beforeAll(async ({ kbnClient, requestAuth }) => { | ||
| viewerCredentials = await requestAuth.getApiKey('viewer'); | ||
| await kbnClient.importExport.load(KBN_ARCHIVES.BASIC); | ||
| await kbnClient.importExport.load(KBN_ARCHIVES.TAGS); | ||
| }); | ||
|
|
||
| apiTest.afterAll(async ({ kbnClient }) => { | ||
| await kbnClient.savedObjects.cleanStandardList(); | ||
| }); |
There was a problem hiding this comment.
I don't think ingesting the Kibana archives is useful for the purposes of this test, is it?
We can remove kbnClient.importExport.load and kbnClient.savedObjects.cleanStandardList() calls (as there will be nothing to clean up):
| apiTest.beforeAll(async ({ kbnClient, requestAuth }) => { | |
| viewerCredentials = await requestAuth.getApiKey('viewer'); | |
| await kbnClient.importExport.load(KBN_ARCHIVES.BASIC); | |
| await kbnClient.importExport.load(KBN_ARCHIVES.TAGS); | |
| }); | |
| apiTest.afterAll(async ({ kbnClient }) => { | |
| await kbnClient.savedObjects.cleanStandardList(); | |
| }); | |
| apiTest.beforeAll(async ({ kbnClient, requestAuth }) => { | |
| viewerCredentials = await requestAuth.getApiKey('viewer'); | |
| }); |
ThomThomson
left a comment
There was a problem hiding this comment.
Changes LGTM! Seems like a direct port mostly. Looked through the code and made sure all the tests made it through the conversion. Thank you for tackling this!
|
Starting backport for target branches: 8.19, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/21783970327 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…o Scout (elastic#251163) ## Summary Migrates the Dashboard plugin's CRUD API integration tests from FTR to the Scout framework. All 19 test cases have been successfully migrated with full coverage parity, using least-privileged roles (`viewer` for read operations, `editor` for write operations) and the new `expect` import from `@kbn/scout/api`. - Migrated tests for: create, get, update, delete, and search dashboard endpoints - Added OAS schema validation test (enabled `server.oas.enabled=true` in Scout base config) - Used appropriate roles: `viewer` for GET/search tests, `editor` for POST/PUT/DELETE tests - Organized test fixtures in dedicated `fixtures/` directory with shared constants and archives - Removed FTR tests from `src/platform/test/api_integration/apis/dashboards/` - Added `dashboard` to `.buildkite/scout_ci_config.yml` - Updated `.github/CODEOWNERS` to remove old FTR test path - All 19 tests passing with ESLint and TypeScript checks clean --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 17fdeed) # Conflicts: # .buildkite/scout_ci_config.yml # src/platform/plugins/shared/dashboard/moon.yml # src/platform/plugins/shared/dashboard/tsconfig.json
…o Scout (elastic#251163) ## Summary Migrates the Dashboard plugin's CRUD API integration tests from FTR to the Scout framework. All 19 test cases have been successfully migrated with full coverage parity, using least-privileged roles (`viewer` for read operations, `editor` for write operations) and the new `expect` import from `@kbn/scout/api`. - Migrated tests for: create, get, update, delete, and search dashboard endpoints - Added OAS schema validation test (enabled `server.oas.enabled=true` in Scout base config) - Used appropriate roles: `viewer` for GET/search tests, `editor` for POST/PUT/DELETE tests - Organized test fixtures in dedicated `fixtures/` directory with shared constants and archives - Removed FTR tests from `src/platform/test/api_integration/apis/dashboards/` - Added `dashboard` to `.buildkite/scout_ci_config.yml` - Updated `.github/CODEOWNERS` to remove old FTR test path - All 19 tests passing with ESLint and TypeScript checks clean --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 17fdeed) # Conflicts: # .buildkite/scout_ci_config.yml # src/platform/plugins/shared/dashboard/moon.yml # src/platform/plugins/shared/dashboard/test/scout/api/fixtures/index.ts # src/platform/plugins/shared/dashboard/test/scout_oas_schema/api/fixtures/schema_snapshot.json # src/platform/plugins/shared/dashboard/tsconfig.json # src/platform/test/api_integration/apis/dashboards/create_dashboard/index.ts # src/platform/test/api_integration/apis/dashboards/create_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/create_dashboard/validation.ts # src/platform/test/api_integration/apis/dashboards/delete_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/get_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/list_dashboards/index.ts # src/platform/test/api_integration/apis/dashboards/list_dashboards/main.ts # src/platform/test/api_integration/apis/dashboards/update_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/update_dashboard/validation.ts
…o Scout (elastic#251163) ## Summary Migrates the Dashboard plugin's CRUD API integration tests from FTR to the Scout framework. All 19 test cases have been successfully migrated with full coverage parity, using least-privileged roles (`viewer` for read operations, `editor` for write operations) and the new `expect` import from `@kbn/scout/api`. - Migrated tests for: create, get, update, delete, and search dashboard endpoints - Added OAS schema validation test (enabled `server.oas.enabled=true` in Scout base config) - Used appropriate roles: `viewer` for GET/search tests, `editor` for POST/PUT/DELETE tests - Organized test fixtures in dedicated `fixtures/` directory with shared constants and archives - Removed FTR tests from `src/platform/test/api_integration/apis/dashboards/` - Added `dashboard` to `.buildkite/scout_ci_config.yml` - Updated `.github/CODEOWNERS` to remove old FTR test path - All 19 tests passing with ESLint and TypeScript checks clean --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 17fdeed) # Conflicts: # .buildkite/scout_ci_config.yml # .github/CODEOWNERS # src/platform/plugins/shared/dashboard/moon.yml # src/platform/plugins/shared/dashboard/test/scout/api/fixtures/index.ts # src/platform/plugins/shared/dashboard/test/scout_oas_schema/api/fixtures/schema_snapshot.json # src/platform/plugins/shared/dashboard/tsconfig.json # src/platform/test/api_integration/apis/dashboards/create_dashboard/index.ts # src/platform/test/api_integration/apis/dashboards/create_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/create_dashboard/validation.ts # src/platform/test/api_integration/apis/dashboards/delete_dashboard/index.ts # src/platform/test/api_integration/apis/dashboards/delete_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/get_dashboard/index.ts # src/platform/test/api_integration/apis/dashboards/get_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/list_dashboards/index.ts # src/platform/test/api_integration/apis/dashboards/list_dashboards/main.ts # src/platform/test/api_integration/apis/dashboards/update_dashboard/index.ts # src/platform/test/api_integration/apis/dashboards/update_dashboard/main.ts # src/platform/test/api_integration/apis/dashboards/update_dashboard/validation.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…m FTR to Scout (#251163) (#252206) # Backport This will backport the following commits from `main` to `8.19`: - [[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)](#251163) <!--- Backport version: 10.2.0 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stelios Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-02-07T17:25:57Z","message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout","number":251163,"url":"https://github.com/elastic/kibana/pull/251163","mergeCommit":{"message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/251163","number":251163,"mergeCommit":{"message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324"}}]}] BACKPORT-->
… FTR to Scout (#251163) (#252205) # Backport This will backport the following commits from `main` to `9.2`: - [[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)](#251163) <!--- Backport version: 10.2.0 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stelios Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-02-07T17:25:57Z","message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout","number":251163,"url":"https://github.com/elastic/kibana/pull/251163","mergeCommit":{"message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/251163","number":251163,"mergeCommit":{"message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324"}}]}] BACKPORT-->
… FTR to Scout (#251163) (#252203) # Backport This will backport the following commits from `main` to `9.3`: - [[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)](#251163) <!--- Backport version: 10.2.0 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stelios Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-02-07T17:25:57Z","message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout","number":251163,"url":"https://github.com/elastic/kibana/pull/251163","mergeCommit":{"message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/251163","number":251163,"mergeCommit":{"message":"[@kbn/dashboard-plugin] Migrate Dashboard's CRUD API tests from FTR to Scout (#251163)\n\n## Summary\n\nMigrates the Dashboard plugin's CRUD API integration tests from FTR to\nthe Scout framework. All 19 test cases have been successfully migrated\nwith full coverage parity, using least-privileged roles (`viewer` for\nread operations, `editor` for write operations) and the new `expect`\nimport from `@kbn/scout/api`.\n\n- Migrated tests for: create, get, update, delete, and search dashboard\nendpoints\n- Added OAS schema validation test (enabled `server.oas.enabled=true` in\nScout base config)\n- Used appropriate roles: `viewer` for GET/search tests, `editor` for\nPOST/PUT/DELETE tests\n- Organized test fixtures in dedicated `fixtures/` directory with shared\nconstants and archives\n- Removed FTR tests from\n`src/platform/test/api_integration/apis/dashboards/`\n- Added `dashboard` to `.buildkite/scout_ci_config.yml`\n- Updated `.github/CODEOWNERS` to remove old FTR test path\n- All 19 tests passing with ESLint and TypeScript checks clean\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"17fdeed1d2406dde0edfc3097658700a9a3ef324"}}]}] BACKPORT-->
…nd deployment agnostic tags (#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via #252095. We now update some of the test suites introduced via #251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful.
…nd deployment agnostic tags (elastic#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via elastic#252095. We now update some of the test suites introduced via elastic#251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful. (cherry picked from commit 6636fb6)
…nd deployment agnostic tags (elastic#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via elastic#252095. We now update some of the test suites introduced via elastic#251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful. (cherry picked from commit 6636fb6) # Conflicts: # src/platform/plugins/shared/dashboard/test/scout/api/tests/update_dashboard.spec.ts
…nd deployment agnostic tags (elastic#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via elastic#252095. We now update some of the test suites introduced via elastic#251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful. (cherry picked from commit 6636fb6) # Conflicts: # src/platform/plugins/shared/dashboard/test/scout/api/tests/update_dashboard.spec.ts
…nd deployment agnostic tags (elastic#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via elastic#252095. We now update some of the test suites introduced via elastic#251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful.
…nd deployment agnostic tags (elastic#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via elastic#252095. We now update some of the test suites introduced via elastic#251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful.
…nd deployment agnostic tags (elastic#253413) We introduced the `requestAuth.getApiKeyForPrivilegedUser()` API-key based authentication method via elastic#252095. We now update some of the test suites introduced via elastic#251163 to use the new method. We update the tags so that these tests are marked to run in more testing environments, not just stateful.
## Summary Closes #250439. Blocked by #251163 This removes `spaces` from the create request body which is already passed in as part of the URL and removes the nesting under the `data` property in the request body. This also moves the optional `id` from the create request body to a URL param, e.g. `/api/dashboards/{id}`. Examples: Create request: ``` POST /api/dashboards { "title": "my empty dashboard" "description": "this is my description" // other dashboard attributes } ``` ``` POST /api/dashboards/{id} { "title": "my empty dashboard" "description": "this is my description" // other dashboard attributes } ``` Update request: ``` PUT /api/dashboards/:id { "title": "my updated dashboard" "description": "this is my updated description" // other dashboard attributes } ``` Create in a non-default space request: ``` POST /s/my-space/api/dashboards/id? { "title": "my empty dashboard" "description": "this is my description" // other dashboard attributes } ``` Update in a non-default space request: ``` PUT /s/my-space/api/dashboards/:id { "title": "my updated dashboard" "description": "this is my updated description" // other dashboard attributes } ``` ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
Summary
Migrates the Dashboard plugin's CRUD API integration tests from FTR to the Scout framework. All 19 test cases have been successfully migrated with full coverage parity, using least-privileged roles (
viewerfor read operations,editorfor write operations) and the newexpectimport from@kbn/scout/api.server.oas.enabled=truein Scout base config)viewerfor GET/search tests,editorfor POST/PUT/DELETE testsfixtures/directory with shared constants and archivessrc/platform/test/api_integration/apis/dashboards/dashboardto.buildkite/scout_ci_config.yml.github/CODEOWNERSto remove old FTR test path