[9.0] [scout] add 'apiServices' fixture to group Kibana API helpers (#214470)#215123
Merged
kibanamachine merged 1 commit intoelastic:9.0from Mar 19, 2025
Merged
Conversation
…c#214470) ## Summary We decided to group `Kibana API helpers` under a single fixture: `apiServices` instead of individual fixtures. It should simplify the search of existing helpers and reduce a risk for Teams to create the same helper like we see today with FTR. Adding just `apiServices` in test context and adding dot will expand a list of all available API helpers + it can be extended for individual solution (e.g. @kbn/scout-oblt) and directly in plugin (if there is no chance to re-use it in other plugins) <img width="699" alt="image" src="https://github.com/user-attachments/assets/34a76659-04af-48c4-ab69-abda0c950206" /> Before: ``` test('should create something', async ({ fleetApi, onboardingApi, alertingApi, }) => { await fleetApi.integration.install(integrationName); await onboardingApi.updateInstallationStepStatus( onboardingId, 'ea-download', 'complete' ); await alertingApi.waitForAlert(alertId); ``` After: ``` test('should create something', async ({ apiServices, }) => { await apiServices.fleet.integration.install(integrationName); await apiServices.onboarding.updateInstallationStepStatus( onboardingId, 'ea-download', 'complete' ); await apiServices.alerting.waitForAlert(alertId); ``` (cherry picked from commit 48cd207)
Contributor
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Unknown metric groupsAPI count
cc @dmlemeshko |
kibanamachine
added a commit
that referenced
this pull request
Mar 19, 2025
…214470) (#215249) # Backport This will backport the following commits from `main` to `8.x`: - [[scout] add 'apiServices' fixture to group Kibana API helpers (#214470)](#214470) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T11:34:25Z","message":"[scout] add 'apiServices' fixture to group Kibana API helpers (#214470)\n\n## Summary\n\nWe decided to group `Kibana API helpers` under a single fixture:\n`apiServices` instead of individual fixtures. It should simplify the\nsearch of existing helpers and reduce a risk for Teams to create the\nsame helper like we see today with FTR.\nAdding just `apiServices` in test context and adding dot will expand a\nlist of all available API helpers + it can be extended for individual\nsolution (e.g. @kbn/scout-oblt) and directly in plugin (if there is no\nchance to re-use it in other plugins)\n\n<img width=\"699\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/34a76659-04af-48c4-ab69-abda0c950206\"\n/>\n\n\nBefore:\n\n```\ntest('should create something', async ({\n fleetApi,\n onboardingApi,\n alertingApi,\n }) => {\n await fleetApi.integration.install(integrationName);\n await onboardingApi.updateInstallationStepStatus(\n onboardingId,\n 'ea-download',\n 'complete'\n );\n await alertingApi.waitForAlert(alertId);\n```\n\nAfter:\n\n```\ntest('should create something', async ({\n apiServices,\n }) => {\n await apiServices.fleet.integration.install(integrationName);\n await apiServices.onboarding.updateInstallationStepStatus(\n onboardingId,\n 'ea-download',\n 'complete'\n );\n await apiServices.alerting.waitForAlert(alertId);\n```","sha":"48cd2075f75386b515e19567095c03a8ca73fe20","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","test:scout","v9.1.0","v8.19.0"],"title":"[scout] add 'apiServices' fixture to group Kibana API helpers","number":214470,"url":"https://github.com/elastic/kibana/pull/214470","mergeCommit":{"message":"[scout] add 'apiServices' fixture to group Kibana API helpers (#214470)\n\n## Summary\n\nWe decided to group `Kibana API helpers` under a single fixture:\n`apiServices` instead of individual fixtures. It should simplify the\nsearch of existing helpers and reduce a risk for Teams to create the\nsame helper like we see today with FTR.\nAdding just `apiServices` in test context and adding dot will expand a\nlist of all available API helpers + it can be extended for individual\nsolution (e.g. @kbn/scout-oblt) and directly in plugin (if there is no\nchance to re-use it in other plugins)\n\n<img width=\"699\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/34a76659-04af-48c4-ab69-abda0c950206\"\n/>\n\n\nBefore:\n\n```\ntest('should create something', async ({\n fleetApi,\n onboardingApi,\n alertingApi,\n }) => {\n await fleetApi.integration.install(integrationName);\n await onboardingApi.updateInstallationStepStatus(\n onboardingId,\n 'ea-download',\n 'complete'\n );\n await alertingApi.waitForAlert(alertId);\n```\n\nAfter:\n\n```\ntest('should create something', async ({\n apiServices,\n }) => {\n await apiServices.fleet.integration.install(integrationName);\n await apiServices.onboarding.updateInstallationStepStatus(\n onboardingId,\n 'ea-download',\n 'complete'\n );\n await apiServices.alerting.waitForAlert(alertId);\n```","sha":"48cd2075f75386b515e19567095c03a8ca73fe20"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/215123","number":215123,"state":"MERGED","mergeCommit":{"sha":"35100fdb73cab45d355a79a9b04605371397eb7a","message":"[9.0] [scout] add 'apiServices' fixture to group Kibana API helpers (#214470) (#215123)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[scout] add 'apiServices' fixture to group Kibana API helpers\n(#214470)](https://github.com/elastic/kibana/pull/214470)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214470","number":214470,"mergeCommit":{"message":"[scout] add 'apiServices' fixture to group Kibana API helpers (#214470)\n\n## Summary\n\nWe decided to group `Kibana API helpers` under a single fixture:\n`apiServices` instead of individual fixtures. It should simplify the\nsearch of existing helpers and reduce a risk for Teams to create the\nsame helper like we see today with FTR.\nAdding just `apiServices` in test context and adding dot will expand a\nlist of all available API helpers + it can be extended for individual\nsolution (e.g. @kbn/scout-oblt) and directly in plugin (if there is no\nchance to re-use it in other plugins)\n\n<img width=\"699\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/34a76659-04af-48c4-ab69-abda0c950206\"\n/>\n\n\nBefore:\n\n```\ntest('should create something', async ({\n fleetApi,\n onboardingApi,\n alertingApi,\n }) => {\n await fleetApi.integration.install(integrationName);\n await onboardingApi.updateInstallationStepStatus(\n onboardingId,\n 'ea-download',\n 'complete'\n );\n await alertingApi.waitForAlert(alertId);\n```\n\nAfter:\n\n```\ntest('should create something', async ({\n apiServices,\n }) => {\n await apiServices.fleet.integration.install(integrationName);\n await apiServices.onboarding.updateInstallationStepStatus(\n onboardingId,\n 'ea-download',\n 'complete'\n );\n await apiServices.alerting.waitForAlert(alertId);\n```","sha":"48cd2075f75386b515e19567095c03a8ca73fe20"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.0:Questions ?
Please refer to the Backport tool documentation