Closed Bug 1050562 Opened 10 years ago Closed 10 years ago

[spartacus] make errors within casper.evaluate() show up in test logs

Categories

(Marketplace Graveyard :: Payments/Refunds, defect, P3)

Avenir
x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kumar, Assigned: mstriemer)

Details

(Whiteboard: [qa-][repoman])

When writing spartacus tests you have to sometimes inject javascript into the page. You do this by calling:

casper.evaluate(function() {
  // Execute brave javascript that cannot fail.
});

This is great if you write pristine code. If you write code that raises an exception, however, the error will not show up in the test console. LET'S FIX THIS. It is painful and difficult to track down. The most common problem is when you try to access a closure-scope variable (like you would in normal javascript) because that's not allowed within this mutant callback.
Blocks: 837289
Whiteboard: [qa-][repoman]
Priority: -- → P3
Thanks Dethe! As an example, you could throw an exception within this casper callback https://github.com/mozilla/spartacus/blob/master/tests/helpers.js#L239 and run `grunt uitest --test tests/ui/test-enter-pin-200.js`
oh, heh, I thought you self-assigned the bug when I read the change email :) Thanks still for prioritizing
Thanks, Kumar, that's helpful. I may take this on once I've closed some other things, if no-one gets to it first.
No longer blocks: 837289
Assignee: nobody → kumar.mcmillan
https://github.com/mozilla/spartacus/commit/7308811135f3e5f4b49e4e23e753e1485912b44b
Assignee: kumar.mcmillan → mstriemer
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.