diff --git a/hepdata/version.py b/hepdata/version.py index 75ad1957..593fe867 100644 --- a/hepdata/version.py +++ b/hepdata/version.py @@ -28,4 +28,4 @@ and parsed by ``setup.py``. """ -__version__ = "0.9.4dev20230327" +__version__ = "0.9.4dev20230404" diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index fa80b788..56061c53 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -226,7 +226,8 @@ def finalizer(): # Run tests locally instead of on Sauce Labs (requires local chromedriver installation). browser = getattr(webdriver, request.param)() - browser.set_window_size(1280,1024) + browser.set_window_size(1280, 1024) + browser.implicitly_wait(10) # seconds # Go to homepage and click cookie accept button so cookie bar is out of the way browser.get(flask.url_for('hepdata_theme.index', _external=True)) diff --git a/tests/e2e/test_general.py b/tests/e2e/test_general.py index d1cdbd27..e3ca08e4 100644 --- a/tests/e2e/test_general.py +++ b/tests/e2e/test_general.py @@ -24,7 +24,6 @@ """HEPData end to end testing of general pages.""" import flask import requests -import requests_mock import zipfile import io @@ -33,14 +32,11 @@ from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC -from functools import reduce from tests.conftest import import_default_data from hepdata.ext.opensearch.api import reindex_all -from hepdata.modules.records.importer.api import import_records from hepdata.modules.submission.api import get_latest_hepsubmission -from hepdata.modules.records.utils.submission import unload_submission, get_or_create_hepsubmission -from hepdata.modules.records.utils.workflow import create_record +from hepdata.modules.records.utils.submission import unload_submission def test_home(app, live_server, env_browser, e2e_identifiers): diff --git a/tests/e2e/test_search.py b/tests/e2e/test_search.py index a5a4353b..7c6bc641 100644 --- a/tests/e2e/test_search.py +++ b/tests/e2e/test_search.py @@ -44,7 +44,7 @@ def test_search_from_home(live_server, env_browser, search_tests): # Click 'View all' search_all_link = browser.find_element(By.CSS_SELECTOR, '#latest_records_section').find_element(By.TAG_NAME, 'a') search_all_link.click() - element = WebDriverWait(browser, 10).until( + WebDriverWait(browser, 10).until( EC.url_contains('search') ) assert (flask.url_for('os_search.search', _external=True) in @@ -110,7 +110,7 @@ def test_search_from_home(live_server, env_browser, search_tests): search_input.send_keys(search_term) search_form.submit() - element = WebDriverWait(browser, 10).until( + WebDriverWait(browser, 10).until( EC.presence_of_element_located((By.CLASS_NAME, 'search-result-item')) ) diff --git a/tests/e2e/test_submit.py b/tests/e2e/test_submit.py index 1eed61cb..71de8be7 100644 --- a/tests/e2e/test_submit.py +++ b/tests/e2e/test_submit.py @@ -22,7 +22,6 @@ # as an Intergovernmental Organization or submit itself to any jurisdiction. """HEPData end to end testing of record submission.""" -import flask from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By @@ -87,16 +86,13 @@ def test_create_submission(live_server, logged_in_browser): # Click continue and wait for animation to finish browser.find_element(By.ID, 'people_continue_btn').click() - WebDriverWait(browser, 10).until( - EC.visibility_of_element_located((By.CSS_SELECTOR, "#uploader_message h4")) - ) # Add message for uploader browser.find_element(By.ID, 'uploader-message-input').send_keys('Please could you upload something?') # Click continue and wait for animation to finish browser.find_element(By.ID, 'message_continue_btn').click() - submission_state_p = WebDriverWait(browser, 10).until( + WebDriverWait(browser, 10).until( EC.text_to_be_present_in_element( (By.CSS_SELECTOR, "#submission_state p"), "You are about to create a submission for") @@ -104,7 +100,7 @@ def test_create_submission(live_server, logged_in_browser): # Click continue and wait for animation to finish browser.find_element(By.ID, 'submit_btn').click() - submission_state_p = WebDriverWait(browser, 10).until( + WebDriverWait(browser, 10).until( EC.text_to_be_present_in_element( (By.CSS_SELECTOR, "#submission_state p"), "Submission Complete!" @@ -136,9 +132,6 @@ def test_create_submission(live_server, logged_in_browser): continue_button = browser.find_element(By.ID, 'continue_btn') continue_button.click() # Wait for alert to appear - WebDriverWait(browser, 10).until( - EC.presence_of_element_located((By.CSS_SELECTOR, "#inspire-result .alert-danger")) - ) alert = browser.find_element(By.CSS_SELECTOR, "#inspire-result .alert-danger") assert alert.text == 'A record with this Inspire ID already exists in HEPData.' record_link = alert.find_element(By.TAG_NAME, 'a')