Add error throwing to guinea pig static page
MODIFY
lib/express/static.js
lib/express/static.js
@@ -14,7 +14,9 @@ if (_.isNull(path.resolve(__dirname).match(/build[\/\\]lib[\/\\]express$/))) {
async function guineaPigTemplate (req, res, page) {
let delay = parseInt(req.params.delay || req.query.delay || 0, 10);
+ let throwError = req.params.throwError || req.query.throwError || '';
let params = {
+ throwError,
serverTime: parseInt(Date.now() / 1000, 10),
userAgent: req.headers['user-agent'],
comment: 'None'

MODIFY
static/test/guinea-pig.html
static/test/guinea-pig.html
console.log('Hello from Appium');
console.log('Loading guinea-pig page');
console.log('Done');
+ if ('<%= throwError %>') {
+ throw new Error('JavaScript Error: <%= throwError %>');
+ }
</script>
</head>
<body>

Add error throwing to guinea pig static page