mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2025-11-21 02:08:25 -08:00
add unittest test_title
This commit is contained in:
21
test/test_selenium.py
Normal file
21
test/test_selenium.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
OPTIONS = Options()
|
||||
OPTIONS.add_argument('--ignore-certificate-errors')
|
||||
OPTIONS.add_argument('--incognito')
|
||||
OPTIONS.add_argument('--headless')
|
||||
SERVICE = Service('/usr/bin/chromedriver')
|
||||
SOURCE_FILE = Path('hugo-themes-report/hugo-themes-report.html').resolve()
|
||||
SOURCE_PAGE = f'file://{str(SOURCE_FILE)}'
|
||||
|
||||
|
||||
class TestSelenium(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.driver = webdriver.Chrome(options=OPTIONS, service=SERVICE)
|
||||
self.driver.get(SOURCE_PAGE)
|
||||
|
||||
def tearDown(self):
|
||||
self.driver.quit()
|
||||
Reference in New Issue
Block a user