31 lines
942 B
Python
31 lines
942 B
Python
|
from selenium import webdriver
|
||
|
import unittest
|
||
|
|
||
|
|
||
|
class NewVisitorTest(unittest.TestCase):
|
||
|
def setUp(self):
|
||
|
self.browser = webdriver.Firefox()
|
||
|
|
||
|
def tearDown(self):
|
||
|
self.browser.quit()
|
||
|
|
||
|
def test_input_integer(self):
|
||
|
# Stephan has heard about a cool new online palindromes app. He goes
|
||
|
# to check out its homepage
|
||
|
self.browser.get('http://localhost:8000')
|
||
|
# He notices the page title and header mention the name Plaindromes!
|
||
|
self.assertIn('Palindromes', self.browser.title)
|
||
|
self.fail('Finish the test!')
|
||
|
|
||
|
# He is prompted to type in an integer for which a palindrome will be calculated # noqa
|
||
|
|
||
|
# He types in an integer and hits enter to get it calculated
|
||
|
|
||
|
# The server sends back the calculated palindrome or another message
|
||
|
|
||
|
# Stephan is done for now and exits the pag
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main(warnings='ignore')
|