Skip to content

Commit 9eb657a

Browse files
committed
browserstack
1 parent 1af1c6b commit 9eb657a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

benchmarks/compat/tests/browserstack.test.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import browserstack from "browserstack-local";
66
import 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

1013
fastSelenium();
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.
8088
await new Promise(resolve => {
8189
bs.stop(

benchmarks/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
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",

0 commit comments

Comments
 (0)