Closed Bug 515072 Opened 10 years ago Closed 10 years ago

Enhance controller.assertJS to output relevant context for pass/fail states

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

(Whiteboard: [verified-mozmill-1.2.4][mozmill-doc-complete])

Attachments

(1 file)

Attached patch PatchSplinter Review
At the moment assertJS doesn't output any useful information in the output which could be used to track down failures in a test. As more tests you will have as more difficult it is to identify the failing assertJS call. That's why we should change the output string for this function and add the expression itself.

Therefor we could use the same way as we already have for waitForEval. Let's specify a subject if needed which can be used to get access to members.

controller.assertJS("subject.currentStep == 'updatesfound'", update);

In this example currentStep is a member variable of the update instance. If the evaluation fails you will see the following entry in the output pane:

fail :: Controller.assertJS("subject.currentStep == 'updatesfound'")
Attachment #399092 - Flags: review?(mrogers)
Mikeal, can we please get a process on this bug?
Merged to the master.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-1.2.4][mozmill-doc-needed]
No regressions seen so far. All existing assertJS calls work like expected. Marking verified.
Status: RESOLVED → VERIFIED
Whiteboard: [mozmill-1.2.4][mozmill-doc-needed] → [verified-mozmill-1.2.4][mozmill-doc-needed]
Docs are already uptodate.
Whiteboard: [verified-mozmill-1.2.4][mozmill-doc-needed] → [verified-mozmill-1.2.4][mozmill-doc-complete]
Attachment #399092 - Flags: review?(mikeal.rogers)
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.