@@ -17,6 +17,10 @@ function getKey (client) {
17
17
return `${ client . currentTest . module } : ${ client . currentTest . name } `
18
18
}
19
19
20
+ function shouldSkipBrowserstackReporting ( client ) {
21
+ return ! BS_USER || ! BS_KEY || client . options . selenium_port !== 80
22
+ }
23
+
20
24
/**
21
25
* Generates an object with beforeEach and afterEach functions to be added
22
26
* to every test suite. It cannot be added globably because these must be
@@ -28,7 +32,7 @@ module.exports = function sendStatus () {
28
32
return {
29
33
beforeEach ( browser , cb ) {
30
34
// avoid running if missing credentials
31
- if ( ! BS_USER || ! BS_KEY ) return cb ( )
35
+ if ( shouldSkipBrowserstackReporting ( this . client ) ) return cb ( )
32
36
// retrieve the session and save it to the map
33
37
const key = getKey ( this . client )
34
38
browser . session ( ( { sessionId } ) => {
@@ -39,7 +43,7 @@ module.exports = function sendStatus () {
39
43
40
44
afterEach ( browser , cb ) {
41
45
// avoid running if missing credentials
42
- if ( ! BS_USER || ! BS_KEY ) return cb ( )
46
+ if ( shouldSkipBrowserstackReporting ( this . client ) ) return cb ( )
43
47
const key = getKey ( this . client )
44
48
const { results } = this . client . currentTest
45
49
const sessionId = sessionMap [ key ]
0 commit comments