@@ -12,7 +12,6 @@ import {
12
12
} from 'sauce-testrunner-utils' ;
13
13
import cypress from 'cypress' ;
14
14
import util from 'util' ;
15
- import _ from 'lodash' ;
16
15
import { afterRunTestReport } from '@saucelabs/cypress-plugin' ;
17
16
import { createJUnitReport } from '@saucelabs/cypress-junit-plugin' ;
18
17
import { clearTimeout , setTimeout } from 'timers' ;
@@ -61,45 +60,6 @@ function isFailedRunResult(
61
60
) ;
62
61
}
63
62
64
- // Configure reporters
65
- function configureReporters ( runCfg : RunConfig , opts : any ) {
66
- const reporterConfig = {
67
- reporterEnabled : `spec` ,
68
- } ;
69
-
70
- // Adding custom reporters
71
- if ( runCfg && runCfg . cypress && runCfg . cypress . reporters ) {
72
- for ( const reporter of runCfg . cypress . reporters ) {
73
- const cfgFieldName = [ _ . camelCase ( reporter . name ) , 'ReporterOptions' ] . join (
74
- '' ,
75
- ) ;
76
- reporterConfig . reporterEnabled = `${ reporterConfig . reporterEnabled } , ${ reporter . name } ` ;
77
- reporterConfig [ cfgFieldName ] = reporter . options || { } ;
78
- }
79
- }
80
-
81
- const reporterConfigPath = path . join (
82
- __dirname ,
83
- '..' ,
84
- 'sauce-reporter-config.json' ,
85
- ) ;
86
-
87
- // Save reporters config
88
- fs . writeFileSync ( reporterConfigPath , JSON . stringify ( reporterConfig ) ) ;
89
-
90
- // Cypress only supports a single reporter out of the box, so we need to use
91
- // a plugin to support multiple reporters.
92
- opts . config . reporter = path . join (
93
- __dirname ,
94
- '../node_modules/cypress-multi-reporters/lib/MultiReporters.js' ,
95
- ) ;
96
- opts . config . reporterOptions = {
97
- configFile : reporterConfigPath ,
98
- } ;
99
-
100
- return opts ;
101
- }
102
-
103
63
function getSuite ( runCfg : RunConfig , suiteName : string ) {
104
64
const suites = runCfg . suites || [ ] ;
105
65
const suite = suites . find ( ( testSuite ) => testSuite . name === suiteName ) ;
@@ -159,7 +119,7 @@ function getCypressOpts(
159
119
? undefined
160
120
: runCfg . resultsDir ;
161
121
162
- let opts : Partial < CypressCommandLine . CypressRunOptions > = {
122
+ const opts : Partial < CypressCommandLine . CypressRunOptions > = {
163
123
project : path . dirname ( cypressCfgFile ) ,
164
124
browser : process . env . SAUCE_BROWSER || suite . browser || 'chrome' ,
165
125
configFile : path . basename ( cypressCfgFile ) ,
@@ -184,12 +144,6 @@ function getCypressOpts(
184
144
opts . key = runCfg . cypress . key ;
185
145
}
186
146
187
- if ( runCfg . cypress . reporters && runCfg . cypress . reporters . length > 0 ) {
188
- opts = configureReporters ( runCfg , opts ) ;
189
- console . log (
190
- 'Configuring cypress reporters with saucectl is deprecated and will be removed in a future release. Migrate your configuration to your cypress config file.' ,
191
- ) ;
192
- }
193
147
configureWebkitOptions ( process . env , opts , suite ) ;
194
148
195
149
return opts as CypressCommandLine . CypressRunOptions ;
0 commit comments