File tree 4 files changed +20
-8
lines changed
4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,9 @@ const getAccessibilityCypressCommandEventListener = () => {
191
191
const setAccessibilityEventListeners = ( ) => {
192
192
try {
193
193
const cypressCommandEventListener = getAccessibilityCypressCommandEventListener ( ) ;
194
- glob ( process . cwd ( ) + '/cypress/support/*.js' , { } , ( err , files ) => {
194
+
195
+ // Searching form command.js recursively
196
+ glob ( process . cwd ( ) + '/**/cypress/support/*.js' , { } , ( err , files ) => {
195
197
if ( err ) return logger . debug ( 'EXCEPTION IN BUILD START EVENT : Unable to parse cypress support files' ) ;
196
198
files . forEach ( file => {
197
199
try {
Original file line number Diff line number Diff line change @@ -267,16 +267,26 @@ exports.getCiInfo = () => {
267
267
return null ;
268
268
}
269
269
270
- exports . getBuildDetails = ( bsConfig ) => {
270
+ exports . getBuildDetails = ( bsConfig , isO11y = false ) => {
271
+ const isTestObservabilityOptionsPresent = isO11y && ! utils . isUndefined ( bsConfig [ "testObservabilityOptions" ] ) ;
272
+
271
273
let buildName = '' ,
272
274
projectName = '' ,
273
275
buildDescription = '' ,
274
276
buildTags = [ ] ;
275
-
277
+
276
278
/* Pick from environment variables */
277
279
buildName = process . env . BROWSERSTACK_BUILD_NAME || buildName ;
278
280
projectName = process . env . BROWSERSTACK_PROJECT_NAME || projectName ;
279
-
281
+
282
+ /* Pick from testObservabilityOptions */
283
+ if ( isTestObservabilityOptionsPresent ) {
284
+ buildName = buildName || bsConfig [ "testObservabilityOptions" ] [ "buildName" ] ;
285
+ projectName = projectName || bsConfig [ "testObservabilityOptions" ] [ "projectName" ] ;
286
+ if ( ! utils . isUndefined ( bsConfig [ "testObservabilityOptions" ] [ "buildTag" ] ) ) buildTags = [ ...buildTags , ...bsConfig [ "testObservabilityOptions" ] [ "buildTag" ] ] ;
287
+ buildDescription = buildDescription || bsConfig [ "testObservabilityOptions" ] [ "buildDescription" ] ;
288
+ }
289
+
280
290
/* Pick from run settings */
281
291
buildName = buildName || bsConfig [ "run_settings" ] [ "build_name" ] ;
282
292
projectName = projectName || bsConfig [ "run_settings" ] [ "project_name" ] ;
Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ exports.launchTestSession = async (user_config, bsConfigPath) => {
339
339
projectName,
340
340
buildDescription,
341
341
buildTags
342
- } = helper . getBuildDetails ( user_config ) ;
342
+ } = helper . getBuildDetails ( user_config , true ) ;
343
343
const data = {
344
344
'format' : 'json' ,
345
345
'project_name' : projectName ,
Original file line number Diff line number Diff line change @@ -156,14 +156,14 @@ class MyReporter {
156
156
} )
157
157
158
158
. on ( EVENT_TEST_BEGIN , async ( test ) => {
159
- if ( test . isSkipped ) return ;
159
+ if ( this . runStatusMarkedHash [ test . testAnalyticsId ] ) return ;
160
160
if ( this . testObservability == true ) {
161
161
await this . testStarted ( test ) ;
162
162
}
163
163
} )
164
164
165
165
. on ( EVENT_TEST_END , async ( test ) => {
166
- if ( test . isSkipped ) return ;
166
+ if ( this . runStatusMarkedHash [ test . testAnalyticsId ] ) return ;
167
167
if ( this . testObservability == true ) {
168
168
if ( ! this . runStatusMarkedHash [ test . testAnalyticsId ] ) {
169
169
if ( test . testAnalyticsId ) this . runStatusMarkedHash [ test . testAnalyticsId ] = true ;
@@ -448,7 +448,7 @@ class MyReporter {
448
448
}
449
449
450
450
// Send pending hook finsihed events for hook starts
451
- if ( eventType === 'TestRunFinished' ) {
451
+ if ( eventType === 'TestRunFinished' || eventType === 'TestRunSkipped' ) {
452
452
Object . values ( this . hooksStarted ) . forEach ( async hookData => {
453
453
hookData [ 'event_type' ] = 'HookRunFinished' ;
454
454
hookData [ 'hook_run' ] = {
You can’t perform that action at this time.
0 commit comments