diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts index 9da58cc8e406..d6158c21eafa 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts @@ -52,9 +52,13 @@ import { login } from '../../../tasks/login'; import { visit, visitWithTimeRange } from '../../../tasks/navigation'; import { CASES_URL, OVERVIEW_URL } from '../../../urls/navigation'; -import { ELASTICSEARCH_USERNAME } from '../../../env_var_names_constants'; +import { CLOUD_SERVERLESS, ELASTICSEARCH_USERNAME } from '../../../env_var_names_constants'; import { deleteCases } from '../../../tasks/api_calls/cases'; +// https://github.com/elastic/kibana/issues/179231 +const isCloudServerless = Cypress.env(CLOUD_SERVERLESS); +const username = isCloudServerless ? 'admin' : Cypress.env(ELASTICSEARCH_USERNAME); + // Tracked by https://github.com/elastic/security-team/issues/7696 describe('Cases', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { @@ -109,12 +113,8 @@ describe('Cases', { tags: ['@ess', '@serverless'] }, () => { 'have.text', `${this.mycase.description} ${this.mycase.timeline.title}` ); - cy.get(CASE_DETAILS_USERNAMES) - .eq(REPORTER) - .should('contain', Cypress.env(ELASTICSEARCH_USERNAME)); - cy.get(CASE_DETAILS_USERNAMES) - .eq(PARTICIPANTS) - .should('contain', Cypress.env(ELASTICSEARCH_USERNAME)); + cy.get(CASE_DETAILS_USERNAMES).eq(REPORTER).should('contain', username); + cy.get(CASE_DETAILS_USERNAMES).eq(PARTICIPANTS).should('contain', username); cy.get(CASE_DETAILS_TAGS).should('have.text', expectedTags); EXPECTED_METRICS.forEach((metric) => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts index 897a0a3a0ec8..331a7700db61 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts @@ -23,6 +23,8 @@ export const API_HEADERS = Object.freeze({ [ELASTIC_HTTP_VERSION_HEADER]: [INITIAL_REST_VERSION], }); +export const INTERNAL_CLOUD_CONNECTORS = ['Elastic-Cloud-SMTP']; + export const rootRequest = ({ headers: optionHeaders, ...restOptions @@ -108,10 +110,12 @@ export const deleteConnectors = () => { return connector.id; }); ids.forEach((id) => { - rootRequest({ - method: 'DELETE', - url: `api/actions/connector/${id}`, - }); + if (!INTERNAL_CLOUD_CONNECTORS.includes(id)) { + rootRequest({ + method: 'DELETE', + url: `api/actions/connector/${id}`, + }); + } }); } });