~carstengrohmann/OOMAnalyser

1abf455711a6cf9c620485718ee501e20772d2aa — Carsten Grohmann 2 months ago c9b665b
Use Webdriver Manager for browser compatibility

Version mismatch between browser and selenium driver breaks the tests.
The Webdriver manager automatically ensures the compatibility by
downloading the right driver for the installed browser.
4 files changed, 13 insertions(+), 1 deletions(-)

M .gitignore
M Makefile
M requirements.txt
M test.py
M .gitignore => .gitignore +3 -0
@@ 9,6 9,9 @@ env/
# IntelliJ project files
.idea

# Webdriver Manager: cache for selenium drivers
.wdm

# Generated (compiled) JavaScript code
__target__/
OOMAnalyser.js
\ No newline at end of file

M Makefile => Makefile +1 -0
@@ 39,6 39,7 @@ clean:
	@find $(BASE_DIR) -depth -type f -name "*.pyo" -exec rm -f {} \;
	@find $(BASE_DIR) -depth -type f -name "*.orig" -exec rm -f {} \;
	@find $(BASE_DIR) -depth -type f -name "*~" -exec rm -f {} \;
	@$(RM) --force --recursive .wdm
	@$(RM) --force --recursive __target__

#+ Remove all automatically generated and Git repository data

M requirements.txt => requirements.txt +1 -0
@@ 1,2 1,3 @@
Transcrypt == 3.7.16
selenium
webdriver-manager

M test.py => test.py +8 -1
@@ 24,6 24,7 @@ import threading
import unittest
from selenium import webdriver
from selenium.common.exceptions import *
from webdriver_manager.chrome import ChromeDriverManager
import warnings

import OOMAnalyser


@@ 84,7 85,13 @@ class TestInBrowser(TestBase):
        server_thread.daemon = True
        server_thread.start()

        self.driver = webdriver.Chrome()
        # silent Webdriver Manager
        os.environ['WDM_LOG_LEVEL'] = '0'

        # store driver locally
        os.environ['WDM_LOCAL'] = '1'

        self.driver = webdriver.Chrome(ChromeDriverManager().install())
        self.driver.get("http://127.0.0.1:8000/OOMAnalyser.html")

    def tearDown(self):