WebDriver/Test suite

From W3C Wiki
Jump to: navigation, search

To test WebDriver, we're going to need a bunch of tests. This page lists some of the tests that must be written.

Our tests are in the web-platform-tests repository:

https://github.com/w3c/web-platform-tests

To get started with contributing, see the Test the Web Forward documentation:

http://testthewebforward.org/docs/github-101.html


We have a bunch of tests in the open source project, found here:

https://code.google.com/p/selenium/source/browse/java/client/test/org/openqa/selenium/

Many of these tests should be rewritten and included in our official test suite.


Helpful links

Import Dependencies

Python Imports Used by Tests
Command Documentation
import unittest http://docs.python.org/2/library/unittest.html
import os http://docs.python.org/2/library/os.html
import sys http://docs.python.org/2/library/sys.html

Navigation

This list is inspired by: https://code.google.com/p/selenium/source/browse/java/client/test/org/openqa/selenium/PageLoadingTest.java

See https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html#navigation-commands for the webdriver APIs under test.

Python bindings for the webdriver interfaces used in the tests include those described at:

get

  • Pages from different HTTP domains should load
  • Pages from different HTTPS domains should load
  • DIFFICULT: Test should be loaded before the next command is executed
  • DIFFICULT: Test should follow redirects sent in HTTP response headers
  • Test should follow redirects from meta refresh
  • Test should return when getting URL that does not resolve
  • Test should return when getting URL that does not connect
  • Test should return when getting a non-existent page (404)
  • DIFFICULT: Test should be able to load a page with a frameset, and wait until all frames are loaded before returning
  • DIFFICULT: Test should be able to access pages with an insecure SSL certificate
  • Test should not hang if document open call is never followed by document close call (document.write and friends)
  • Test should not wait indefinitely if an external resource fails to load

back

  • Test should be able to go back in browser history
  • When going back, test should do nothing if there is nothing go to back to
  • Test should be able to navigate back in browser history, even if page contains iframes

forward

  • Test should be able to go forward in browser history (DONE)
  • When going forward, test should do nothing if there is nothing go to forward to (DONE)

refresh

  • Test should be able to refresh a page (DONE)

User input

click

  • Test should be able to click a link to follow it
  • When clicking an anchor link, scroll position should change, but the page should not reload
  • Test should be able to click a link that updates another frame
  • (…)


Elements

  • The same element looked up different ways should be equal
  • Two different elements should not be equal
  • The same element looked up in different ways should have the same ID
  • The same element looked up with find_element and JS should have the same ID
  • (…)

Attributes

  • Test should return null when getting the value of an attribute that is not listed
  • Test should return null when getting @src of an invalid <img>
  • Test should return an absolute URL when getting @src of a valid <img>
  • Test should return an absolute URL when getting @href of a valid <a>