diff --git a/packages/kbn-ftr-common-functional-services/services/search.ts b/packages/kbn-ftr-common-functional-services/services/search.ts index c087f1d8bb913..2c9e0f558a365 100644 --- a/packages/kbn-ftr-common-functional-services/services/search.ts +++ b/packages/kbn-ftr-common-functional-services/services/search.ts @@ -73,7 +73,7 @@ export class SearchService extends FtrService { .post(`${spaceUrl}/internal/search/${strategy}/${body.id}`) .set('kbn-xsrf', 'true') .set(ELASTIC_HTTP_VERSION_HEADER, '1') - .send() + .send(options) .expect(200); expect(resp.body.isRunning).equal(false); return resp.body as T; diff --git a/x-pack/test/apm_api_integration/common/utils/parse_b_fetch.ts b/x-pack/test/apm_api_integration/common/utils/parse_b_fetch.ts deleted file mode 100644 index 79ea70f7199f9..0000000000000 --- a/x-pack/test/apm_api_integration/common/utils/parse_b_fetch.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import request from 'superagent'; - -export function parseBfetchResponse(resp: request.Response): Array> { - return resp.text - .trim() - .split('\n') - .map((item) => JSON.parse(item)); -} diff --git a/x-pack/test/common/services/search_secure.ts b/x-pack/test/common/services/search_secure.ts index 93654fddd611a..f46e9e57ef275 100644 --- a/x-pack/test/common/services/search_secure.ts +++ b/x-pack/test/common/services/search_secure.ts @@ -9,20 +9,12 @@ // but with the ability to provide custom auth import expect from '@kbn/expect'; -import request from 'superagent'; import type { IEsSearchResponse } from '@kbn/search-types'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { BFETCH_ROUTE_VERSION_LATEST } from '@kbn/bfetch-plugin/common'; import { SupertestWithoutAuthProviderType } from '@kbn/ftr-common-functional-services'; import { FtrService } from '../ftr_provider_context'; -const parseBfetchResponse = (resp: request.Response): Array> => { - return resp.text - .trim() - .split('\n') - .map((item) => JSON.parse(item)); -}; - const getSpaceUrlPrefix = (spaceId?: string): string => { return spaceId && spaceId !== 'default' ? `/s/${spaceId}` : ``; }; @@ -114,11 +106,10 @@ export class SearchSecureService extends FtrService { .set('kbn-xsrf', 'true') .set('x-elastic-internal-origin', 'Kibana') .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send() + .send(options) .expect(200); - const [parsedResponse] = parseBfetchResponse(resp); - expect(parsedResponse.result.isRunning).equal(false); - return parsedResponse.result; + expect(resp.body.isRunning).equal(false); + return resp.body; }); return result as T; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts index fd6009c82df09..cab4ee31744f6 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts @@ -21,8 +21,7 @@ export default function ({ getService }: FtrProviderContextWithSpaces) { const esArchiver = getService('esArchiver'); const utils = getService('securitySolutionUtils'); - // Failing: See https://github.com/elastic/kibana/issues/199372 - describe.skip('Network DNS', () => { + describe('Network DNS', () => { let supertest: TestAgent; let search: SearchService; describe('With packetbeat', () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts index 4c316e774ebbd..31eabe76ee0e1 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts @@ -25,8 +25,7 @@ export default function ({ getService }: FtrProviderContextWithSpaces) { const esArchiver = getService('esArchiver'); const utils = getService('securitySolutionUtils'); - // FLAKY: https://github.com/elastic/kibana/issues/199363 - describe.skip('Network Top N Flow', () => { + describe('Network Top N Flow', () => { let supertest: TestAgent; let search: SearchService; describe('With filebeat', () => { diff --git a/x-pack/test_serverless/shared/services/search_secure.ts b/x-pack/test_serverless/shared/services/search_secure.ts index 7db246dc4ccdf..f0130203dd9b9 100644 --- a/x-pack/test_serverless/shared/services/search_secure.ts +++ b/x-pack/test_serverless/shared/services/search_secure.ts @@ -10,19 +10,11 @@ import expect from '@kbn/expect'; import { GenericFtrService } from '@kbn/test'; -import request from 'superagent'; import type { IEsSearchResponse } from '@kbn/search-types'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { SupertestWithoutAuthProviderType } from '@kbn/ftr-common-functional-services'; import { FtrProviderContext } from '../../functional/ftr_provider_context'; -const parseBfetchResponse = (resp: request.Response): Array> => { - return resp.text - .trim() - .split('\n') - .map((item) => JSON.parse(item)); -}; - export interface SendOptions { supertestWithoutAuth: SupertestWithoutAuthProviderType; apiKeyHeader: { Authorization: string }; @@ -108,11 +100,10 @@ export class SearchSecureService extends GenericFtrService { .set('kbn-xsrf', 'true') .set('x-elastic-internal-origin', 'Kibana') .set(ELASTIC_HTTP_VERSION_HEADER, '1') - .send() + .send(options) .expect(200); - const [parsedResponse] = parseBfetchResponse(resp); - expect(parsedResponse.result.isRunning).equal(false); - return parsedResponse.result; + expect(resp.body.isRunning).equal(false); + return resp.body; }); return result as T;