Closed
Bug 502159
Opened 16 years ago
Closed 16 years ago
[mozmill] - Choose your preferred language for display
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aakashd, Assigned: aakashd)
References
()
Details
Attachments
(1 file, 1 obsolete file)
4.49 KB,
patch
|
whimboo
:
review-
|
Details | Diff | Splinter Review |
This testscript set the italian language as the primary languages. Then, verifies the google home page shows italian elements and clears the changes made to the profile.
Litmus test case represented:
* Testcase ID #6282 - Choose your preferred language for display
Attachment #386691 -
Flags: review?(hskupin)
Updated•16 years ago
|
Comment 1•16 years ago
|
||
Comment on attachment 386691 [details]
testPreferences/testSetLanguages.js
>var MODULE_REQUIRES = ['PrefsAPI','UtilsAPI', 'ModalDialogAPI'];
Nit: Can you please give them an alphabetical ordering?
>/**
> * Testcase ID #6282 - Choose your preferred language for display
> */
As what I have noticed we should move this three lines up between the license and module inclusion. As reference see all the updated tests in the repository.
> // Call options dialog window and set primary language to Italian
It is a dialog or a window. I cannot be both at the same time. Please always use dialog.
> controller.assertNode(new elementslib.Link(controller.tabs.activeTab, "Google.com in English"));
This link cannot be found. It is different for your living area. You should use "Preferenze" instead.
> UtilsAPI.delayedAssertNode(controller,new elementslib.ID(controller.window.document, "chooseLanguage"));
>
> // Call language dialog and set Italian as primary language
> var md = new ModalDialogAPI.modalDialog(langHandler);
> md.start();
>
> controller.click(new elementslib.ID(controller.window.document, "chooseLanguage"));
delayedAssertNode is not necessary here. Just use a waitForElement and move it right before the click function. chooseLanguage should be a new variable.
> // Close the Preferences window
> controller.keypress(null, 'VK_ESCAPE', {});
Aakash, please test your Mozmill test under Windows too before you request a review. This way it will not work on Windows because the changes are only taken when you press the ok button.
> controller.click(langDropDown);
> controller.keypress(langDropDown, "i", {});
> controller.keypress(langDropDown, "t", {});
Can you please use type with the full "Italian" string? Otherwise the test will fail if another locale is added before Italian.
> // Save and close the languages dialog window
> controller.click(new elementslib.Lookup(controller.window.document, '/id("LanguagesDialog")/anon({"anonid":"dlg-buttons"})/{"dlgtype":"accept","icon":"accept","label":"OK","default":"true"}'));
Please remove everything except the dlgtype attribute from the last lookup element.
>var prefDialogClearCallBack = function(controller) {
>
> var md = new ModalDialogAPI.modalDialog(langClearHandler);
> md.start();
>
> controller.click(new elementslib.ID(controller.window.document, "chooseLanguage"));
Please wait for the element before you click. Just for safety...
> // Close the Preferences window
> controller.keypress(null, 'VK_ESCAPE', {});
Same as above.
>var langClearHandler = function(controller) {
>
> controller.click(new elementslib.ID(controller.window.document, "remove"));
Wait here too.
> // Save and close the languages dialog window
> controller.click(new elementslib.Lookup(controller.window.document, '/id("LanguagesDialog")/anon({"anonid":"dlg-buttons"})/{"dlgtype":"accept","icon":"accept","label":"OK","default":"true"}'));
Same as above.
And further please add a teardownModule function where you reset the pref "intl.accept_languages". Just to make sure we really reset the changes if the test fails at some stage.
Attachment #386691 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 2•16 years ago
|
||
All changes made except for keypresses "i" then "t". The reason is that I've tried .click, .type, .select and 2 other work-around methods to get the drop down in the languages dialog to work without any success. This works for now and we'll find a better method in the future via other testscripts that use this sort of functionality as well.
Attachment #386691 -
Attachment is obsolete: true
Attachment #387004 -
Flags: review?(hskupin)
Comment 3•16 years ago
|
||
Comment on attachment 387004 [details] [diff] [review]
testSetLanguages.js
Not all changes have been made as requested. See below. I have already made those updates while testing. So no further work for you.
> controller.waitForElement(new elementslib.ID(controller.window.document, "chooseLanguage"));
>
> // Call language dialog and set Italian as primary language
> var md = new ModalDialogAPI.modalDialog(langHandler);
> md.start();
>
> controller.waitThenClick(new elementslib.ID(controller.window.document, "chooseLanguage"));
You wait twice now. I have removed the waitForElement call.
> controller.click(langDropDown);
> controller.keypress(langDropDown, "i", {});
> controller.keypress(langDropDown, "t", {});
> controller.click(new elementslib.ID(controller.window.document, "addButton"));
It doesn't hurt to add two more keypresses here. With "ital" we will be safe. Further while testing I have noticed that you should always use a small sleep value after each keypress. Without those we are too fast and the key events are not noticed. Also we have to wait until the addButton has been enabled before clicking on it.
> // Save and close the languages dialog window
> controller.click(new elementslib.Lookup(controller.window.document, '/id("LanguagesDialog")/anon({"anonid":"dlg-buttons"})/{"dlgtype":"accept","icon":"accept","label":"OK","default":"true"}'));
There is still the label present. Any attribute except the dlgType can be removed.
Attachment #387004 -
Flags: review?(hskupin) → review-
Comment 4•16 years ago
|
||
Checked-in as: http://hg.mozilla.org/qa/mozmill-tests/rev/b57cff67f85a
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 5•16 years ago
|
||
I had to push a little fix. On Windows the test fails because we don't wait for the Content pane button before clicking on it.
http://hg.mozilla.org/qa/mozmill-tests/rev/48e734cf462d
Comment 6•15 years ago
|
||
An update for this test has been pushed with the patch on bug 513215. Due to the time it takes to display the language dialog we fetched the preferences dialog again instead of the language dialog. With a further delay this test works now.
Comment 7•14 years ago
|
||
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: Preferences → Mozmill Tests
Product: Firefox → Mozilla QA
QA Contact: preferences → mozmill-tests
Version: Trunk → unspecified
Updated•6 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•