diff --git a/scripts/test-gobview.py b/scripts/test-gobview.py index 0dc2cacaa4..48bc5e1133 100644 --- a/scripts/test-gobview.py +++ b/scripts/test-gobview.py @@ -5,6 +5,7 @@ from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By +from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from threading import Thread import http.server @@ -28,7 +29,7 @@ class Handler(http.server.SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): super().__init__(*args, directory=DIRECTORY, **kwargs) class Server(socketserver.TCPServer): - allow_reuse_address = True # avoids that during a consecutive run the server cannot connect due to an 'Adress already in use' os error + allow_reuse_address = True # avoids that during a consecutive run the server cannot connect due to an 'Address already in use' os error httpd = Server((IP, PORT), Handler) print("serving at port", PORT) @@ -62,6 +63,35 @@ class Server(socketserver.TCPServer): panel = browser.find_element(By.CLASS_NAME, "panel") print("found DOM elements main, sidebar-left, sidebar-right, content and panel") + # simulate work flow for analysis rerun + parameterViewTab = browser.find_element(By.ID, "nav-item-2") + parameterViewTab.click() + parameterView = browser.find_element(By.ID, "parameterview") + print("found DOM element parameterview") + inputBar = browser.find_element(By.CLASS_NAME, "input") + inputBar.clear() + invalidFeedback = browser.find_element(By.XPATH, '//div[@class="invalid-tooltip"]') + + feedback = invalidFeedback.text + assert(feedback == "At least one parameter has to be entered") + print("found the feedback", feedback) + + parameter = '--incremental.force-reanalyze.funs ["main"]' + inputBar.send_keys(parameter) + inputBar.send_keys(Keys.ENTER) + + # wait for ten seconds to let the analysis finish + browser.implicitly_wait(10) + + parameterChip = browser.find_element(By.XPATH, '//span[@class="m-1 badge rounded-pill bg-secondary text"]') + textFromParameterChip = parameterChip.text + assert(textFromParameterChip == parameter) + print("found the parameter chip in history", textFromParameterChip) + + # search for first tick symbol in history + executedSvg = browser.find_element(By.XPATH, '//svg[@class="bi bi-check2"]') + print("found tick symbol in history indicating successful reanalysis") + cleanup(browser, httpd, thread) except Exception as e: