Skip to content

Commit

Permalink
correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
omansion committed Dec 9, 2011
1 parent df77c9e commit 494cc29
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_polls.py
Original file line number Original file line Diff line number Diff line change
@@ -1,10 +1,10 @@
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
import time

from selenose.cases import SeleniumTestCase from selenose.cases import SeleniumTestCase


from djangosanetesting.cases import HttpTestCase from djangosanetesting.cases import HttpTestCase


from selenium.webdriver.support.ui import WebDriverWait

class PollsTestCase(SeleniumTestCase, HttpTestCase): class PollsTestCase(SeleniumTestCase, HttpTestCase):


def test_vote(self): def test_vote(self):
Expand All @@ -14,8 +14,10 @@ def test_vote(self):
poll = self.driver.find_element_by_link_text('How is selenose?') poll = self.driver.find_element_by_link_text('How is selenose?')
# Click on the link # Click on the link
poll.click() poll.click()
# Wait page # Load page
choices = WebDriverWait(self.driver, 5).until(lambda driver : self.driver.find_elements_by_name('choice')) time.sleep(2)
# Get the available choices
choices = self.driver.find_elements_by_name('choice')
# Check that only two choices: "Cool" and "Super cool" # Check that only two choices: "Cool" and "Super cool"
self.assertEquals(2, len(choices)) self.assertEquals(2, len(choices))
# Select "Super cool" # Select "Super cool"
Expand Down

0 comments on commit 494cc29

Please sign in to comment.