from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
import os
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8082'

from django.test.utils import override_settings
from selenium.webdriver.firefox.webdriver import WebDriver

class MySeleniumTests(LiveServerTestCase):
    fixtures = ['initial_data.json']

    @classmethod
    def setUpClass(cls):
        cls.selenium = WebDriver()
        super(MySeleniumTests, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        cls.selenium.quit()
        super(MySeleniumTests, cls).tearDownClass()

    @override_settings(DEBUG=True)
    def test_login(self):
        self.selenium.get('%s%s' % (self.live_server_url, '/accounts/login/'))
        username_input = self.selenium.find_element_by_name("login")
        username_input.send_keys('myuser')
        password_input = self.selenium.find_element_by_name("password")
        password_input.send_keys('secret')
        self.selenium.find_element_by_xpath('/html/body/div/div[1]/div/section/div/div/form/div/button').click()
        assert "myuser" in self.selenium.title.lower()

    @override_settings(DEBUG=True)
    def test_signup(self):
        self.selenium.get('%s%s' % (self.live_server_url, '/accounts/signup/'))
        username_input = self.selenium.find_element_by_name("username")
        username_input.send_keys('myuser2')
        username_input = self.selenium.find_element_by_name("email")
        username_input.send_keys('myuser@myuser.com')
        password_input = self.selenium.find_element_by_name("password1")
        password_input.send_keys('secret')
        password_input = self.selenium.find_element_by_name("password2")
        password_input.send_keys('secret')
        self.selenium.find_element_by_xpath('//*[@id="signup_form"]/button').click()
        assert "myuser" in self.selenium.title.lower()

@@ -1902,28 +1902,1130 @@
 self.selenium.title.lower()%0A
+%0A    @override_settings(DEBUG=True)%0A    def test_post_bounty(self):%0A        self.selenium.get('%25s%25s' %25 (self.live_server_url, '/accounts/login/'))%0A        username_input = self.selenium.find_element_by_name(%22login%22)%0A        username_input.send_keys('myuser')%0A        password_input = self.selenium.find_element_by_name(%22password%22)%0A        password_input.send_keys('secret')%0A        self.selenium.find_element_by_xpath('/html/body/div/div%5B1%5D/div/section/div/div/form/div/button').click()%0A        response = self.selenium.get('%25s%25s' %25 (self.live_server_url, '/post/'))%0A        username_input = self.selenium.find_element_by_name(%22issueUrl%22)%0A        username_input.send_keys('https://github.com/CoderBounty/coderbounty/issues/16')%0A        username_input = self.selenium.find_element_by_name(%22title%22)%0A        username_input.send_keys('test')%0A        username_input = self.selenium.find_element_by_name(%22content%22)%0A        username_input.send_keys('test')%0A        self.selenium.find_element_by_xpath('//*%5B@id=%22post_bounty%22%5D/div%5B2%5D/div%5B3%5D/button').click()%0A        assert %22paypal%22 in self.selenium.current_url%0A

Create a selenium test to post a bounty closes #155