Last active
August 29, 2015 14:04
-
-
Save mineta/c4d3d35cea3aba53eec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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