@@ -47,7 +47,7 @@ public RunCommand()
47
47
"-o|--output-directory" ,
48
48
"The output directory where the Test Case result will be stored." ,
49
49
CommandOptionType . SingleValue ,
50
- cfg => cfg . DefaultValue = "." ,
50
+ cfg => cfg . DefaultValue = null ,
51
51
true
52
52
) ;
53
53
@@ -110,11 +110,15 @@ private async Task<int> ExecuteAsync(CancellationToken cancellationToken)
110
110
_testCaseId . ParsedValue
111
111
) ;
112
112
113
+ var outputDirectory = _outputDirectory . HasValue ( )
114
+ ? _outputDirectory . ParsedValue
115
+ : null ;
116
+
113
117
foreach ( var file in files )
114
118
{
115
119
var result = await RunTestCaseAsync (
116
120
_inputDirectory . ParsedValue ,
117
- _outputDirectory . ParsedValue ,
121
+ outputDirectory ,
118
122
file ,
119
123
cancellationToken
120
124
) ;
@@ -129,7 +133,7 @@ private async Task<int> ExecuteAsync(CancellationToken cancellationToken)
129
133
130
134
private async Task < int > RunTestCaseAsync (
131
135
string inputDirectory ,
132
- string outputDirectory ,
136
+ string ? outputDirectory ,
133
137
string file ,
134
138
CancellationToken cancellationToken
135
139
)
@@ -187,13 +191,16 @@ CancellationToken cancellationToken
187
191
}
188
192
}
189
193
190
- // Store the Test Case run
191
- var run = new TestCaseRun ( testCase , testStepResults ) ;
192
- await run . SaveAsync (
193
- inputDirectory ,
194
- outputDirectory ,
195
- cancellationToken
196
- ) ;
194
+ if ( ! string . IsNullOrWhiteSpace ( outputDirectory ) )
195
+ {
196
+ // Store the Test Case run
197
+ var run = new TestCaseRun ( testCase , testStepResults ) ;
198
+ await run . SaveAsync (
199
+ inputDirectory ,
200
+ outputDirectory ,
201
+ cancellationToken
202
+ ) ;
203
+ }
197
204
198
205
ConsoleHelper . WriteLineSuccess ( $ "Test Case { testCase . Id } executed successfully.") ;
199
206
@@ -227,4 +234,4 @@ private ExecutorConfig GetExecutorConfiguration()
227
234
_recordVideoDir . ParsedValue
228
235
) ;
229
236
}
230
- }
237
+ }
0 commit comments