Mozmill test for IMIP bar

Published by: 0

There was a change in the planned routine in last week.  Mohit and I decided to poke into mozmill testing of IMIP bar though it was scheduled to latter stages of the project.

Bug for the test is here.

I had to look into mozmill automated testing API in order to write the test. Mozmill contains with some modules shared between firefox,  thunderbird and specific util modules for lightning. Mozmill thunderbird helper classes provide access to control utilities in thunderbird  while calendar utility classes provide ability to manage with events.

The automated test needed to inject a mail containing an invitation to check whether the IMIP bar is loaded and buttons are displayed. Then accept the event and make sure it is added at the correct location in the calendar view.

Source for the test is here.

In order to attach the invitation (invite.ics) to the email, I had to use thunderbird’s attchment-helpers module along with some other modules from tb as well.

There were few hard cases. First imip bar didn’t showed up and the attachment was showed up in the body. Once going through related RFCs, could find that, it was a some theoretical matter of adding the attachment header as defined in RFC.

Again, it was automatically clicking on “Don’t send email notifications” in the Email notification sending dialog box which appears once it’s clicked on the accept invitation button. gMockPromptService module was pretty much helpful for that. gMockPromptService creates the dialog virtually and returns the value (we can change the return value) to the caller regardless of the context of the caller.

In debugging I found that test functions are not executed unless the function name isn’t starting with the prefix “test”. That was pretty much helpful for debugging.

Cheers!

Selection_0011

Screenshot-from-2014-05-14-2308073