basic question here. I'm following a great tutorial on creating a web2py app by [Marco Laspe] (http://killer-web-development.com). But struggling with resolving a failure in my testing (using Selenium).
here is my about page...
<!DOCTYPEhtml>
<html>
<head>
<title>aaa</title>
</head>
<body>
<h1>blah</h1>
</body>
</html>
and the testing function...
def test_has_right_title(self):
title = self.browser.find_element_by_tag_name('title')
self.assertEqual('aaa', title.text)
WHen testing i get...
======================================================================
FAIL: test_has_right_title (test_static_pages.TestPrivacyPage)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\web2py\applications\pitch\fts\test_static_pages.py", line 40, in test
_has_right_title
self.assertEqual('aaa', title.text)
AssertionError: 'aaa' != u''
----------------------------------------------------------------------
Ran 10 tests in 37.497s
FAILED (failures=3)
Anyone know where i'm going wrong? The other tests are working correctly (included below)
def setUp(self):
self.url = ROOT + '/pitch/default/privacy'
get_browser=self.browser.get(self.url)
def test_can_view_privacy_page(self):
response_code = self.get_response_code(self.url)
self.assertEqual(response_code, 200)
def test_has_right_heading(self):
heading = self.browser.find_element_by_tag_name('h1')
self.assertIn('Pitch.Me Privacy Policy', heading.text)