If an execute function is invoked with a reference to a variable from the DalekJS scope, no error is thrown and DalekJS simply hangs.
var selectors = require('selectors.js');
// Hangs
test.open('http://adomain.com')
.execute(function () {
var totalCost = window.document.querySelector(selectors.total_cost);
this.assert.ok(totalCost.innerText === '20.00', 'Total Cost is correctly formatted');
})
.done();
// Completes Successfully
test.open('http://adomain.com')
.execute(function (totalCostSelector) {
var totalCost = window.document.querySelector(totalCostSelector);
this.assert.ok(totalCost.innerText === '20.00', 'Total Cost is correctly formatted');
}, selectors.total_cost)
.done();
It would be a better developer experience if DalekJS would throw an error with the exact nature of this problem.
Even though the documentation alludes to that execute can be called with parameters, it doesn't explain why that would be necessarily. Will submit a pull request for this for clarification.
If an
execute
function is invoked with a reference to a variable from the DalekJS scope, no error is thrown and DalekJS simply hangs.It would be a better developer experience if DalekJS would throw an error with the exact nature of this problem.
Even though the documentation alludes to that
execute
can be called with parameters, it doesn't explain why that would be necessarily. Will submit a pull request for this for clarification.