Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute hangs when accessing variables from DalekJS scope #118

Open
hadynz opened this issue Jul 10, 2014 · 2 comments
Open

Execute hangs when accessing variables from DalekJS scope #118

hadynz opened this issue Jul 10, 2014 · 2 comments

Comments

@hadynz
Copy link

@hadynz hadynz commented Jul 10, 2014

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.

@asciidisco asciidisco self-assigned this Jul 23, 2014
@asciidisco
Copy link
Member

@asciidisco asciidisco commented Jul 23, 2014

The problem/situation should be made more obvious in the docs.

@askilada
Copy link

@askilada askilada commented Jan 29, 2015

What is the status for this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants