-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
|
||
module.exports = function( browser, targetURL ) { | ||
'use strict'; | ||
|
||
return new Promise( async function( resolve, reject ) { | ||
|
||
const page = await browser.newPage(); | ||
page.on( 'error', msg => { | ||
page.close(); | ||
clearTimeout( id ); | ||
resolve( { result: 'error', message: msg } ); | ||
} ); | ||
page.on( 'pageerror', msg => { | ||
page.close(); | ||
clearTimeout( id ); | ||
resolve( { result: 'pageerror', message: msg } ); | ||
} ); | ||
await page.goto( targetURL ); | ||
var id = setTimeout( async function() { | ||
await page.close(); | ||
resolve( { result: 'success' } ); | ||
}, 5000 ); | ||
} ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
const testPage = require( './testPage' ); | ||
const runPage = require( './runPage' ); | ||
const puppeteer = require( 'puppeteer' ); | ||
|
||
( async () => { | ||
'use strict'; | ||
|
||
var x = await testPage( 'http://localhost/axon/axon-tests.html' ); | ||
var y = await testPage( 'http://localhost/scenery/scenery-tests.html?ea' ); | ||
console.log( 'await complete!' ); | ||
console.log( x ); | ||
console.log( y ); | ||
|
||
// var values = await Promise.all( [ | ||
// testPage( 'http://localhost/axon/axon-tests.html' ), | ||
// testPage( 'http://localhost/scenery/scenery-tests.html?ea' ) | ||
// ]); | ||
// Promise.all( [ testPage ] ).then( function( values ) { | ||
// console.log( values ); | ||
// } ); | ||
const browser = await puppeteer.launch(); | ||
|
||
// const targetURL = 'http://localhost/scenery/scenery-tests.html?ea'; | ||
// await testPage( 'http://localhost/axon/axon-tests.html' ); | ||
var x = await testPage( browser, 'http://localhost/axon/axon-tests.html' ); | ||
console.log( x ); | ||
var z = await runPage( browser, 'http://localhost/faradays-law/faradays-law_en.html?brand=phet&ea&fuzzMouse' ); | ||
console.log( z ); | ||
browser.close(); | ||
} )(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters