-
Notifications
You must be signed in to change notification settings - Fork 610
Open
Description
Hi,
according to Chromy documentation, something like this should be possible:
const Chromy = require('chromy')
async function main () {
let chromy = new Chromy()
await chromy.goto('http://example.com/')
const result = await chromy.evaluate(() => {
return document.querySelectorAll('*').length
})
console.log(result)
await chromy.close()
}
main()
Therefor I would expect something like this should be possible within BackstopJs:
async function myFunction(chromy, scenario, vp) {
const result = await chromy.evaluate(() => {
return document.querySelectorAll('*').length
})
console.log(result)
};
module.exports = myFunction;
But I am getting this error:
(node:15120) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: 'then' is not defined on a target object.
(node:15120) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Any idea what I might doing wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels