Commit 9bb496e
[CSP] Fix agentless GCP CIS integration test - handle Cloud Connector credential selector (#271805)
## Summary
Fixes the consistently failing `cis_integration_gcp.ts` agentless test
(#262351).
**Root cause:** When GCP Cloud Connectors are enabled (CSP package >=
`3.3.0-preview03`), the agentless GCP form now defaults to the
`cloud_connectors` credential type, which renders
`LazyCloudConnectorSetup` instead of the Launch Cloud Shell button. The
test was unconditionally asserting the Cloud Shell button, causing a
consistent failure.
**Fix:** Add `selectGcpCredentials` and `isGcpCredentialSelectorVisible`
page object helpers, then conditionally switch to `credentials-json`
before asserting the Cloud Shell button — mirroring the same pattern the
AWS test uses with `selectAwsCredentials('direct')`.
## Changes
- `add_cis_integration_form_page.ts`: Added `selectGcpCredentials` and
`isGcpCredentialSelectorVisible` page object methods
- `cis_integration_gcp.ts`: Un-skipped outer `describe.skip`, added
conditional credential type selection before asserting Cloud Shell
button
Note: The inner `describe.skip('Serverless - Agentless CIS_GCP edit
flow')` remains skipped (separate issue with `getFieldAttributeValue`
returning `[object Object]`).
## Checklist
- [ ] 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/packages/kbn-i18n/GUIDELINE.md)
- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/)
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
- [ ] [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)
## Identify risks
- Low. Only test code changed, no production code.
- The fix degrades gracefully: `isGcpCredentialSelectorVisible()`
returns false when GCP Cloud Connectors are not enabled (older package),
so no credential switch is attempted and the existing assertion
continues to work.
Made with [Cursor](https://cursor.com)
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 5546a9b commit 9bb496e
2 files changed
Lines changed: 32 additions & 2 deletions
File tree
- x-pack/solutions/security/test
- cloud_security_posture_functional/page_objects
- serverless/functional/test_suites/ftr/cloud_security_posture/agentless
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
373 | 390 | | |
374 | 391 | | |
375 | 392 | | |
| |||
701 | 718 | | |
702 | 719 | | |
703 | 720 | | |
| 721 | + | |
| 722 | + | |
704 | 723 | | |
705 | 724 | | |
706 | 725 | | |
| |||
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
70 | 81 | | |
71 | 82 | | |
72 | 83 | | |
| |||
0 commit comments