schooltool-developers team mailing list archive
-
schooltool-developers team
-
Mailing list archive
-
Message #00475
Re: Experimental Selenium testing machinery
--- On Tue, 9/20/11, Justas <justas@xxxxxx> wrote:
> If you're anxious to try out the Selenium tests,
> check out https://code.launchpad.net/~justas-pov/schooltool/selenium
Justas:
I created my first stest for activity categories in the gradebook:
http://bazaar.launchpad.net/~replaceafill/schooltool.gradebook/selenium/view/head:/src/schooltool/gradebook/browser/stests/activity_categories.txt
from the original version:
http://bazaar.launchpad.net/~replaceafill/schooltool.gradebook/selenium/view/head:/src/schooltool/gradebook/browser/ftests/activity_categories.txt
My overall impression is that the new API is really easy to understand, I just took some notes that maybe we can discuss later at our meeting:
- The firefox webdriver didn't work on Ubuntu 11.04. I was getting errors with some locators that did work on Chromium. Maybe it's temporarily broken because of the changes you're making...?
- I have to use "LANG=C" in the command line or the test output is localized to Spanish. I saw this with the BasicPerson skin. Didn't check Flourish yet.
- The test I ported used non-ascii text and the runner threw me an encoding error. I solved it doing:
>>> browsers.manager......type('Calificación'.decode('utf-8'))
- I couldn't use two things I like very much in xpath: the text() function and attribute selection (//div/a/@href). I don't remember if I was using query or query_all here. I did find and use get_attribute for the last part. How could I get the text of the element?
- Using .type('2011-01-01') on a calendar leaves the calendar open and then clicking on the Submit button doesn't work. This was on the schoolyear/term forms which are not very tall. I fixed it by using .type(...) and then clicking on the day cell in the calendar. That makes the calendar dissappear.
- I couldn't find an easy way to select an option in a <select> element. Something like displayValue = [...] in testbrowser. Using .type(...) on the select worked though.
Finally, just writing this small test helped me realize of 2 issues:
- Activity categories view and Category drop-down in Add Activity forms should sort categories alphabetically
- In the /terms view, the Add Term button (+) should be an option in the refine sidebar
See you at the meeting.
Douglas
"... allí es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi
Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html
Follow ups
References