Skip to content

Commit 60dc17d

Browse files
committed
fix scout tests
1 parent e92de3d commit 60dc17d

3 files changed

Lines changed: 26 additions & 11 deletions

File tree

x-pack/platform/plugins/shared/ingest_hub/test/scout/ui/tests/onboarding_connect_step.spec.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ test.describe('Onboarding connect step', { tag: tags.stateful.classic }, () => {
1313
test.beforeAll(async ({ apiServices }) => {
1414
await apiServices.core.settings({
1515
'feature_flags.overrides': {
16-
'ingestHub.onboardingEnabled': true,
16+
'ingestHub.onboardingEnabled': 'true',
1717
},
1818
});
1919
});
2020

2121
test.afterAll(async ({ apiServices }) => {
2222
await apiServices.core.settings({
2323
'feature_flags.overrides': {
24-
'ingestHub.onboardingEnabled': false,
24+
'ingestHub.onboardingEnabled': 'false',
2525
},
2626
});
2727
});
@@ -53,10 +53,16 @@ test.describe('Onboarding connect step', { tag: tags.stateful.classic }, () => {
5353
page,
5454
}) => {
5555
await browserAuth.loginAsAdmin();
56+
57+
// Deselect all services so selectedServiceIds is empty → showIdentityFederation = true
58+
await page.gotoApp('onboarding/aws#services');
59+
await expect(page.testSubj.locator('onboardingStep-services')).toBeVisible();
60+
await page.testSubj.locator('servicesStep-deselectAllButton').click();
61+
5662
await page.gotoApp('onboarding/aws#connect');
5763
await expect(page.testSubj.locator('onboardingStep-connect')).toBeVisible();
5864

59-
// Identity federation is the default auth type; with no connectors the New Identity tab is shown
65+
// Identity federation is shown when no services are selected; with no connectors the New Identity tab is shown
6066
await expect(page.testSubj.locator('awsIdentityFederationSetup-roleArn')).toBeVisible();
6167
await expect(
6268
page.testSubj.locator('awsIdentityFederationSetup-launchCloudFormation')
@@ -127,6 +133,12 @@ test.describe('Onboarding connect step', { tag: tags.stateful.classic }, () => {
127133
connectorId = response.data.item.id;
128134

129135
await browserAuth.loginAsAdmin();
136+
137+
// Deselect all services so selectedServiceIds is empty → showIdentityFederation = true
138+
await page.gotoApp('onboarding/aws#services');
139+
await expect(page.testSubj.locator('onboardingStep-services')).toBeVisible();
140+
await page.testSubj.locator('servicesStep-deselectAllButton').click();
141+
130142
await page.gotoApp('onboarding/aws#connect');
131143
await expect(page.testSubj.locator('onboardingStep-connect')).toBeVisible();
132144

x-pack/platform/plugins/shared/ingest_hub/test/scout/ui/tests/onboarding_ff_enabled.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test.describe('Onboarding app — FF enabled', { tag: tags.stateful.classic }, (
2121
test.afterAll(async ({ apiServices }) => {
2222
await apiServices.core.settings({
2323
'feature_flags.overrides': {
24-
'ingestHub.onboardingEnabled': false,
24+
'ingestHub.onboardingEnabled': 'false',
2525
},
2626
});
2727
});
@@ -34,15 +34,15 @@ test.describe('Onboarding app — FF enabled', { tag: tags.stateful.classic }, (
3434

3535
await test.step('redirects to first step hash when no hash is present', async () => {
3636
await page.gotoApp('onboarding/aws');
37-
await expect(page).toHaveURL(/#connect/);
37+
await expect(page).toHaveURL(/#services/);
3838
});
3939

4040
await test.step('renders the onboarding step shell', async () => {
4141
await expect(page.testSubj.locator('onboardingShell')).toBeVisible();
4242
});
4343

44-
await test.step('shows the connect step as current', async () => {
45-
await expect(page.testSubj.locator('onboardingStep-connect')).toBeVisible();
44+
await test.step('shows the services step as current', async () => {
45+
await expect(page.testSubj.locator('onboardingStep-services')).toBeVisible();
4646
});
4747

4848
await test.step('renders 5 step indicators', async () => {

x-pack/platform/plugins/shared/ingest_hub/test/scout/ui/tests/onboarding_services_step.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import { tags } from '@kbn/scout';
99
import { expect } from '@kbn/scout/ui';
1010
import { test } from '../fixtures';
1111

12-
// cloudwatch_logs and cloudwatch_metrics have defaultEnabled: false; all others are enabled by default.
13-
const TOTAL_SERVICES = 14;
14-
const DEFAULT_SELECTED_COUNT = 12;
12+
// 54 services have showInUI: true. 7 of those have defaultEnabled: false:
13+
// cloudwatch_logs, cloudwatch_metrics, cloudtrail_otel, vpcflow_otel, waf_otel, aws_logs, firehose.
14+
const TOTAL_SERVICES = 54;
15+
const DEFAULT_SELECTED_COUNT = 47;
1516

1617
test.describe('Onboarding services step', { tag: tags.stateful.classic }, () => {
1718
test.beforeAll(async ({ apiServices }) => {
@@ -38,9 +39,11 @@ test.describe('Onboarding services step', { tag: tags.stateful.classic }, () =>
3839
const rows = page.locator('[data-test-subj^="servicesStep-serviceRow-"]');
3940
await expect(rows).toHaveCount(TOTAL_SERVICES);
4041

41-
// cloudwatch_logs and cloudwatch_metrics are off by default
42+
// services with defaultEnabled: false are unchecked
4243
await expect(page.testSubj.locator('servicesStep-toggle-cloudwatch_logs')).not.toBeChecked();
4344
await expect(page.testSubj.locator('servicesStep-toggle-cloudwatch_metrics')).not.toBeChecked();
45+
await expect(page.testSubj.locator('servicesStep-toggle-cloudtrail_otel')).not.toBeChecked();
46+
await expect(page.testSubj.locator('servicesStep-toggle-firehose')).not.toBeChecked();
4447

4548
// a defaultEnabled service is checked
4649
await expect(page.testSubj.locator('servicesStep-toggle-guardduty')).toBeChecked();

0 commit comments

Comments
 (0)