Closed Bug 678628 Opened 8 years ago Closed 8 years ago

Allow TPS to run mozmill tests

Categories

(Testing Graveyard :: TPS, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jgriffin, Assigned: jgriffin)

References

Details

Attachments

(1 file)

TPS should be able to run mozmill tests, with different TPS phases associated with different mozmill test functions.
Specifically, it'd be great to test UI interaction (the pref dialog, the quota dialog, the error notifications) etc.
This patch allows TPS to run mozmill tests.  A trivial example is included, test_mozmill_sanity.js, which runs two separate mozmill tests, one during each phase of the test.

I'll update MDN TPS docs with pointers to more examples from the QA and Thunderbird repos.

I'm including a stripped down version of the mozmill extension in this patch because the current version on trunk is very outdated, and scheduled to be removed entirely.
Attachment #554160 - Flags: review?(philipp)
Comment on attachment 554160 [details] [diff] [review]
allow TPS to run mozmill tests

Great stuff! This is awesome, this means we can start writing UI tests as part of TPS. How would we write Mozmill tests that interact with Sync? For instance, how would we best trigger a sync from a Mozmill test?

>diff --git a/services/sync/tests/tps/mozmill_sanity2.js b/services/sync/tests/tps/mozmill_sanity2.js
>new file mode 100644
>--- /dev/null
>+++ b/services/sync/tests/tps/mozmill_sanity2.js
>@@ -0,0 +1,22 @@
>+/* Any copyright is dedicated to the Public Domain.
>+   http://creativecommons.org/publicdomain/zero/1.0/ */
>+
>+var setupModule = function(module) {
>+  module.controller = mozmill.getBrowserController();
>+};
>+
>+var testController = function() {
>+  controller.open("http://www.mozilla.org");
>+  controller.waitForPageLoad();
>+  
>+  var about = new elementslib.Link(controller.tabs.activeTab, "About Us");
>+  controller.click(about);
>+  controller.waitForPageLoad();
>+
>+  var textbox = new elementslib.Elem(controller.tabs.activeTab.getElementById("q"));
>+  var button = new elementslib.ID(controller.tabs.activeTab, "quick-search-btn");
>+  
>+  dump("Textbox ID: " + textbox.getNode().id + "\n");
>+  controller.type(textbox, "mozmill");
>+  controller.click(button);
>+};

Not sure how I feel making a test against the actual mozilla.org homepage... Doing it against about:home, about:robots or another locally hosted page would seem better.
Attachment #554160 - Flags: review?(philipp) → feedback+
(In reply to Philipp von Weitershausen [:philikon] from comment #3)
> Comment on attachment 554160 [details] [diff] [review]
> allow TPS to run mozmill tests
> 
> Great stuff! This is awesome, this means we can start writing UI tests as
> part of TPS. How would we write Mozmill tests that interact with Sync? For
> instance, how would we best trigger a sync from a Mozmill test?

Right now, if you want to sync before or after the mozmill portion of the test, you can just use the Sync command in the TPS "wrapper", e.g.:

Phase('phase1', [
  [RunMozmillTest, 'mozmill_sanity.js'],
  [Sync, SYNC_WIPE_SERVER]
]);

However, I'll add a follow-up patch to expose some Sync abilities directly to Mozmill tests themselves.
 
> Not sure how I feel making a test against the actual mozilla.org homepage...
> Doing it against about:home, about:robots or another locally hosted page
> would seem better.

I've udpated it to use about:support.

Landed as http://hg.mozilla.org/services/services-central/rev/51fb40284211.

You'll need to re-install TPS (using INSTALL.sh) after picking up this change.
Depends on: 681067
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Why did we check in a separate copy of mozmill in our directory? What's wrong with the version at /testing/mozmill/? It seems silly to have multiple copies in the same repository.
(In reply to Gregory Szorc [:gps] from comment #5)
> Why did we check in a separate copy of mozmill in our directory? What's
> wrong with the version at /testing/mozmill/? It seems silly to have multiple
> copies in the same repository.

From comment #2: 

I'm including a stripped down version of the mozmill extension in this patch because the current version on trunk is very outdated, and scheduled to be removed entirely.
(In reply to Jonathan Griffin (:jgriffin) from comment #6)
> (In reply to Gregory Szorc [:gps] from comment #5)
> > Why did we check in a separate copy of mozmill in our directory? What's
> > wrong with the version at /testing/mozmill/? It seems silly to have multiple
> > copies in the same repository.
> 
> From comment #2: 
> 
> I'm including a stripped down version of the mozmill extension in this patch
> because the current version on trunk is very outdated, and scheduled to be
> removed entirely.

So did this land, do you need anything else in testing/mozmill?  Cause I'd like to move ahead with that deletion.
(In reply to Clint Talbert ( :ctalbert ) Out Aug 8 - Aug 15 from comment #7)
> 
> So did this land, do you need anything else in testing/mozmill?  Cause I'd
> like to move ahead with that deletion.

Yes it landed, and no I don't need anything from it.
Component: General → TPS
QA Contact: general → tps
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.