(capabilities)
| 11 | const homePageUrl = "https://scroll.pub" |
| 12 | |
| 13 | async function runTestWithCaps(capabilities) { |
| 14 | try { |
| 15 | let driver = new webdriver.Builder() |
| 16 | .usingServer(`http://${userName}:${accessKey}@hub-cloud.browserstack.com/wd/hub`) |
| 17 | .withCapabilities(capabilities) |
| 18 | .build() |
| 19 | await driver.get(homePageUrl) |
| 20 | try { |
| 21 | await driver.wait(webdriver.until.titleMatches(/Scroll/i), 5000) |
| 22 | const title = await driver.getTitle() |
| 23 | const message = `${title} v${version} loaded on ${capabilities.browserName} on ${capabilities.device ?? capabilities.os}` |
| 24 | console.log(message) |
| 25 | await driver.executeScript(`browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed","reason": "${message}"}}`) |
| 26 | } catch (err) { |
| 27 | console.error(err) |
| 28 | await driver.executeScript('browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed","reason": "Page could not load in time"}}') |
| 29 | } |
| 30 | await driver.quit() |
| 31 | } catch (err) { |
| 32 | console.error(err) |
| 33 | } |
| 34 | } |
| 35 | const build = `Scroll v${version}` |
| 36 | const capabilities1 = { |
| 37 | browserName: "chrome", |
no test coverage detected