This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now each df and each plot per loops is created using multiprocessor Pool
- Loading branch information
Showing
6 changed files
with
121 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"experiment_file_config": {"PLOT_TITLE": "Evoluci\u00f3 de l'oxigen disde el aire", "X_COL": "Temps (min)", "Y_COL": "mg 02/L", "DT_COL": "Date &Time [DD-MM-YYYY HH:MM:SS]", "TSCODE": "Time stamp code", "O2_COL": "SDWA0003000061 , CH 1 O2 [mg/L]", "SAVE_LOOP_DF": false, "SAVE_CONVERTED": false}, "file_cycle_config": {"flush": 3, "wait": 10, "close": 40, "aqua_volume": 0.2}, "pump_control_config": {}} | ||
{"experiment_file_config": {"PLOT_TITLE": "Evoluci\u00f3 de l'oxigen disde el aire", "X_COL": "Temps (min)", "Y_COL": "mg 02/L", "DT_COL": "Date &Time [DD-MM-YYYY HH:MM:SS]", "TSCODE": "Time stamp code", "O2_COL": "SDWA0003000061 , CH 1 O2 [mg/L]", "SAVE_LOOP_DF": true, "SAVE_CONVERTED": true}, "file_cycle_config": {"flush": 3, "wait": 10, "close": 40, "aqua_volume": 0.2}, "pump_control_config": {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from pathlib import Path | ||
import pytest | ||
import requests | ||
from selenium import webdriver | ||
from selenium.common.exceptions import ElementNotInteractableException | ||
from core.utils import config_from_file, save_config_to_file | ||
|
||
test_data = Path(".").resolve() /"tests/Data" | ||
data_file = test_data / "angula.txt" | ||
control_file_1 = test_data / "control1.txt" | ||
control_file_2 = test_data / "control2.txt" | ||
|
||
|
||
@pytest.fixture() | ||
def driver(): | ||
options = webdriver.FirefoxOptions() | ||
# options.add_argument("-Headless") | ||
# options.add_argument("-Headless") | ||
driver = webdriver.Firefox(options=options) | ||
return driver | ||
|
||
|
||
# @pytest.mark.skip | ||
def test_home_page(driver): | ||
driver.get("http://localhost:5000/") | ||
|
||
|
||
def process_data_with_graphics(preview=False): | ||
driver = webdriver.Firefox() | ||
driver.get("http://localhost:5000/") | ||
control_file_1 = driver.find_element_by_id("control_file_1") | ||
control_file_2 = driver.find_element_by_id("control_file_2") | ||
data_file = driver.find_element_by_id("data_file") | ||
control_file_1.send_keys(str(test_data / "control1.txt")) | ||
control_file_2.send_keys(str(test_data / "control2.txt")) | ||
data_file.send_keys(str(test_data / "angula.txt")) | ||
submit = driver.find_element_by_id("submit_files") | ||
if not preview: | ||
submit.click() | ||
else: | ||
preview_plots(driver) | ||
|
||
def preview_plots(driver): | ||
vista_previa = driver.find_element_by_id("generatePlotComplet") | ||
vista_previa.click() | ||
submit = driver.find_element_by_id("submit_files") | ||
submit.click() | ||
# Preview plots | ||
driver.implicitly_wait(10) | ||
driver.find_element_by_id("C1").send_keys("1,2") | ||
driver.find_element_by_id("C1ID").click() | ||
try: | ||
driver.find_element_by_id("myBtn").click() | ||
except ElementNotInteractableException: | ||
pass | ||
driver.find_element_by_xpath("/html/body/nav/a[2]").click() | ||
driver.implicitly_wait(0.5) | ||
driver.find_element_by_id("generatePlots").click() | ||
driver.find_element_by_id("submit_files").click() | ||
|
||
def process_preview_and_plot(): | ||
return process_data_with_graphics(True) | ||
|
||
process_preview_and_plot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters