Current selenium test coverage

Located at source:testing/trunk/testbed (and takes ~85 min to run)

  • login
  • logout
  • create a module
  • create a collection
  • publish a module
  • publish a collection
  • add a module to a collection
  • create a workgroup
  • add users to a workgroup
  • checkout published module/collection
  • change account passwords
  • update account information
  • import a cnxml file into a module
  • import a latex zip file into a module
  • import a word file into a module
  • import a module export zip into a module
  • edit My Favorites lens properties
  • create and add content to a branded lens
  • create a derived copy module
  • create a derived copy collection
  • suggest an edit for a module
  • create a endorsement lens and make entries
  • create a affiliation lens and make entries
  • create a membership lens and make entries
  • create a private lens and make entries
  • make lens entries from a module within a course context
  • create and accept role request
  • browse content
  • express edit (un-release feature)

Directory structure

In r31996 we created the folder for all Selenium tests, svn+ssh://software.cnx.rice.edu/testing/trunk/testbed, which contains.

  • /accounts
  • /lenses/siyavula
  • /content
  • /browse-search (TBD)
  • /milestones/lwb.py
  • /bugfix/ticket-1234.py
  • all.py
  • selenium.py

These directories only have pyUnit tests. (Selenium HTML tests can remain in testing/selenium.) The all.py file at the root directory is the master test driver. Subdirectories will also include an all.py file, which encapsulates all of the pyUnit tests in that directory.

Running the Selenium Test Bed from Buildout

You can run the following from an already run buildout to start up the necessary servers to run ( Xvfb and the seleniumrc)

./bin/buildout -c devel.cfg install test-selenium-setup test-selenium
./bin/test-selenium
./bin/buildout -c devel.cfg install test-selenium-teardown

Running the Selenium Test Bed Manually

  1. Start the Selenium RC host which can be downloaded from Selenium Downloads. After unzipping this download, you should have access to a selenium-server.jar file. The following command will start the Selenium RC: java -jar selenium-server.jar. The Selenium RC host uses port 4444.
  2. The Selenium Test Bed can be started from the testing/testbed directory with either nosetest or via scripts generated by buildout:
    • using nose directly (if you have it installed)
      cd./src/testbed
      ./test.bash <test parameters> <1 or more tests to run>
      
    • or from a script generated by buildout:
      ./bin/test-selenium  # Followed by optional nosetest arguments
      

./test.bash first parameter is a python dictionary string, which contains a set of key value pairs. For example,

"{ 'host':'stevens.cnx.rice.edu', 'browser':'firefox', 'url':'http://bread.cnx.rice.edu:8080/', 'sitetype':'rhaptos' }"

The host argument is the net address of the Selenium RC host that you started. The browser argument is the name of the browser with which you wish to test. The url argument is the net address of the rhaptos instances with which you wish to test. The site type argument is either 'rhaptos' or 'cnx'.

The remaining parameters specify which tests to run. If no tests are specified, nosetest will search out the tests itself. Test specification take the form

  • all of the test files (files ending in '_test.py') in the folder testbed/accounts
    testbed.accounts
    
  • all of the tests in one file
    testbed.accounts.my_favorites_test
    
  • one test in one file (note the final separator is ':' and not '.')
    testbed.accounts.my_favorites_test:testEditMyFavorites
    

Functional Tests To Write

Selenium Tests

  • Home Page
    • Featured
    • Spotlight
    • Search
  • Lenses
    • Delete content from a lens
  • MyCNX
    • left nav links
    • derived copy
    • roles on a module
  • Imports - Need to determine where to store test files
  • Content
    • roles

Tests by functionality that were requested as part of Enterprise Rhaptos development

These should all be addressed when possible because they represent important functionality that should not break with new features.

  • create a user account (rfp, email)
  • create a workgroup (rfp only) (simple as of r32080 in testing/testbed, phil)
  • publish a module (rfp, email) (simple as of r32705 in testing/testbed, phil)
  • publish a collection (rfp, email) (simple as of r32705 in testing/testbed, phil)
  • create a lens (rfp only)
  • add published content to the lens including tags and comments (rfp only)
  • import a Word document (rfp, email)
  • import a LaTeX document (rfp, email)
  • import a zip file (email only)
  • checkout a module, (rfp, email)
  • checkout a collection, (rfp, email)
  • view unpublished module export zip (email only)
  • browse content (rfp only)
  • search content, (rfp only)
  • view the home page (rfp only)
  • and help pages, (rfp only)
  • view various test modules and collections (rfp, email)
  • view lenses, (rfp only)
  • perform an OpenSearch?, (rfp, email)
  • ask for metadata using the published OAI-PMH (OpenArchivesHarvesting ), (rfp, email)
  • perform an OAI-PMH extension SearchRecords? search (email only)
  • ask for Atom and RSS feeds (https://trac.rhaptos.org/trac/rhaptos/wiki/RSSFeeds), (rfp, email)
  • request (URL-based) module source (rfp, email)
  • request module PDFs, collection PDFs and collection multimedia zip files. (rfp only)

Tests to write from ComponentizedTestPlans.txt

These were originally written up by Jenn. An outline is available at ComponentizedTestPlans and the source document is at source:testing/trunk/testplans/ComponentizedTestPlans.txt