Closed Bug 317695 Opened 20 years ago Closed 19 years ago

Bugzilla Test Suite - QA tests for Selenium

Categories

(Bugzilla :: Testing Suite, defect)

2.20
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: LpSolit, Assigned: LpSolit)

References

()

Details

Attachments

(5 files, 15 obsolete files)

1.07 KB, text/html
Details
2.28 KB, text/plain
Details
1.44 KB, text/plain
Details
1.36 KB, text/plain
Details
19.62 KB, text/plain
Details
This is the place to submit your tests for Selenium. No need to request review, no need to request approval. I will apply them myself.
Status: NEW → ASSIGNED
For those who want more information about Selenium, and especially how to write tests, go to: http://selenium.thoughtworks.com/index.html
Depends on: 317694
If you need to click a submit button which has no name nor id, you can use this trick: clickAndWait //input[@type='submit'] assuming there is only one button in the form. Else each button has a name already, so you can use it directly.
Attached file user-extensions.js 1.0.0 (2005-11-27) (obsolete) —
Implementing doLoadConfigFile() and doStoreParams() which permit you to write scripts independently of your local configuration. The parameters are stored in config.html which is in the same directory as the main file called by TestRunner.html.
(In reply to comment #3) > Implementing doLoadConfigFile() and doStoreParams() Call these functions as in the example below: loadConfigFileAndWait | &nbsp; | &nbsp; <--- "AndWait" is important, else the script goes to the next instruction before config.html is completely loaded, and misses the parameters contained in this file. storeParams | foo, bar, baz | &nbsp; <--- load and store parameters in variables having the same name. This way, you can use them later by calling ${foo}, ${bar}, ${baz}. config.html should contain all parameters which are specific to installations (such as the 'urlbase' Bugzilla parameter, which is here called 'inst').
Attached file template.html (obsolete) —
Use this template to write your scripts. The first two commands are mandatory.
Attached file template.html
err... missing "AndWait".
Attachment #204320 - Attachment is obsolete: true
Attached file SeleniumTest.pm
SeleniumTest.pm is required when running tests using runtests.pl. Note that user-extensions.js is still useful in this case.
Attached file 012qa.t (example) (obsolete) —
Here is an example of a script for runtests.pl using Selenium. And here is the output of such script: [buclin@antares bugzilla]$ ./runtests.pl -v t/012qa....1..7 ok 1 - Load query.cgi ok 2 - Check title ok 3 - Enter and check input in the short_desc field ok 4 - Recheck the input (using a different method) ok 5 - Submit request (-> buglist.cgi) ok 6 - Check title ok 7 - Make sure that no bug is returned (0 bug found) ok All tests successful.
Some more information available here: http://wiki.mozilla.org/Bugzilla:QA
As we are going to test different versions of Bugzilla, and running different DBs, I have updated 012qa.t to be independent of the installations being tested. This is better than duplicating the tests for each installation. This script requires ConfigTest.pm which will posted in a few minutes.
Attachment #204616 - Attachment is obsolete: true
Attached file ConfigTest.pm (obsolete) —
ConfigTest.pm is equivalent to config.html for TestRunner.html. This way, you can write all your .t scripts without having to think about where it will be run.
Attachment #204773 - Attachment is patch: false
print_info() should be called everytime you shift to another test or installation. 012qa.t is modified as follows: foreach my $bz_inst (@{$inst->{'220compat'}}, @{$inst->{'222compat'}}) { print_info($bz_inst); $test->open_ok(... unchanged ...); print_info() prints the time in GMT when the test is executed, the name of the installation being tested, and repeat the name of the current script (useful when you have many tests in a single script and you don't want to scroll back).
Attachment #204774 - Attachment is obsolete: true
_RSZ_ pointed me to an interesting Firefox extension, a Selenium recorder: http://seleniumrecorder.mozdev.org/ I did some basic tests and it seems pretty helpful for those who don't want to write scripts manually. Note that if you install this extension, you don't need to download Selenium separately; it's included in the extension already (except that the XPI doesn't include samples and docs).
Attached file user-extensions.js 1.0.1 (2006-01-12) (obsolete) —
Updated version including two new commands: SelectNone('locator') : unselect all options of a listbox <select> ... </select> SelectMulti('locator', 'optionList') : select several options in a list box. Read comments in the file for more information. I'm going to update the actual version on landfill too.
Attachment #204315 - Attachment is obsolete: true
Attached file user-extensions.js 2.0 (2006-01-13) (obsolete) —
Include commands created by Andrey Yegorov, see the changelog in the file. These commands permit us to do conditional testing ("if then else", "goto" and "while").
Attachment #208280 - Attachment is obsolete: true
Attached file user-extensions.js 2.1 (2006-01-14) (obsolete) —
* Version: 2.1 - 2006-01-14 LpSolit@gmail.com * Add the assertFlatText(Not)Present() functions. They work in a similar way as assertText(Not)Present() * but don't take care about newlines and consecutive whitespaces.
Attachment #208401 - Attachment is obsolete: true
Attached file version 2.2 (2006-01-15) (obsolete) —
Attachment #208446 - Attachment is obsolete: true
(In reply to comment #17) > Created an attachment (id=208553) [edit] > version 2.2 (2006-01-15) > The file I committed on landfill is slightly different. I moved your functions earlier in the code, with other doFoo functions. But I didn't change the functions themselves. So landfill is now using v2.2.
v2.2 has serious bugs (one of the function overwrites existing variables)
Attachment #208553 - Attachment is obsolete: true
Attached file targetmilestones_on_off (obsolete) —
Selenium script to test turning on/off target milestones. This is my first try at a selenium script. Hope it works ^.^
Bugzilla test suite does not seem to work in Internet Explorer Only 3 tests pass
(In reply to comment #21) > Bugzilla test suite does not seem to work in Internet Explorer > Only 3 tests pass > I know. But I haven't time to worry about.
Attachment #208760 - Attachment is obsolete: true
Attachment #208606 - Attachment is obsolete: true
Attachment #208922 - Attachment is obsolete: true
(In reply to comment #24) > Created an attachment (id=209072) [edit] > user-extensions.js, v2.3.1 (2006-01-20) > ok, landfill now points to v2.3.1.
Attached file user-extensions.js, v2.4 (2006-01-22) (obsolete) —
add 'flatlink=' which allows you to easily click on links containing newlines and several consecutive whitespaces.
Attachment #209072 - Attachment is obsolete: true
Attached file user-extensions.js, v2.5 (2006-01-23) (obsolete) —
includes assertSelect(Not)PresentOptions(select, options_list).
Attachment #209272 - Attachment is obsolete: true
please check if this work correctly when run script already on landfill
Attachment #209369 - Attachment is obsolete: true
Attachment #210126 - Flags: review?(LpSolit)
Comment on attachment 210126 [details] user-extensions.js, v2.5.1 (2006-01-30) requires no official review
Attachment #210126 - Flags: review?(LpSolit)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
No longer depends on: 317694
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.20
Version: unspecified → 2.20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: