This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 5 files changed +42
-13
lines changed
5 files changed +42
-13
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,13 @@ exports.config = {
200
200
// Use a number less than 1 to denote unlimited. Default is unlimited.
201
201
maxSessions : - 1 ,
202
202
203
+ // Whether or not to buffer output when running tests on multiple browsers
204
+ // in parallel. By default, when running multiple browser sessions, the
205
+ // results are buffered and not logged until the test run finishes. If true,
206
+ // when running multiple sessions in parallel results will be logged when each
207
+ // test finishes.
208
+ verboseMultiSessions : false ,
209
+
203
210
// ---------------------------------------------------------------------------
204
211
// ----- Global test information ---------------------------------------------
205
212
// ---------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -309,6 +309,15 @@ export interface Config {
309
309
*/
310
310
maxSessions ?: number ;
311
311
312
+ /**
313
+ * Whether or not to buffer output when running tests on multiple browsers
314
+ * in parallel. By default, when running multiple browser sessions, the
315
+ * results are buffered and not logged until the test run finishes. If true,
316
+ * when running multiple sessions in parallel results will be logged when
317
+ * each test finishes.
318
+ */
319
+ verboseMultiSessions ?: boolean ;
320
+
312
321
// ---------------------------------------------------------------------------
313
322
// ----- Global test information
314
323
// ---------------------------------------------
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export class ConfigParser {
28
28
this . config_ = {
29
29
specs : [ ] ,
30
30
multiCapabilities : [ ] ,
31
+ verboseMultiSessions : false ,
31
32
rootElement : 'body' ,
32
33
allScriptsTimeout : 11000 ,
33
34
getPageTimeout : 10000 ,
Original file line number Diff line number Diff line change @@ -32,14 +32,23 @@ export class TaskLogger {
32
32
}
33
33
34
34
/**
35
- * Flushes the buffer to stdout .
35
+ * Prints the contents of the buffer without clearing it .
36
36
*/
37
- public flush ( ) : void {
37
+ public peek ( ) : void {
38
38
if ( this . buffer ) {
39
39
// Flush buffer if nonempty
40
40
logger . info ( os . EOL + '------------------------------------' + os . EOL ) ;
41
41
logger . info ( this . buffer ) ;
42
42
logger . info ( os . EOL ) ;
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Flushes the buffer to stdout.
48
+ */
49
+ public flush ( ) : void {
50
+ if ( this . buffer ) {
51
+ this . peek ( ) ;
43
52
this . buffer = '' ;
44
53
}
45
54
}
Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ export class TaskRunner extends EventEmitter {
53
53
specResults : [ ]
54
54
} ;
55
55
56
+ let configParser = new ConfigParser ( ) ;
57
+ if ( this . configFile ) {
58
+ configParser . addFileConfig ( this . configFile ) ;
59
+ }
60
+ if ( this . additionalConfig ) {
61
+ configParser . addConfig ( this . additionalConfig ) ;
62
+ }
63
+ let config = configParser . getConfig ( ) ;
64
+ config . capabilities = this . task . capabilities ;
65
+ config . specs = this . task . specs ;
66
+
56
67
if ( this . runInFork ) {
57
68
let deferred = q . defer ( ) ;
58
69
@@ -72,6 +83,9 @@ export class TaskRunner extends EventEmitter {
72
83
childProcess
73
84
. on ( 'message' ,
74
85
( m : any ) => {
86
+ if ( config . verboseMultiSessions ) {
87
+ taskLogger . peek ( ) ;
88
+ }
75
89
switch ( m . event ) {
76
90
case 'testPass' :
77
91
process . stdout . write ( '.' ) ;
@@ -106,17 +120,6 @@ export class TaskRunner extends EventEmitter {
106
120
107
121
return deferred . promise ;
108
122
} else {
109
- let configParser = new ConfigParser ( ) ;
110
- if ( this . configFile ) {
111
- configParser . addFileConfig ( this . configFile ) ;
112
- }
113
- if ( this . additionalConfig ) {
114
- configParser . addConfig ( this . additionalConfig ) ;
115
- }
116
- let config = configParser . getConfig ( ) ;
117
- config . capabilities = this . task . capabilities ;
118
- config . specs = this . task . specs ;
119
-
120
123
let runner = new Runner ( config ) ;
121
124
122
125
runner . on ( 'testsDone' , ( results : RunResults ) => {
You can’t perform that action at this time.
0 commit comments