RESOLVED FIXED 181985
WebDriver: test imported/w3c/webdriver/tests/sessions/new_session/merge.py::test_merge_browserName fails
https://bugs.webkit.org/show_bug.cgi?id=181985
Summary WebDriver: test imported/w3c/webdriver/tests/sessions/new_session/merge.py::t...
Carlos Garcia Campos
Reported 2018-01-23 06:45:53 PST
It seems we are failing if the first match capabilities doesn't match instead of continuing iterating. ___________________________________________________________________________________ test_merge_browserName ___________________________________________________________________________________ new_session = <function create_session at 0x7fa92c0291b8>, add_browser_capabilites = <function update_capabilities at 0x7fa92c029230> def test_merge_browserName(new_session, add_browser_capabilites): resp, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}}) browser_settings = { "browserName": resp["capabilities"]["browserName"], "browserVersion": resp["capabilities"]["browserVersion"], "platformName": resp["capabilities"]["platformName"] } session.end() resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"timeouts": {"script": 10}}), "firstMatch": [ { "browserName": browser_settings["browserName"] + "invalid", "pageLoadStrategy": "none" }, { "browserName": browser_settings["browserName"], > "pageLoadStrategy": "eager" } ]}}) add_browser_capabilites = <function update_capabilities at 0x7fa92c029230> browser_settings = {'browserName': 'MiniBrowser', 'browserVersion': '2.19.6', 'platformName': 'linux'} new_session = <function create_session at 0x7fa92c0291b8> resp = {'capabilities': {'acceptInsecureCerts': False, 'browserName': 'MiniBrowser', 'browserVersion': '2.19.6', 'pageLoadStrategy': 'normal', ...}, 'sessionId': '68c46075-d837-4f79-b51d-67ace08ed7f1'} session = <webdriver.client.Session object at 0x7fa92c075f10> WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/merge.py:76: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ WebDriverTests/imported/w3c/webdriver/tests/support/fixtures.py:192: in create_session value = _session.send_command("POST", "session", body=body) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <webdriver.client.Session object at 0x7fa92c075c10>, method = 'POST', url = 'session' body = {'capabilities': {'alwaysMatch': {'timeouts': {'script': 10}, 'webkitgtk:browserOptions': {'args': ['--automation', '-...ame': 'MiniBrowserinvalid', 'pageLoadStrategy': 'none'}, {'browserName': 'MiniBrowser', 'pageLoadStrategy': 'eager'}]}} def send_command(self, method, url, body=None): """ Send a command to the remote end and validate its success. :param method: HTTP method to use in request. :param uri: "Command part" of the HTTP request URL, e.g. `window/rect`. :param body: Optional body of the HTTP request. :return: `None` if the HTTP response body was empty, otherwise the `value` field returned after parsing the response body as JSON. :raises ValueError: If the response body does not contain a `value` key. :raises error.WebDriverException: If the remote end returns an error. """ response = self.transport.send( method, url, body, encoder=protocol.Encoder, decoder=protocol.Decoder, session=self) if response.status != 200: > raise error.from_response(response) E SessionNotCreatedException: session not created (500): expected browserName MiniBrowserinvalid but got MiniBrowser body = {'capabilities': {'alwaysMatch': {'timeouts': {'script': 10}, 'webkitgtk:browserOptions': {'args': ['--automation', '-...ame': 'MiniBrowserinvalid', 'pageLoadStrategy': 'none'}, {'browserName': 'MiniBrowser', 'pageLoadStrategy': 'eager'}]}} method = 'POST' response = <Response status=500 error=<SessionNotCreatedException http_status=500>> self = <webdriver.client.Session object at 0x7fa92c075c10> url = 'session' WebDriverTests/imported/w3c/tools/webdriver/webdriver/client.py:439: SessionNotCreatedException
Attachments
Patch (32.53 KB, patch)
2018-01-25 02:55 PST, Carlos Garcia Campos
clopez: review+
Carlos Garcia Campos
Comment 1 2018-01-25 02:55:04 PST
Carlos Garcia Campos
Comment 2 2018-01-25 05:52:48 PST
Radar WebKit Bug Importer
Comment 3 2018-01-25 05:53:19 PST
Note You need to log in before you can comment on or make changes to this bug.