Ticket #268 : Selenium testing for Wiki
Updated 4 months, 2 weeks ago
| Guillaume Simard | Reviewers | ||
| Basie-Dev | |||
| None | Basie SVN | ||
Created the selenium tests for the wiki application. These tests make sure that these functionalities work correctly : - Create a new wiki page - Edit a wiki page - History of wiki pages Also added a ADMIN_USERNAME and ADMIN_PASSWORD to seleniumtest.py These settings will be used by the script to log in as an admin so Selenium can create / edit wiki pages at will. I suggest creating a dummy "admin / admin" user on your local basie instance. Once again, running these tests requires actual data on your basie instance. I recommend using the random data tool.
Ran the tests several times on different data on Linux and Mac OS X.
Posted 4 months, 3 weeks ago (March 10th, 2010, 8:16 a.m.)
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 1) -
these XPaths are highly fragile and depend on the language being set to English. if I set my language to Spanish, or if we ever change the phrasing of any of these links, all these tests will fail. we should not be filtering elements by text content. (and we should be careful about checking the nested elements like in line 61 -- even though that one looks okay.) I would really try to stick to classes and ids.
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 1) -
if there are no revisions for the Wiki page, this test will always fail with an AssertionError.
Posted 4 months, 3 weeks ago (March 10th, 2010, 8:21 a.m.)
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 1) -
Exception: Timed out after 5000ms also, I keep getting timeout errors. 5000 ms seems a bit short. when I changed them all to 50000, I no longer got any timeout errors. so, might want to look into increasing that.
Review request changed
Updated 4 months, 2 weeks ago (March 11th, 2010, 10:50 a.m.)
-
- added Diff r2
Added "id"s to several hyperlinks to make sure the tests are more robust.
Posted 4 months, 2 weeks ago (March 12th, 2010, 12:49 p.m.)
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 2) -
we shouldn't be locating by 'value' (because when localized, the submit button may not read "Login") -- so give it an id.
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 2) -
as I mentioned before, I keep getting timeouts (especially on this one). Exception: Timed out after 5000ms 5 seconds is a tad short, don't you think?
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 2) -
same issue here -- create an id for this "New Page" button, and change the XPath as such.
-
/trunk/apps/wiki/templates/wiki/wiki_detail.html (Diff revision 2) -
this should be a <hr> not <hr /> -- but that was there before ;)
-
/trunk/apps/wiki/templates/wiki/wiki_history.html (Diff revision 2) -
for consistency, can we use quotation marks -- not apostrophes -- for the attribute value?
Review request changed
Updated 4 months, 2 weeks ago (March 15th, 2010, 12:37 p.m.)
-
- added Diff r3
Added tests for the wiki diff page Following Chris' comments : - Extracted the timeout to a constant defined in "seleniumtest.py" ( currently 10 seconds ) - Made sure to use quotation marks instead of apostrophes when defining ids within HTML pages
Posted 4 months, 2 weeks ago (March 15th, 2010, 12:41 p.m.)
You accidentally included /trunk/basie/templates/base.html in your patch.
Posted 4 months, 2 weeks ago (March 15th, 2010, 3:07 p.m.)
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 3) -
tr[1]
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 3) -
tr[1]
-
/trunk/apps/selenium/tests/test_wiki.py (Diff revision 3) -
I kept getting failed tests because this XPath expression matches all the anchor children in every table row -- `tr` should be `tr[1]` if you want to select only the first row's anchor.
Review request changed
Updated 4 months, 2 weeks ago (March 15th, 2010, 6:58 p.m.)
-
- added Diff r4
Added tr[1] where needed ( I did not have any issues with this but it seemed to be causing problems on Chris' setup. I'm still not 100% certain as to why. ) Made sure that "/trunk/basie/templates/base.html" was modified from the latest version.
