hepdata
hepdata copied to clipboard
tests: improve test_record_update in tests/e2e/test_records.py
I have problems running this test on my laptop with the RUN_SELENIUM_LOCALLY = True
option. I get errors like selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
from the line:
https://github.com/HEPData/hepdata/blob/301151616bde690b0135b9b05b55d53c8905c04e/tests/e2e/test_records.py#L109
I spent some time earlier inserting WebDriverWait
and sleep
calls and managed to get a bit further, but I couldn't get the test to pass completely. This is not a big problem since I can just run the end-to-end tests on Sauce Labs.
The reason I tried the RUN_SELENIUM_LOCALLY = True
option was because I was getting another error using Sauce Labs selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"id","selector":"table-list"}
. This turned out to be because I had CFG_CONVERTER_URL = 'http://localhost:5500'
but Docker wasn't running on my laptop following a restart, so the sample.oldhepdata
conversion in _check_record_common
had failed. This wasn't immediately obvious from the error message, so maybe a check should be made that the converter is running (CFG_CONVERTER_URL + '/ping'
) or _check_record_common
should be modified to avoid uploading an .oldhepdata
file.