Commit 2d434b73 authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added tests for the home button

parent 1f47f006
from django.test import TestCase from django.test import TestCase
from selenium import webdriver from selenium import webdriver
import unittest import unittest
from django.urls import resolve
from .views import home_page
class NewVisitorTest(unittest.TestCase): class NewVisitorTest(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -62,6 +64,10 @@ class NewVisitorTest(unittest.TestCase): ...@@ -62,6 +64,10 @@ class NewVisitorTest(unittest.TestCase):
sunfloweyHeader = self.browser.find_element_by_id('sunfloweyHeader') sunfloweyHeader = self.browser.find_element_by_id('sunfloweyHeader')
self.assertEqual(sunfloweyHeader.get_attribute('innerHTML'), 'Detail - Sunflowey') self.assertEqual(sunfloweyHeader.get_attribute('innerHTML'), 'Detail - Sunflowey')
def check_button(self):
homeButton = self.browser.find_element_by_id('homeButton').click()
self.assertEqual(resolve('/').func, home_page)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(warnings='ignore') unittest.main(warnings='ignore')
......
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