Closed Bug 805953 Opened 12 years ago Closed 12 years ago

create a shared function to determine account tree row to click for account manager test files, instead of each test hardcoding its own assumptions

Categories

(Thunderbird :: Testing Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 19.0

People

(Reporter: aceman, Assigned: aceman)

References

Details

Attachments

(1 file)

As seen in bug 749200, some tests in mail/test/mozmill/account do not properly determine which row to click in the account manager tree. They use hardcoded values or depend on account order or have assumptions that may not be met after future changes.

In this bug I propose to move the function test-archive-options.js::get_account_tree_row() into mail/test/mozmill/shared-modules/test-account-manager-helpers.js and make use of it in all of the mail/test/mozmill/account tests. They already import this module. While they do not fail now, they may break anytime in the future. So I propose to make them more robust beforehand.
Depends on: 749200
Blocks: 525024
Attached patch patchSplinter Review
Preliminary patch to show what this intends to do.
Attachment #675957 - Flags: review?(mconley)
Status: NEW → ASSIGNED
Comment on attachment 675957 [details] [diff] [review]
patch

Review of attachment 675957 [details] [diff] [review]:
-----------------------------------------------------------------

This looks good - glad to see us chucking out repetitive code. So, am I to understand that all of our Mozmill tests automatically have access to Services and MailServices? When did that happen?

::: mail/test/mozmill/account/test-ab-whitelist.js
@@ +29,5 @@
>    amh.installInto(module);
>  
>    let server = MailServices.accounts
>                             .FindServer("tinderbox", "tinderbox", "pop3");
> +  gAccount = MailServices.accounts.FindAccountForServer(server);

So, MailServices is already available in this scope, and we don't need to re-import it? When did that happen?
Comment on attachment 675957 [details] [diff] [review]
patch

Review of attachment 675957 [details] [diff] [review]:
-----------------------------------------------------------------

Yep, looks good. Thanks aceman!
Attachment #675957 - Flags: review?(mconley) → review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/9aa8346533dd
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 19.0
Blocks: 817390
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: