Fakultas Ilmu Komputer UI

Commit 9952bb30 authored by Muhammad Ilham Peruzzi's avatar Muhammad Ilham Peruzzi
Browse files

make functional_tests an app, use LiveServerTestCase

parent 7d8289a0
......@@ -5,17 +5,18 @@ from selenium.webdriver.common.keys import Keys
import time
import unittest
import environ
from django.test import LiveServerTestCase
root = environ.Path(__file__)
env = environ.Env(DEBUG=(bool, False), )
environ.Env.read_env('.env')
#env = environ.Env(DEBUG=(bool, False), )
#environ.Env.read_env('.env')
HEROKU_APP_HOST = env("HEROKU_APP_HOST")
#HEROKU_APP_HOST = env("HEROKU_APP_HOST")
MAX_WAIT = 5
class NewVisitorTest(unittest.TestCase):
class NewVisitorTest(LiveServerTestCase):
def setUp(self):
chrome_options = Options()
......@@ -33,7 +34,7 @@ class NewVisitorTest(unittest.TestCase):
self.browser.quit()
def test_can_start_a_list_and_retrieve_it_later(self):
self.browser.get(HEROKU_APP_HOST)
self.browser.get(self.live_server_url)
inputbox = self.browser.find_element_by_id('id_new_item')
self.assertEqual(
......@@ -55,8 +56,4 @@ class NewVisitorTest(unittest.TestCase):
inputbox.send_keys('Activity' + str(i))
inputbox.send_keys(Keys.ENTER)
assert 'oh tidak' in self.browser.page_source
if __name__ == '__main__':
unittest.main(warnings='ignore')
\ No newline at end of file
assert 'oh tidak' in self.browser.page_source
\ No newline at end of file
Supports Markdown
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