MCPcopy Create free account
hub / github.com/breck7/scroll / runTestWithCaps

Function runTestWithCaps

tests/browserstack.node.js:13–34  ·  view source on GitHub ↗
(capabilities)

Source from the content-addressed store, hash-verified

11const homePageUrl = "https://scroll.pub"
12
13async 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}
35const build = `Scroll v${version}`
36const capabilities1 = {
37 browserName: "chrome",

Callers 1

Calls 2

logMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected