Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created March 25, 2013 17:35
Show Gist options
  • Save EdwardIII/5238945 to your computer and use it in GitHub Desktop.
Save EdwardIII/5238945 to your computer and use it in GitHub Desktop.
import datetime, time
from django.test import TestCase
from django.contrib.auth.models import User
from django.test.client import Client
from django.test import LiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium import webdriver
import hashlib
from models import Category, Organiser, Event, Ticket, Order, OrderLine, Guest, Buyer
class SeleniumTestCase(LiveServerTestCase):
"""
A base test case for Selenium, providing hepler methods for generating
clients and logging in profiles.
"""
def open(self, url):
self.wd.get("%s%s" % (self.live_server_url, url))
class FinderTest(SeleniumTestCase):
@classmethod
def setUpClass(cls):
#cls.selenium = webdriver.Firefox()
profile = webdriver.FirefoxProfile('/home/edward/.mozilla/firefox/2rl7im2z.default/')
cls.selenium = webdriver.Firefox(profile)
cls.selenium.implicitly_wait(3)
super(FinderTest, cls).setUpClass()
@classmethod
def tearDownClass(cls):
cls.selenium.quit()
super(FinderTest, cls).tearDownClass()
def test_order_process(self):
self.selenium.get('%s%s' % (self.live_server_url, '/'))
import time
time.sleep(300)
#self.selenium.find_element_by_xpath('//ul[@id="category"]/li:first-child]').click()
self.selenium.find_element_by_css_selector('#category li:first-child').click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment