Commit b78dd5bd authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added tests for checking hero page titles and headers

parent 58b2d792
...@@ -3,7 +3,8 @@ import unittest ...@@ -3,7 +3,8 @@ import unittest
class CheckContents(unittest.TestCase): class CheckContents(unittest.TestCase):
def check_cloud(self): def check_cloud_in_home_page(self):
self.browser.get('http://localhost:8000')
cloudName = self.browser.find_element_by_id('cloudName') cloudName = self.browser.find_element_by_id('cloudName')
self.assertEqual(cloudName.get_attribute('innerHTML'), 'Cloud') self.assertEqual(cloudName.get_attribute('innerHTML'), 'Cloud')
cloudHealth = self.browser.find_element_by_id('cloudHealth') cloudHealth = self.browser.find_element_by_id('cloudHealth')
...@@ -11,7 +12,8 @@ class CheckContents(unittest.TestCase): ...@@ -11,7 +12,8 @@ class CheckContents(unittest.TestCase):
cloudAttack = self.browser.find_element_by_id('cloudAttack') cloudAttack = self.browser.find_element_by_id('cloudAttack')
self.assertEqual(cloudAttack.get_attribute('innerHTML'), '57') self.assertEqual(cloudAttack.get_attribute('innerHTML'), '57')
def check_jester(self): def check_jester_in_home_page(self):
self.browser.get('http://localhost:8000')
jesterName = self.browser.find_element_by_id('jesterName') jesterName = self.browser.find_element_by_id('jesterName')
self.assertEqual(jesterName.get_attribute('innerHTML'), 'Jester') self.assertEqual(jesterName.get_attribute('innerHTML'), 'Jester')
jesterHealth = self.browser.find_element_by_id('jesterHealth') jesterHealth = self.browser.find_element_by_id('jesterHealth')
...@@ -19,7 +21,8 @@ class CheckContents(unittest.TestCase): ...@@ -19,7 +21,8 @@ class CheckContents(unittest.TestCase):
jesterAttack = self.browser.find_element_by_id('jesterAttack') jesterAttack = self.browser.find_element_by_id('jesterAttack')
self.assertEqual(jesterAttak.get_attribute('innerHTML'), '64') self.assertEqual(jesterAttak.get_attribute('innerHTML'), '64')
def check_sunflowey(self): def check_sunflowey_in_home_page(self):
self.browser.get('http://localhost:8000')
sunfloweyName = self.browser.find_element_by_id('sunfloweyName') sunfloweyName = self.browser.find_element_by_id('sunfloweyName')
self.assertEqual(jesterName.get_attribute('innerHTML'), 'Sunflowey') self.assertEqual(jesterName.get_attribute('innerHTML'), 'Sunflowey')
sunfloweyHealth = self.browser.find_element_by_id('sunfloweyHealth') sunfloweyHealth = self.browser.find_element_by_id('sunfloweyHealth')
...@@ -27,5 +30,29 @@ class CheckContents(unittest.TestCase): ...@@ -27,5 +30,29 @@ class CheckContents(unittest.TestCase):
sunfloweyAttack = self.browser.find_element_by_id('sunfloweyAttack') sunfloweyAttack = self.browser.find_element_by_id('sunfloweyAttack')
self.assertEqual(sunfloweyAttack.get_attribute('innerHTML'),'43') self.assertEqual(sunfloweyAttack.get_attribute('innerHTML'),'43')
def check_cloud_page_title_and_heading(self):
self.browser.get('http://localhost:8000/hero/cloud')
cloudTitle = self.browser.find_element_by_id('cloudTitle')
self.assertEqual(cloudTitle.get_attribute('innerHTML'), 'Detail - Cloud')
cloudHeading = self.browser.find_element_b_id('cloudHeader')
self.assertEqual(cloudHeader.get_attribute('innerHTML'), 'Detail - Cloud')
def check_jester_page_title_and_heading(self):
self.browser.get('http://localhost:8000/hero/jester')
jesterTitle = self.browser.find_element_by_id('jesterTitle')
self.assertEqual(jesterTitle.get_attribute('innerHTML'), 'Detail - Jester')
jesterHeading = self.browser.find_element_b_id('jesterHeader')
self.assertEqual(jesterHeader.get_attribute('innerHTML'), 'Detail - Jester')
def check_sunflowey_page_title_and_heading(self):
self.browser.get('http://localhost:8000/hero/sunflowey')
sunfloweyTitle = self.browser.find_element_by_id('sunfloweyTitle')
self.assertEqual(sunfloweyTitle.get_attribute('innerHTML'), 'Detail - Sunflowey')
sunfloweyHeading = self.browser.find_element_b_id('sunfloweyHeader')
self.assertEqual(sunfloweyHeader.get_attribute('innerHTML'), 'Detail - Sunflowey')
# Create your tests here. # Create your tests here.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment