You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`wss://cdp.browserstack.com/puppeteer?caps=${encodeURIComponent(JSON.stringify(caps))}`,// The BrowserStack CDP endpoint gives you a `browser` instance based on the `caps` that you specified
19
19
});
20
20
21
21
/*
22
-
* BrowserStack specific code ends here
22
+
* The BrowserStack specific code ends here. Following this line is your test script.
23
+
* Here, we have a simple script that opens google.com, searches for the word BrowserStack and asserts the result.
awaitpage.evaluate(_=>{},`browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Title did not match'}})}`);
38
39
}
39
-
awaitbrowser.close();
40
+
awaitbrowser.close();// At the end of each of your tests, you must close the browser so that BrowserStack knows when to end the session.
browserWSEndpoint:`wss://cdp.browserstack.com/puppeteer?caps=${encodeURIComponent(JSON.stringify(cap))}`,// The BrowserStack CDP endpoint gives you a `browser` instance based on the `caps` that you specified
11
11
});
12
-
12
+
/*
13
+
* The BrowserStack specific code ends here. Following this line is your test script.
14
+
* Here, we have a simple script that opens google.com, searches for the word BrowserStack and asserts the result.
15
+
*/
13
16
constpage=awaitbrowser.newPage();
14
17
awaitpage.goto('https://www.duckduckgo.com');
15
18
constelement=awaitpage.$('[name="q"]');
@@ -32,23 +35,23 @@ const main = async (cap) => {
32
35
constcapabilities=[
33
36
{
34
37
'browser': 'chrome',
35
-
'browser_version': 'latest',
38
+
'browser_version': 'latest',// We support chrome v72 and above. You can choose `latest`, `latest-beta`, `latest-1`, `latest-2` and so on, in this capability
36
39
'os': 'osx',
37
40
'os_version': 'catalina',
38
-
'name': 'Chrome latest on Catalina',
41
+
'name': 'Chrome latest on Catalina',// The name of your test and build. See browserstack.com/docs/automate/puppeteer/organize-tests for more details
39
42
'build': 'puppeteer-build-2'
40
43
},
41
44
{
42
45
'browser': 'firefox',
43
-
'browser_version': 'latest',
46
+
'browser_version': 'latest',// We support firefox v86 and above. You can choose `latest`, `latest-beta`, `latest-1`, `latest-2` and so on, in this capability
44
47
'os': 'osx',
45
48
'os_version': 'catalina',
46
49
'name': 'Firefox latest on Catalina',
47
50
'build': 'puppeteer-build-2'
48
51
},
49
52
{
50
53
'browser': 'edge',
51
-
'browser_version': 'latest',
54
+
'browser_version': 'latest',// We support edge v80 and above. You can choose `latest`, `latest-beta`, `latest-1`, `latest-2` and so on, in this capability
52
55
'os': 'osx',
53
56
'os_version': 'catalina',
54
57
'name': 'Edge latest on Catalina',
@@ -79,7 +82,7 @@ const capabilities = [
79
82
'build': 'puppeteer-build-2'
80
83
}]
81
84
82
-
// The following code loops through the capabilities array defined above and runs your code against each environment that you have specified
85
+
// The following code loops through the capabilities array defined above and runs your code against each environment that you have specified in parallel
0 commit comments