File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 55import browserstack from "browserstack-local" ;
66import webdriver from "selenium-webdriver" ;
77
8- import { runWebTest , fastSelenium } from "./utils.js"
8+ import { runWebTest , fastSelenium , App } from "./utils.js"
9+
10+ const app = new App ( ) ;
11+ app . start ( ) ;
912
1013fastSelenium ( ) ;
1114
@@ -60,11 +63,14 @@ for (const browser of BROWSERS) {
6063
6164 await runWebTest ( driver ) ;
6265
63- // Marking the test as passed for Browserstack.
66+ // Marking the test as passed for Browserstack
6467 await driver . executeScript (
6568 "browserstack_executor: {\"action\": \"setSessionStatus\", \"arguments\": {\"status\":\"passed\",\"reason\": \"Ping successfully sent!\"}}"
6669 ) ;
6770 } catch ( _ ) {
71+ // Make sure the process exits with an error code
72+ process . exitCode = 1 ;
73+ // Marking the test as failed for Browserstack
6874 await driver . executeScript (
6975 "browserstack_executor: {\"action\": \"setSessionStatus\", \"arguments\": {\"status\":\"failed\",\"reason\": \"Ping not sent :(\"}}"
7076 ) ;
@@ -76,6 +82,8 @@ for (const browser of BROWSERS) {
7682 }
7783}
7884
85+ app . stop ( ) ;
86+
7987// Stop BrowserStack.Local.
8088await new Promise ( resolve => {
8189 bs . stop (
Original file line number Diff line number Diff line change 1313 "size:docs:dry" : " DRY_RUN=1 node --experimental-json-modules size/docs.js" ,
1414 "size:docs" : " node --experimental-json-modules size/docs.js" ,
1515 "compat:glean" : " glean translate compat/metrics.yaml compat/pings.yaml -f javascript -o compat/generated" ,
16- "compat:test" : " npm run compat:glean && node --experimental-json-modules compat/tests/local.test.js"
16+ "compat:test" : " npm run compat:glean && node --experimental-json-modules compat/tests/local.test.js" ,
17+ "compat:test:browserstack" : " npm run compat:glean && node --experimental-json-modules compat/tests/browserstack.test.js"
1718 },
1819 "author" : " The Glean Team <glean-team@mozilla.com>" ,
1920 "license" : " MPL-2.0" ,
You can’t perform that action at this time.
0 commit comments