mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Fix tests and puppeteer shim after c08f1447
This patch: - fixes require statements inside bin/puppeteer.js - fixes phantom's run_tests.py to correctly refer to puppeteer
This commit is contained in:
parent
e05fd8c7b9
commit
6c0e3ebe3e
@ -18,7 +18,9 @@
|
||||
var vm = require('vm');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var Puppeteer = require('..').Browser;
|
||||
var Browser = require('..').Browser;
|
||||
var PhatomJs = require('../phantomjs');
|
||||
var version = require('../package.json').version;
|
||||
var argv = require('minimist')(process.argv.slice(2), {
|
||||
alias: { v: 'version' },
|
||||
boolean: ['headless'],
|
||||
@ -26,7 +28,7 @@ var argv = require('minimist')(process.argv.slice(2), {
|
||||
});
|
||||
|
||||
if (argv.version) {
|
||||
console.log('Puppeteer v' + require('./package.json').version);
|
||||
console.log('Puppeteer v' + version);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -54,7 +56,6 @@ var browser = new Browser({
|
||||
headless: argv.headless,
|
||||
});
|
||||
|
||||
var PhatomJs = require('./phantomjs');
|
||||
var context = PhatomJs.createContext(browser, scriptPath, argv);
|
||||
var scriptContent = fs.readFileSync(scriptPath, 'utf8');
|
||||
vm.runInContext(scriptContent, context);
|
||||
|
2
third_party/phantomjs/test/run-tests.py
vendored
2
third_party/phantomjs/test/run-tests.py
vendored
@ -977,7 +977,7 @@ class TestRunner(object):
|
||||
|
||||
def init():
|
||||
base_path = os.path.normpath(os.path.dirname(os.path.abspath(__file__)))
|
||||
phantomjs_exe = os.path.normpath(base_path + '/../../../index.js')
|
||||
phantomjs_exe = os.path.normpath(base_path + '/../../../bin/puppeteer.js')
|
||||
if not os.path.isfile(phantomjs_exe):
|
||||
sys.stdout.write("{} is unavailable, cannot run tests.\n"
|
||||
.format(phantomjs_exe))
|
||||
|
Loading…
Reference in New Issue
Block a user