Skip to content

Instantly share code, notes, and snippets.

@mineta
Last active August 29, 2015 14:04
Show Gist options
  • Save mineta/c4d3d35cea3aba53eec5 to your computer and use it in GitHub Desktop.
Save mineta/c4d3d35cea3aba53eec5 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from selenium.webdriver.firefox import webdriver
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import LiveServerTestCase
class HomeNewVisitorTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.WebDriver()
self.browser.implicitly_wait(3)
def tearDown(self):
self.browser.quit()
def get_full_url(self, namespace):
return self.live_server_url + reverse(namespace)
def test_home_title(self):
self.browser.get(self.get_full_url("home"))
self.assertIn("TaskBuster", self.browser.title)
def test_h1_css(self):
self.browser.get(self.get_full_url("home"))
h1 = self.browser.find_element_by_tag_name("h1")
self.assertEqual(h1.value_of_css_property("color"),
"rgba(200, 50, 255, 1)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment