Closed Bug 531392 Opened 15 years ago Closed 15 years ago

[mozmill] Open a link in a new tab that opens in the background

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: Tobbi, Assigned: Tobbi)

References

Details

Attachments

(1 file, 2 obsolete files)

This bug is for the creation of a mozmill test for Litmus test ID #8087:Open a link in a new tab that opens in the background.

https://litmus.mozilla.org/show_test.cgi?id=8087
Tobias, can you also please add the litmus test# for Firefox 3.5? We will have to write the test for both versions.
Summary: [mozmill] mozmill test for #8087 → [mozmill] Open a link in a new tab that opens in the background
Assignee: tobbi.bugs → nobody
Component: General → Tabbed Browser
QA Contact: general → tabbed.browser
Litmus test id for 3.5 is #6045:
https://litmus.mozilla.org/show_test.cgi?id=6045
Attached file Finished test (obsolete) —
This is the finished test
Attachment #415014 - Flags: review?(hskupin)
Assignee: nobody → tobbi.bugs
Attachment #415014 - Attachment mime type: application/x-javascript → text/plain
Comment on attachment 415014 [details]
Finished test

Thanks Tobias for your first test. Let's step through some details for your first review request.

>/**
>* Litmus test #0000: Sample testcase description
>*/

This is an example entry. Can you please replace it with the test id and description of both Litmus tests? One for 3.5 and one for 3.6. Please also check the indentation of the 2nd and 3rd line.

>// Include necessary modules
>var RELATIVE_ROOT = '../../shared-modules';
>var MODULE_REQUIRES = ['PrefsAPI', 'UtilsAPI'];

>const gTimeout = 2000;

If the template has 2000 we should change that. We use 5000 per default.

>var testOpenPreferences = function() {
>  //Open the Preferences Dialogue:
>  PrefsAPI.preferencesDialog.open(checkPreference);
>}

Each test function has to represent one Litmus test. That's why please put all the tests related to the litmus test in one function and rename the function accordingly to the test

>var checkPreference = function(controller) {
>  //Ensure that Switch to tabs immediately is unchecked:
>  var switchToTabsPref = new elementslib.ID(controller.window.document,"switchToNewTabs");
>  controller.assertNotChecked(switchToTabsPref);

You can use controller.check. That will not fail if the above pref has been checked before. It's not documented right now but for usage please check bug 520761. Further you should reset this pref inside the tearDown function.

>  //Open cnn.com:
>  controller.open('http://www.cnn.com');
>  controller.waitForPageLoad();

Cnn.com is one of the websites which takes a bit longer to load. Can we simply load the Google web page and try to open Google Images in a new background tab? That will save us some seconds.

Otherwise it looks good from just checking the test. Can you rework the test with the changes above and provide a patch instead of the test itself? We can talk on IRC when you need more information.
Attachment #415014 - Flags: review?(hskupin) → review-
This patch finally fixes the issues.
Attachment #415014 - Attachment is obsolete: true
Attachment #417147 - Flags: review?(hskupin)
Comment on attachment 417147 [details] [diff] [review]
followup patch addressing the issues

Tobbi, that test looks good and runs on all platforms. But we have to make some changes. I will explain it below.

>+* Litmus test #8087: Open a link in a new tab that opens in the background
>+* Litmus test #6045: Open a link in a new tab that opens in the background

We have a new mapping for litmus tests which is added at the end of the test. See the patch I upload soon.

>+  controller.rightClick(googleImagesLink);
>+  controller.click(contextMenuItem);

We would also have to test for middle click.
Attachment #417147 - Flags: review?(hskupin) → review-
Comment on attachment 417826 [details] [diff] [review]
Patch (enhanced)

This patch changes the following items:

* Adds the meta assignment at the bottom
* Adds a new helper function to UtilsAPI to close the context menu which stays open
* Adds a test for middle click
* Fixes some white space issues
* And fixes testAccessPageInfoDialog.js to close the context menu there too

I would like to have a check from Aakash before we check it into the repository.

Thanks Tobbi for the initial work here! It's really appreciated.
Attachment #417826 - Flags: review? → review?(adesai)
Attachment #417826 - Flags: review?(adesai) → review+
Comment on attachment 417826 [details] [diff] [review]
Patch (enhanced)

Code looks good and runs fine on osx and xp
Attachment #417147 - Attachment is obsolete: true
Test works without a failure. Remaining work will be done in bug 536148. Marking as verified fixed.
Group: mozilla-corporation-confidential
Status: RESOLVED → VERIFIED
Group: mozilla-corporation-confidential
Mass move of Mozmill Test related project bugs to newly created components. You can filter out those emails by using "Mozmill-Tests-to-MozillaQA" as criteria.
Component: Tabbed Browser → Mozmill Tests
Product: Firefox → Mozilla QA
QA Contact: tabbed.browser → mozmill-tests
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: