onion-wownero-blockchain-ex.../tests/main.py

25 lines
681 B
Python
Raw Normal View History

2017-01-31 04:57:48 +00:00
import unittest
from selenium import webdriver
class OnionExplorerTest(unittest.TestCase):
'''
based on https://engineering.aweber.com/getting-started-with-ui-automated-tests-using-selenium-python/
'''
@classmethod
def setUpClass(cls):
cls.driver = webdriver.Firefox()
2017-01-31 05:10:27 +00:00
cls.url = 'http://127.0.0.1:8081/'
2017-01-31 04:57:48 +00:00
def test_title(self):
2017-01-31 05:10:27 +00:00
self.driver.get(self.url)
self.assertEqual(self.driver.title, 'Onion Monero Blockchain Explorer')
def test_footer(self):
self.driver.get(self.url)
self.assertIn('source code', self.driver.page_source)
2017-01-31 04:57:48 +00:00
@classmethod
def tearDownClass(cls):
cls.driver.quit()