Skip to content

[scout] add 'apiServices' fixture to group Kibana API helpers#214470

Merged
dmlemeshko merged 9 commits intoelastic:mainfrom
dmlemeshko:scout/apiServices-fixture
Mar 18, 2025
Merged

[scout] add 'apiServices' fixture to group Kibana API helpers#214470
dmlemeshko merged 9 commits intoelastic:mainfrom
dmlemeshko:scout/apiServices-fixture

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

@dmlemeshko dmlemeshko commented Mar 13, 2025

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)

image

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);

@dmlemeshko dmlemeshko self-assigned this Mar 13, 2025
@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:version Backport to applied version labels test:scout v9.1.0 v8.19.0 labels Mar 13, 2025
@dmlemeshko dmlemeshko marked this pull request as ready for review March 14, 2025 09:05
@dmlemeshko dmlemeshko requested review from a team as code owners March 14, 2025 09:05
@dmlemeshko dmlemeshko requested a review from pheyos March 14, 2025 14:29
Copy link
Copy Markdown
Member

@csr csr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me. This is a good step forward to make searching for a service a bit more developer-friendly (by leveraging the IDE autocompletion). I left a few minor comments.

#### Adding Fixtures
#### Adding API service

1. **Create a New API serivce:** Add your service to the `src/playwright/fixtures/worker/apis` directory. For instance:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: I think we meant to say service here.

@achyutjhunjhunwala achyutjhunjhunwala self-requested a review March 18, 2025 09:01
Copy link
Copy Markdown
Contributor

@mykolaharmash mykolaharmash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Onboarding changes LGTM ✨

@dmlemeshko dmlemeshko enabled auto-merge (squash) March 18, 2025 10:21
@dmlemeshko dmlemeshko merged commit 48cd207 into elastic:main Mar 18, 2025
10 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13922203847

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/scout 101 105 +4
@kbn/scout-oblt 66 69 +3
total +7

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/scout 18 16 -2
Unknown metric groups

API count

id before after diff
@kbn/scout 412 416 +4
@kbn/scout-oblt 357 360 +3
total +7

History

cc @dmlemeshko

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Space time] extending Scout with perfTracker fixture (#212397)
- [scout] use project deps as global hooks for parallel tests (#211409)
9.0 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.0:
- [Space time] extending Scout with perfTracker fixture (#212397)
- [scout] use project deps as global hooks for parallel tests (#211409)

Manual backport

To create the backport manually run:

node scripts/backport --pr 214470

Questions ?

Please refer to the Backport tool documentation

@dmlemeshko dmlemeshko added backport:version Backport to applied version labels and removed backport:version Backport to applied version labels labels Mar 19, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13944285199

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 19, 2025
…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)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Space time] extending Scout with perfTracker fixture (#212397)
- [scout] use project deps as global hooks for parallel tests (#211409)
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 214470

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 19, 2025
…214470) (#215123)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[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":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"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>
@dmlemeshko dmlemeshko added backport:version Backport to applied version labels and removed backport:version Backport to applied version labels labels Mar 19, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13956834155

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 19, 2025
…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)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.x
9.0 Cherrypick failed because the selected commit (48cd207) is empty. It looks like the commit was already backported in #215123

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 214470

Questions ?

Please refer to the Backport tool documentation

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>
clintandrewhall pushed a commit to clintandrewhall/kibana that referenced this pull request Mar 20, 2025
…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);
```
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…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);
```
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Mar 31, 2025
…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);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes test:scout v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants