Review Board 1.0.5.1

Ticket #277 : Selenium testing for the about page

Updated 3 months, 3 weeks ago

Guillaume Simard Reviewers
Basie-Dev
None Basie SVN
Test for about page (Ticket # 277 https://basieproject.org/stable/basie/basie/tickets/277/ )

This Selenium test requires you to have at least a project on your basie server. I recommend using the random tool generator.
Ran the tests on various configurations.

Running the test should be as simple as running " python test_about.py "
Review request changed
Updated 4 months, 3 weeks ago (March 8th, 2010, 11:30 a.m.)
  • Test for about page (Ticket # 277 https://basieproject.org/stable/basie/basie/tickets/277/ )
    
    This Selenium tests require you to have at least a project on your basie server. I recommend running the random tool generator.

    Test for about page (Ticket # 277 https://basieproject.org/stable/basie/basie/tickets/277/ )
    
    This Selenium test requires you to have at least a project on your basie server. I recommend using the random tool generator.
Posted 4 months, 2 weeks ago (March 11th, 2010, 5:23 a.m.)
>This Selenium tests require you to have at least a project on your basie server...
Question: is there a way to run selenium against a test database, like django does for all of the non-selenium tests, with a predefined fixture set?
Google gave me that http://pypi.python.org/pypi/django-selenium-test-runner/0.1.0 but there might be other solutions out there.
  1. Sure, it could be possible. But it is not required.
    I think that this way, the tests are closer to being run on an actual set of data. Creating a test database would add to the process of running tests.
    
    Right now, the tests are very flexible and make sure that the behaviour is the right one, no matter the data.
Review request changed
Updated 4 months, 2 weeks ago (March 11th, 2010, 11:21 a.m.)
Added "id" to various HTML elements to make sure the tests are robust.
Review request changed
Updated 4 months, 2 weeks ago (March 15th, 2010, 1:04 p.m.)
Changed the tests so they still work now that the "About" link in the navigation bar is gone.
Extracted the timeouts to a constant that you need to define within "seleniumtest.py" ( see the review for wiki test )
Ship it!
Posted 4 months, 1 week ago (March 23rd, 2010, 4:53 a.m.)
I'm having problems easily patching this. Can you update this patch to the latest revision?
can we use quotation marks instead of apostrophes?
  1. Sure
why are we testing that these headings exist? why would they not exist? and what if we get rid of them?
  1. What else is there to test within the page ?
    
    The point of every test for the about app is to make sure that the most important information is contained within the page. There isn't much else I can do.
    Let me know if you have a better suggestion.
  2. IMO, instead of testing the <h3> headings, we could just as easily test one of the following:
    
    - the head_title
    - the value of the current page according to breadcrumbs
    - or add an id to the page's <h2>, and check if that is present
    
    The only reason an About test should fail is because either (1) the template cannot be loaded because of an exception raised or (2) if someone changed the HTML such that it caused an XPath expression to fail.
    
    IMO, by testing one of the criteria above, the latter case should be (slightly) less likely to occur.
Posted 4 months, 1 week ago (March 23rd, 2010, 4:54 a.m.)
That was not supposed to be a "Ship it!" ;)
Review request changed
Updated 3 months, 3 weeks ago (April 6th, 2010, 12:42 p.m.)
Took into consideration Chris' comments : 

- Used double quotes instead of single quotes within html pages.
- Tested for the presence of h2[@id='basie-api'] for test_about_API instead of testing if several h3 exist.
Posted 3 months, 3 weeks ago (April 6th, 2010, 2:48 p.m.)

   

  
we don't need IDs on these <h3>s anymore
we don't need this, since about/basie.html has since been deleted
Comments should be full sentences. Period.
why should we test the URL of the MIT license link?

for consistency's sake, can we simply check for the <h2> instead? :)
Review request changed
Updated 3 months, 3 weeks ago (April 6th, 2010, 6:55 p.m.)
Took into consideration Chris' comments.
Ship it!
Posted 3 months, 3 weeks ago (April 6th, 2010, 7:21 p.m.)
lol FYI, I just commented on line 1 of basie.html to get your attention. there wasn't a problem with line 1 specifically. the problem was with the entire basie.html file: that About landing page has been deleted. :)

otherwise, everything looks good!
  1. I know, I just thought that since I was modifying this page, I might as well delete the line.
  2. If that's so, then why was the file included in the patch? The file has been removed from the repository. But OK, moving on...
  3. Oh.
    
    My bad, I didn't realize that the whole basie.html page had been removed from the repository.. I don't know why svn didn't warn me about that conflict...
    I thought the issue was only about the line !
    
    My bad, I'll revert it.