Closed
Bug 736428
Opened 12 years ago
Closed 12 years ago
Refactor Selenium IDE tests to improve setup and use assertions library
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: davehunt, Assigned: davehunt)
Details
Attachments
(1 file, 1 obsolete file)
127.35 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
Some of the earlier tests used the IDE for steps that should be in setup. This upcoming patch will make the tests consistent, and also make more use of the assertions library.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → dave.hunt
Attachment #606521 -
Flags: review?(hskupin)
Comment 2•12 years ago
|
||
Comment on attachment 606521 [details] [diff] [review] Refactor the existing Selenium IDE tests. v1.0 > // Include required modules > var selenium = require("../../../lib/selenium"); > var checks = require("../../../lib/checks"); >+var {assert} = require("../../../../../../lib/assertions"); >+var tabs = require("../../../../../../lib/tabs"); Please fix the order of requires so that they are in alphabetical order. >+ tabBrowser = new tabs.tabBrowser(controller); >+ tabBrowser.closeAllTabs(); There is no need to instantiate tabBrowser. Just call tabs.closeAllTabs(controller) >+ controller.open("chrome://selenium-ide/content/tests/functional/aut/alert.html"); >+ controller.waitForPageLoad(); > } > > function teardownModule(module) { > sm.close(); > } > > function testAssertAlertCommandFails() { >- sm.baseURL = "chrome://selenium-ide/"; >- sm.addCommand({action: "open", >- target: "/content/tests/functional/aut/alert.html"}); Can you please explain this change? It kills a test by replacing it with a setup routine. >+ assert.notEqual(sm.finalLogInfoMessage, "echo: final command"); You don't want to add a message as last parameter? Otherwise I skimmed over and the above comments will apply to each file.
Attachment #606521 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #2) > >+ controller.open("chrome://selenium-ide/content/tests/functional/aut/alert.html"); > >+ controller.waitForPageLoad(); > > } > > > > function teardownModule(module) { > > sm.close(); > > } > > > > function testAssertAlertCommandFails() { > >- sm.baseURL = "chrome://selenium-ide/"; > >- sm.addCommand({action: "open", > >- target: "/content/tests/functional/aut/alert.html"}); > > Can you please explain this change? It kills a test by replacing it with a > setup routine. How do you mean it kills a test? The open command is not what we're testing here, so I'm simply opening the test page before interacting with Selenium IDE. I believe this is how the test should be, limiting failures to the functionality being tested. > >+ assert.notEqual(sm.finalLogInfoMessage, "echo: final command"); > > You don't want to add a message as last parameter? Did you have a suggestion? I'm happy with the default failure message.
Status: NEW → ASSIGNED
Comment 4•12 years ago
|
||
(In reply to Dave Hunt (:davehunt) from comment #3) > here, so I'm simply opening the test page before interacting with Selenium > IDE. I believe this is how the test should be, limiting failures to the > functionality being tested. Ok, so that's fine then. Thanks for the explanation. > > >+ assert.notEqual(sm.finalLogInfoMessage, "echo: final command"); > > > > You don't want to add a message as last parameter? > > Did you have a suggestion? I'm happy with the default failure message. If you are happy, then I'm too. Just leave it as it is right now.
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #2) > Comment on attachment 606521 [details] [diff] [review] > Refactor the existing Selenium IDE tests. v1.0 > > > // Include required modules > > var selenium = require("../../../lib/selenium"); > > var checks = require("../../../lib/checks"); > >+var {assert} = require("../../../../../../lib/assertions"); > >+var tabs = require("../../../../../../lib/tabs"); > > Please fix the order of requires so that they are in alphabetical order. Done. > >+ tabBrowser = new tabs.tabBrowser(controller); > >+ tabBrowser.closeAllTabs(); > > There is no need to instantiate tabBrowser. Just call > tabs.closeAllTabs(controller) Done.
Attachment #606521 -
Attachment is obsolete: true
Attachment #607152 -
Flags: review?(hskupin)
Comment 6•12 years ago
|
||
Comment on attachment 607152 [details] [diff] [review] Refactor the existing Selenium IDE tests. v1.1 Inspection didn't show up anything suspicious. Looks good and is ready to get landed.
Attachment #607152 -
Flags: review?(hskupin) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Landed as: http://hg.mozilla.org/qa/mozmill-tests/rev/e357d526e8f7 (default) http://hg.mozilla.org/qa/mozmill-tests/rev/8ca0036fd9d0 (mozilla-aurora) http://hg.mozilla.org/qa/mozmill-tests/rev/baeb29de1784 (mozilla-beta) http://hg.mozilla.org/qa/mozmill-tests/rev/b33d22be61c1 (mozilla-release) http://hg.mozilla.org/qa/mozmill-tests/rev/51c5b4b8114c (mozilla-esr10)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•5 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
•