File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,9 @@ const getAccessibilityCypressCommandEventListener = () => {
191191const setAccessibilityEventListeners = ( ) => {
192192 try {
193193 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 ) => {
195197 if ( err ) return logger . debug ( 'EXCEPTION IN BUILD START EVENT : Unable to parse cypress support files' ) ;
196198 files . forEach ( file => {
197199 try {
Original file line number Diff line number Diff line change @@ -267,16 +267,26 @@ exports.getCiInfo = () => {
267267 return null ;
268268}
269269
270- exports . getBuildDetails = ( bsConfig ) => {
270+ exports . getBuildDetails = ( bsConfig , isO11y = false ) => {
271+ const isTestObservabilityOptionsPresent = isO11y && ! utils . isUndefined ( bsConfig [ "testObservabilityOptions" ] ) ;
272+
271273 let buildName = '' ,
272274 projectName = '' ,
273275 buildDescription = '' ,
274276 buildTags = [ ] ;
275-
277+
276278 /* Pick from environment variables */
277279 buildName = process . env . BROWSERSTACK_BUILD_NAME || buildName ;
278280 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+
280290 /* Pick from run settings */
281291 buildName = buildName || bsConfig [ "run_settings" ] [ "build_name" ] ;
282292 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) => {
339339 projectName,
340340 buildDescription,
341341 buildTags
342- } = helper . getBuildDetails ( user_config ) ;
342+ } = helper . getBuildDetails ( user_config , true ) ;
343343 const data = {
344344 'format' : 'json' ,
345345 'project_name' : projectName ,
Original file line number Diff line number Diff line change @@ -156,14 +156,14 @@ class MyReporter {
156156 } )
157157
158158 . on ( EVENT_TEST_BEGIN , async ( test ) => {
159- if ( test . isSkipped ) return ;
159+ if ( this . runStatusMarkedHash [ test . testAnalyticsId ] ) return ;
160160 if ( this . testObservability == true ) {
161161 await this . testStarted ( test ) ;
162162 }
163163 } )
164164
165165 . on ( EVENT_TEST_END , async ( test ) => {
166- if ( test . isSkipped ) return ;
166+ if ( this . runStatusMarkedHash [ test . testAnalyticsId ] ) return ;
167167 if ( this . testObservability == true ) {
168168 if ( ! this . runStatusMarkedHash [ test . testAnalyticsId ] ) {
169169 if ( test . testAnalyticsId ) this . runStatusMarkedHash [ test . testAnalyticsId ] = true ;
@@ -448,7 +448,7 @@ class MyReporter {
448448 }
449449
450450 // Send pending hook finsihed events for hook starts
451- if ( eventType === 'TestRunFinished' ) {
451+ if ( eventType === 'TestRunFinished' || eventType === 'TestRunSkipped' ) {
452452 Object . values ( this . hooksStarted ) . forEach ( async hookData => {
453453 hookData [ 'event_type' ] = 'HookRunFinished' ;
454454 hookData [ 'hook_run' ] = {
You can’t perform that action at this time.
0 commit comments