From 57bf0aafd670e7b6acada768a1b6805556b0637b Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 27 Aug 2020 19:59:42 +0200 Subject: [PATCH] fixes typecheck error --- .../test/security_solution_cypress/runner.ts | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/x-pack/test/security_solution_cypress/runner.ts b/x-pack/test/security_solution_cypress/runner.ts index a197d4579b132..ccdc2fa4424ac 100644 --- a/x-pack/test/security_solution_cypress/runner.ts +++ b/x-pack/test/security_solution_cypress/runner.ts @@ -12,17 +12,33 @@ import { withProcRunner } from '@kbn/dev-utils'; import { FtrProviderContext } from './ftr_provider_context'; export async function SecuritySolutionCypressCliTestRunner({ getService }: FtrProviderContext) { - await SecuritySolutionCypressTestRunner('run', { getService }); -} + const log = getService('log'); + const config = getService('config'); + const esArchiver = getService('esArchiver'); -export async function SecuritySolutionCypressVisualTestRunner({ getService }: FtrProviderContext) { - await SecuritySolutionCypressTestRunner('open', { getService }); + await esArchiver.load('empty_kibana'); + await esArchiver.load('auditbeat'); + + await withProcRunner(log, async (procs) => { + await procs.run('cypress', { + cmd: 'yarn', + args: ['cypress:run'], + cwd: resolve(__dirname, '../../plugins/security_solution'), + env: { + FORCE_COLOR: '1', + // eslint-disable-next-line @typescript-eslint/naming-convention + CYPRESS_baseUrl: Url.format(config.get('servers.kibana')), + CYPRESS_ELASTICSEARCH_URL: Url.format(config.get('servers.elasticsearch')), + CYPRESS_ELASTICSEARCH_USERNAME: config.get('servers.elasticsearch.username'), + CYPRESS_ELASTICSEARCH_PASSWORD: config.get('servers.elasticsearch.password'), + ...process.env, + }, + wait: true, + }); + }); } -export async function SecuritySolutionCypressTestRunner( - argument: string, - { getService }: FtrProviderContext -) { +export async function SecuritySolutionCypressVisualTestRunner({ getService }: FtrProviderContext) { const log = getService('log'); const config = getService('config'); const esArchiver = getService('esArchiver'); @@ -33,7 +49,7 @@ export async function SecuritySolutionCypressTestRunner( await withProcRunner(log, async (procs) => { await procs.run('cypress', { cmd: 'yarn', - args: [`cypress:${argument}`], + args: ['cypress:open'], cwd: resolve(__dirname, '../../plugins/security_solution'), env: { FORCE_COLOR: '1',