Skip to content

Commit

Permalink
increase the cache time for the selenium driver - prepare trying to u…
Browse files Browse the repository at this point in the history
…se psutil again
  • Loading branch information
WolfgangFahl committed Aug 30, 2022
1 parent 3975e0b commit dda3ff8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# WF 2022-08-20
pip install aiohttp asynctest green selenium webdriver-manager
pip install aiohttp asynctest green psutil selenium webdriver-manager
green
6 changes: 5 additions & 1 deletion tests/test_with_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,25 @@
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
import os

class TestWithSelenium(BaseAsynctest):
'''
testing actual browser behavior with selenium
'''

async def setUp(self):
# debug https://github.com/SergeyPirogov/webdriver_manager/issues/433
# print (os.environ['GH_TOKEN'])
await BaseAsynctest.setUp(self, self.wp_to_test,port=8124)

#self.firefox_path=GeckoDriverManager().install()
#opts = FirefoxOptions()
chrome_options = Options()
chrome_options.headless=Basetest.inPublicCI()
#self.browser = webdriver.Firefox(executable_path=self.firefox_path,options=opts)
self.browser = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()),chrome_options=chrome_options)
chrome_executable=ChromeDriverManager(cache_valid_range=365).install()
self.browser = webdriver.Chrome(service=ChromeService(chrome_executable),chrome_options=chrome_options)

async def onDivClick(self, msg):
print(msg)
Expand Down

0 comments on commit dda3ff8

Please sign in to comment.