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

RESOLVED FIXED in Thunderbird 19.0

Status

Thunderbird
Testing Infrastructure
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: aceman, Assigned: aceman)

Tracking

Trunk
Thunderbird 19.0
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Updated

5 years ago
Depends on: 749200
(Assignee)

Updated

5 years ago
Blocks: 525024
(Assignee)

Comment 1

5 years ago
Created attachment 675957 [details] [diff] [review]
patch

Preliminary patch to show what this intends to do.
Attachment #675957 - Flags: review?(mconley)
(Assignee)

Updated

5 years ago
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?
(Assignee)

Comment 3

5 years ago
https://bug726737.bugzilla.mozilla.org/attachment.cgi?id=607275
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+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/9aa8346533dd
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 19.0
(Assignee)

Updated

5 years ago
Blocks: 817390
You need to log in before you can comment on or make changes to this bug.