Integration Tests of MIP Federations

Report generated on 08-Jul-2023 at 07:02:07 by pytest-html v3.2.0

Summary

6 tests ran in 118.17 seconds.

5 passed, 0 skipped, 1 failed, 0 errors, 0 expected failures, 0 unexpected passes

Results

Result Time Test Description Duration
Failed 2023-07-08 07:02:07.314468 test_qa_federation.py::TestMIPQAFederation::test_data[https://qa.hbpmip.link/] Integration tests (data) of the MIP QA Federation. 28.79
screenshot
self = <test_qa_federation.TestMIPQAFederation object at 0x7f4a4be0bd60>

def test_data(self):
"""Integration tests (data) of the MIP QA Federation."""
> super().test_data()

test_qa_federation.py:24:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
basetest.py:168: in test_data
histogram_of_rightttgtransversetempor_ = selenium_driver.find_element(
/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py:830: in find_element
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py:440: in execute
self.error_handler.check_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f4a4bd9bb20>
response = {'status': 404, 'value': '{"value":{"error":"no such element","message":"no such element: Unable to locate element: {\...\\n#16 0x55f9ee762847 \\u003Cunknown>\\n#17 0x55f9ee772243 \\u003Cunknown>\\n#18 0x7ff48195cfd4 \\u003Cunknown>\\n"}}'}

def check_response(self, response: Dict[str, Any]) -> None:
"""Checks that a JSON response from the WebDriver does not have an
error.

:Args:
- response - The JSON response from the WebDriver server as a dictionary
object.

:Raises: If the response contains an error message.
"""
status = response.get("status", None)
if not status or status == ErrorCode.SUCCESS:
return
value = None
message = response.get("message", "")
screen: str = response.get("screen", "")
stacktrace = None
if isinstance(status, int):
value_json = response.get("value", None)
if value_json and isinstance(value_json, str):
import json

try:
value = json.loads(value_json)
if len(value.keys()) == 1:
value = value["value"]
status = value.get("error", None)
if not status:
status = value.get("status", ErrorCode.UNKNOWN_ERROR)
message = value.get("value") or value.get("message")
if not isinstance(message, str):
value = message
message = message.get("message")
else:
message = value.get("message", None)
except ValueError:
pass

exception_class: Type[WebDriverException]
if status in ErrorCode.NO_SUCH_ELEMENT:
exception_class = NoSuchElementException
elif status in ErrorCode.NO_SUCH_FRAME:
exception_class = NoSuchFrameException
elif status in ErrorCode.NO_SUCH_SHADOW_ROOT:
exception_class = NoSuchShadowRootException
elif status in ErrorCode.NO_SUCH_WINDOW:
exception_class = NoSuchWindowException
elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
exception_class = StaleElementReferenceException
elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
exception_class = ElementNotVisibleException
elif status in ErrorCode.INVALID_ELEMENT_STATE:
exception_class = InvalidElementStateException
elif (
status in ErrorCode.INVALID_SELECTOR
or status in ErrorCode.INVALID_XPATH_SELECTOR
or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER
):
exception_class = InvalidSelectorException
elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
exception_class = ElementNotSelectableException
elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
exception_class = ElementNotInteractableException
elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
exception_class = InvalidCookieDomainException
elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
exception_class = UnableToSetCookieException
elif status in ErrorCode.TIMEOUT:
exception_class = TimeoutException
elif status in ErrorCode.SCRIPT_TIMEOUT:
exception_class = TimeoutException
elif status in ErrorCode.UNKNOWN_ERROR:
exception_class = WebDriverException
elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
exception_class = UnexpectedAlertPresentException
elif status in ErrorCode.NO_ALERT_OPEN:
exception_class = NoAlertPresentException
elif status in ErrorCode.IME_NOT_AVAILABLE:
exception_class = ImeNotAvailableException
elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
exception_class = ImeActivationFailedException
elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
exception_class = MoveTargetOutOfBoundsException
elif status in ErrorCode.JAVASCRIPT_ERROR:
exception_class = JavascriptException
elif status in ErrorCode.SESSION_NOT_CREATED:
exception_class = SessionNotCreatedException
elif status in ErrorCode.INVALID_ARGUMENT:
exception_class = InvalidArgumentException
elif status in ErrorCode.NO_SUCH_COOKIE:
exception_class = NoSuchCookieException
elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
exception_class = ScreenshotException
elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
exception_class = ElementClickInterceptedException
elif status in ErrorCode.INSECURE_CERTIFICATE:
exception_class = InsecureCertificateException
elif status in ErrorCode.INVALID_COORDINATES:
exception_class = InvalidCoordinatesException
elif status in ErrorCode.INVALID_SESSION_ID:
exception_class = InvalidSessionIdException
elif status in ErrorCode.UNKNOWN_METHOD:
exception_class = UnknownMethodException
else:
exception_class = WebDriverException
if not value:
value = response["value"]
if isinstance(value, str):
raise exception_class(value)
if message == "" and "message" in value:
message = value["message"]

screen = None # type: ignore[assignment]
if "screen" in value:
screen = value["screen"]

stacktrace = None
st_value = value.get("stackTrace") or value.get("stacktrace")
if st_value:
if isinstance(st_value, str):
stacktrace = st_value.split("\n")
else:
stacktrace = []
try:
for frame in st_value:
line = frame.get("lineNumber", "")
file = frame.get("fileName", "<anonymous>")
if line:
file = f"{file}:{line}"
meth = frame.get("methodName", "<anonymous>")
if "className" in frame:
meth = f"{frame['className']}.{meth}"
msg = " at %s (%s)"
msg = msg % (meth, file)
stacktrace.append(msg)
except TypeError:
pass
if exception_class == UnexpectedAlertPresentException:
alert_text = None
if "data" in value:
alert_text = value["data"].get("text")
elif "alert" in value:
alert_text = value["alert"].get("text")
raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
> raise exception_class(message, screen, stacktrace)
E selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[contains(@id,'bar-graph-right-transverse-temporal-gyrus')]"}
E (Session info: headless chrome=114.0.5735.198)
E Stacktrace:
E #0 0x55f9ee7794e3 <unknown>
E #1 0x55f9ee4a8c76 <unknown>
E #2 0x55f9ee4e4c96 <unknown>
E #3 0x55f9ee4e4dc1 <unknown>
E #4 0x55f9ee51e7f4 <unknown>
E #5 0x55f9ee50403d <unknown>
E #6 0x55f9ee51c30e <unknown>
E #7 0x55f9ee503de3 <unknown>
E #8 0x55f9ee4d92dd <unknown>
E #9 0x55f9ee4da34e <unknown>
E #10 0x55f9ee7393e4 <unknown>
E #11 0x55f9ee73d3d7 <unknown>
E #12 0x55f9ee747b20 <unknown>
E #13 0x55f9ee73e023 <unknown>
E #14 0x55f9ee70c1aa <unknown>
E #15 0x55f9ee7626b8 <unknown>
E #16 0x55f9ee762847 <unknown>
E #17 0x55f9ee772243 <unknown>
E #18 0x7ff48195cfd4 <unknown>

/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py:245: NoSuchElementException
Passed 2023-07-08 07:02:07.312540 test_public_mip.py::TestPublicMIP::test_login_and_accept_terms[https://hbpmip.link/] Test login and accept terms on the public MIP. 26.71
-----------------------------Captured stderr setup------------------------------
[WDM] - Downloading: 0%| | 0.00/7.06M [00:00<?, ?B/s] [WDM] - Downloading: 100%|██████████| 7.06M/7.06M [00:00<00:00, 108MB/s]
------------------------------Captured stdout call------------------------------
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@id='tos']"} (Session info: headless chrome=114.0.5735.198) Stacktrace: #0 0x55c4248074e3 <unknown> #1 0x55c424536c76 <unknown> #2 0x55c424572c96 <unknown> #3 0x55c424572dc1 <unknown> #4 0x55c4245ac7f4 <unknown> #5 0x55c42459203d <unknown> #6 0x55c4245aa30e <unknown> #7 0x55c424591de3 <unknown> #8 0x55c4245672dd <unknown> #9 0x55c42456834e <unknown> #10 0x55c4247c73e4 <unknown> #11 0x55c4247cb3d7 <unknown> #12 0x55c4247d5b20 <unknown> #13 0x55c4247cc023 <unknown> #14 0x55c42479a1aa <unknown> #15 0x55c4247f06b8 <unknown> #16 0x55c4247f0847 <unknown> #17 0x55c424800243 <unknown> #18 0x7ffaaf843fd4 <unknown>
Passed 2023-07-08 07:02:07.312699 test_public_mip.py::TestPublicMIP::test_data[https://hbpmip.link/] Integration tests (data) of the public MIP. 18.54
No log output captured.
Passed 2023-07-08 07:02:07.312792 test_qa_federation.py::TestMIPQAFederation::test_login_and_accept_terms[https://qa.hbpmip.link/] Test login and accept terms on the MIP QA Federation. 7.88
No log output captured.
Passed 2023-07-08 07:02:07.314578 test_stroke_federation.py::TestStrokeMIP::test_login_and_accept_terms[https://stroke.hbpmip.link/] Test login and accept terms on the Stroke (FERES) MIP. 25.94
------------------------------Captured stdout call------------------------------
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@id='tos']"} (Session info: headless chrome=114.0.5735.198) Stacktrace: #0 0x559a171fb4e3 <unknown> #1 0x559a16f2ac76 <unknown> #2 0x559a16f66c96 <unknown> #3 0x559a16f66dc1 <unknown> #4 0x559a16fa07f4 <unknown> #5 0x559a16f8603d <unknown> #6 0x559a16f9e30e <unknown> #7 0x559a16f85de3 <unknown> #8 0x559a16f5b2dd <unknown> #9 0x559a16f5c34e <unknown> #10 0x559a171bb3e4 <unknown> #11 0x559a171bf3d7 <unknown> #12 0x559a171c9b20 <unknown> #13 0x559a171c0023 <unknown> #14 0x559a1718e1aa <unknown> #15 0x559a171e46b8 <unknown> #16 0x559a171e4847 <unknown> #17 0x559a171f4243 <unknown> #18 0x7f8453512fd4 <unknown>
Passed 2023-07-08 07:02:07.314663 test_stroke_federation.py::TestStrokeMIP::test_data[https://stroke.hbpmip.link/] Integration tests (data) of the Stroke (FERES) MIP. 9.87
No log output captured.