File tree Expand file tree Collapse file tree 4 files changed +39
-21
lines changed Expand file tree Collapse file tree 4 files changed +39
-21
lines changed Original file line number Diff line number Diff line change 11const puppeteer = require ( 'puppeteer-core' ) ;
22
3- const TB_KEY = process . env . TB_KEY || 'Your TestingBot Key' ;
4- const TB_SECRET = process . env . TB_SECRET || 'Your TestingBot Secret' ;
5-
63( async ( ) => {
74 console . log ( 'Launching Chrome on TestingBot...' ) ;
8-
5+ const capabilities = {
6+ 'tb:options' : {
7+ key : process . env . TB_KEY ,
8+ secret : process . env . TB_SECRET ,
9+ name : 'Puppeteer Chrome Test'
10+ } ,
11+ browserName : 'chrome' ,
12+ browserVersion : 'latest' ,
13+ platform : 'WIN10' ,
14+ } ;
915 const browser = await puppeteer . connect ( {
10- browserWSEndpoint : `wss://${ TB_KEY } : ${ TB_SECRET } @ cloud.testingbot.com/puppeteer?browserName=chrome&browserVersion=latest&platform=WIN10&name=Puppeteer-Chrome-Example&screenRecorder=true `
16+ browserWSEndpoint : `wss://cloud.testingbot.com/puppeteer?capabilities= ${ encodeURIComponent ( JSON . stringify ( capabilities ) ) } `
1117 } ) ;
1218
1319 try {
@@ -22,9 +28,9 @@ const TB_SECRET = process.env.TB_SECRET || 'Your TestingBot Secret';
2228 await page . screenshot ( { path : 'testingbot-chrome.png' } ) ;
2329 console . log ( 'Screenshot taken' ) ;
2430
25- await page . waitForSelector ( '.navbar-brand ' ) ;
31+ await page . waitForSelector ( '.navigation span ' ) ;
2632 const logoText = await page . evaluate ( ( ) => {
27- return document . querySelector ( '.navbar-brand ' ) . innerText ;
33+ return document . querySelector ( '.navigation span ' ) . innerText ;
2834 } ) ;
2935
3036 console . log ( `Found logo text: ${ logoText } ` ) ;
Original file line number Diff line number Diff line change 11const puppeteer = require ( 'puppeteer-core' ) ;
22
3- const TB_KEY = process . env . TB_KEY || 'Your TestingBot Key' ;
4- const TB_SECRET = process . env . TB_SECRET || 'Your TestingBot Secret' ;
5-
63( async ( ) => {
74 console . log ( 'Launching Edge on TestingBot...' ) ;
85
6+ const capabilities = {
7+ 'tb:options' : {
8+ key : process . env . TB_KEY ,
9+ secret : process . env . TB_SECRET ,
10+ name : 'Puppeteer Edge Test'
11+ } ,
12+ browserName : 'edge' ,
13+ browserVersion : 'latest' ,
14+ platform : 'WIN10' ,
15+ } ;
916 const browser = await puppeteer . connect ( {
10- browserWSEndpoint : `wss://${ TB_KEY } : ${ TB_SECRET } @ cloud.testingbot.com/puppeteer?browserName=edge&browserVersion=latest&platform=WIN10&name=Puppeteer-Edge-Example&screenRecorder=true `
17+ browserWSEndpoint : `wss://cloud.testingbot.com/puppeteer?capabilities= ${ encodeURIComponent ( JSON . stringify ( capabilities ) ) } `
1118 } ) ;
1219
1320 try {
@@ -22,9 +29,9 @@ const TB_SECRET = process.env.TB_SECRET || 'Your TestingBot Secret';
2229 await page . screenshot ( { path : 'testingbot-edge.png' } ) ;
2330 console . log ( 'Screenshot taken' ) ;
2431
25- await page . waitForSelector ( '.navbar-brand ' ) ;
32+ await page . waitForSelector ( '.navigation span ' ) ;
2633 const logoText = await page . evaluate ( ( ) => {
27- return document . querySelector ( '.navbar-brand ' ) . innerText ;
34+ return document . querySelector ( '.navigation span ' ) . innerText ;
2835 } ) ;
2936
3037 console . log ( `Found logo text: ${ logoText } ` ) ;
Original file line number Diff line number Diff line change 11const puppeteer = require ( 'puppeteer-core' ) ;
22
3- const TB_KEY = process . env . TB_KEY || 'Your TestingBot Key' ;
4- const TB_SECRET = process . env . TB_SECRET || 'Your TestingBot Secret' ;
5-
63( async ( ) => {
74 console . log ( 'Launching Firefox on TestingBot...' ) ;
8-
5+ const capabilities = {
6+ 'tb:options' : {
7+ key : process . env . TB_KEY ,
8+ secret : process . env . TB_SECRET ,
9+ name : 'Puppeteer Firefox Test'
10+ } ,
11+ browserName : 'firefox' ,
12+ browserVersion : 'latest' ,
13+ platform : 'WIN10' ,
14+ } ;
915 const browser = await puppeteer . connect ( {
10- browserWSEndpoint : `wss://${ TB_KEY } : ${ TB_SECRET } @ cloud.testingbot.com/puppeteer?browserName=firefox&browserVersion=latest&platform=WIN10&name=Puppeteer-Firefox-Example&screenRecorder=true `
16+ browserWSEndpoint : `wss://cloud.testingbot.com/puppeteer?capabilities= ${ encodeURIComponent ( JSON . stringify ( capabilities ) ) } `
1117 } ) ;
1218
1319 try {
@@ -22,9 +28,9 @@ const TB_SECRET = process.env.TB_SECRET || 'Your TestingBot Secret';
2228 await page . screenshot ( { path : 'testingbot-firefox.png' } ) ;
2329 console . log ( 'Screenshot taken' ) ;
2430
25- await page . waitForSelector ( '.navbar-brand ' ) ;
31+ await page . waitForSelector ( '.navigation span ' ) ;
2632 const logoText = await page . evaluate ( ( ) => {
27- return document . querySelector ( '.navbar-brand ' ) . innerText ;
33+ return document . querySelector ( '.navigation span ' ) . innerText ;
2834 } ) ;
2935
3036 console . log ( `Found logo text: ${ logoText } ` ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ exports.config = {
1717 platformName : 'WIN10' ,
1818 'tb:options' : {
1919 name : 'WebdriverIO Example Test' ,
20- screenRecorder : true ,
2120 build : 'webdriverio-testingbot-example'
2221 }
2322 } ] ,
You can’t perform that action at this time.
0 commit comments