mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-28 22:41:06 +00:00
eabe73ddc0
* begin setup front-end test environment with selenium * run migrations before tests * use https for tests
22 lines
804 B
Python
22 lines
804 B
Python
#!/usr/bin/python3
|
|
import unittest,os
|
|
from selenium import webdriver
|
|
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
|
|
|
class Browser(unittest.TestCase):
|
|
def setUp(self):
|
|
if os.environ["BROWSER"] == "firefox":
|
|
capabilities=DesiredCapabilities.FIREFOX
|
|
elif os.environ["BROWSER"] == "chrome":
|
|
capabilities=DesiredCapabilities.CHROME
|
|
else:
|
|
raise Exception("No browser was requested")
|
|
capabilities['acceptSslCerts'] = True
|
|
self.driver = webdriver.Remote(
|
|
command_executor='http://localhost:24444/wd/hub',
|
|
desired_capabilities=capabilities)
|
|
def tearDown(self):
|
|
self.driver.close()
|
|
|
|
def get(self, url):
|
|
return self.driver.get("https://localhost" + url)
|