Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wdspec] add basic context locator tests #50023

Merged
merged 3 commits into from
Jan 13, 2025

Update webdriver/tests/bidi/browsing_context/locate_nodes/locator.py

b3a70c4
Select commit
Loading
Failed to load commit list.
Merged

[wdspec] add basic context locator tests #50023

Update webdriver/tests/bidi/browsing_context/locate_nodes/locator.py
b3a70c4
Select commit
Loading
Failed to load commit list.
Community-TC Integration / wpt-firefox-nightly-results succeeded Jan 10, 2025 in 4m 30s

Community-TC (pull_request)

Collect results for all tests affected by a pull request in firefox.

Details

View task in Taskcluster | View logs in Taskcluster | View task group in Taskcluster

Task Status

Started: 2025-01-10T13:07:53.790Z
Resolved: 2025-01-10T13:10:31.010Z
Task Execution Time: 2 minutes, 37 seconds, 220 milliseconds
Task Status: completed
Reason Resolved: completed
RunId: 0

Artifacts

- public/logs/live_backing.log
- public/logs/live.log
- public/results/checkrun.md
- public/results/wpt_report.json.gz
- public/results/wpt_screenshot.txt.gz

WPT Command: python3 ./wpt run --channel=nightly --no-fail-on-unexpected --log-wptreport=../artifacts/wpt_report.json --log-wptscreenshot=../artifacts/wpt_screenshot.txt --affected base_head --log-mach-level=info --log-mach=- -y --no-pause --no-restart-on-unexpected --install-fonts --no-headless --verify-log-full --binary=/home/test/build/firefox/firefox firefox


[taskcluster 2025-01-10 13:07:53.825Z] Task ID: bFp6uNhLSAWIm2WLI10JYQ
[taskcluster 2025-01-10 13:07:53.825Z] Worker ID: 8200783967946581477
[taskcluster 2025-01-10 13:07:53.825Z] Worker Group: us-central1-b
[taskcluster 2025-01-10 13:07:53.825Z] Worker Node Type: projects/757942385826/machineTypes/n2-standard-4
[taskcluster 2025-01-10 13:07:53.825Z] Worker Pool: proj-wpt/ci
[taskcluster 2025-01-10 13:07:53.825Z] Worker Version: 46.1.0
[taskcluster 2025-01-10 13:07:53.825Z] Public IP: 35.184.169.246
[taskcluster 2025-01-10 13:07:53.825Z] Hostname: proj-wpt-ci-cgn6gpv0roodlxuvsraaaq

[taskcluster 2025-01-10 13:07:54.574Z] === Task Starting ===
+ '[' '' ']'
+ '[' -d /etc/profile.d ']'
+ for i in /etc/profile.d/*.sh
+ '[' -r /etc/profile.d/01-locale-fix.sh ']'
+ . /etc/profile.d/01-locale-fix.sh
+++ /usr/bin/locale-check C.UTF-8
++ eval
+ for i in /etc/profile.d/*.sh
+ '[' -r /etc/profile.d/libvirt-uri.sh ']'
+ . /etc/profile.d/libvirt-uri.sh

...(6129 lines hidden)...

raw_result = False
params = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06', 'locator': {'type': 'context', 'value': {'context': '15032385537'}}}
mod_name = 'browsingContext', cmd_name = 'browsingContext.locateNodes'
future = <Future finished exception=InvalidArgumentException(invalid argument, Expected "locator.type" to be one of accessibili...erver/WebSocketTransport.sys.mjs:127:18
handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14
)>

    @functools.wraps(params_fn)
    async def inner(self: Any, **kwargs: Any) -> Any:
        raw_result = kwargs.pop("raw_result", False)
        params = remove_undefined(params_fn(self, **kwargs))
    
        # Convert the classname and the method name to a bidi command name
        mod_name = owner.__name__[0].lower() + owner.__name__[1:]
        if hasattr(owner, "prefix"):
            mod_name = f"{owner.prefix}:{mod_name}"
        cmd_name = f"{mod_name}.{to_camelcase(name)}"
    
        future = await self.session.send_command(cmd_name, params)
>       result = await future
E       webdriver.bidi.error.InvalidArgumentException: invalid argument (Expected "locator.type" to be one of accessibility,css,innerText,xpath, got [object String] "context")
E       
E       Remote-end stacktrace:
E       
E       RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
E       WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
E       InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:392:5
E       assert.that/<@chrome://remote/content/shared/webdriver/Assert.sys.mjs:538:13
E       locateNodes@chrome://remote/content/webdriver-bidi/modules/root/browsingContext.sys.mjs:994:6
E       handleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:257:33
E       execute@chrome://remote/content/shared/webdriver/Session.sys.mjs:390:32
E       onPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:236:37
E       onMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18
E       handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14

cmd_name   = 'browsingContext.locateNodes'
future     = <Future finished exception=InvalidArgumentException(invalid argument, Expected "locator.type" to be one of accessibility,css,innerText,xpath, got [object String] "context", RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:392:5
assert.that/<@chrome://remote/content/shared/webdriver/Assert.sys.mjs:538:13
locateNodes@chrome://remote/content/webdriver-bidi/modules/root/browsingContext.sys.mjs:994:6
handleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:257:33
execute@chrome://remote/content/shared/webdriver/Session.sys.mjs:390:32
onPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:236:37
onMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18
handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14
)>
kwargs     = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06',
 'locator': {'type': 'context', 'value': {'context': '15032385537'}}}
mod_name   = 'browsingContext'
name       = 'locate_nodes'
owner      = <class 'webdriver.bidi.modules.browsing_context.BrowsingContext'>
params     = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06',
 'locator': {'type': 'context', 'value': {'context': '15032385537'}}}
params_fn  = <function BrowsingContext.locate_nodes at 0x7fcf269f0a60>
raw_result = False
result_fn  = <function BrowsingContext._locate_nodes at 0x7fcf269f0af0>
self       = <webdriver.bidi.modules.browsing_context.BrowsingContext object at 0x7fcf26841f70>

tools/webdriver/webdriver/bidi/modules/_module.py:76: InvalidArgumentException
  FAIL test_locate_by_context[cross_origin] - webdriver.bidi.error.InvalidArgumentException: invalid argument (Expected "locator.type" to be one of accessibility,css,innerText,xpath, got [object String] "context")
bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fcf2684d070>
inline = <function inline.<locals>.inline at 0x7fcf25d31d30>
top_context = {'children': [{'children': [], 'context': '15032385537', 'originalOpener': None, 'url': 'https://web-platform.test:844...&charset=UTF-8', ...}], 'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06', 'originalOpener': None, 'parent': None, ...}
domain = 'alt'

    @pytest.mark.parametrize("domain", ["", "alt"], ids=["same_origin", "cross_origin"])
    @pytest.mark.asyncio
    async def test_locate_by_context(bidi_session, inline, top_context, domain):
        iframe_url_1 = inline("<div id='in-iframe'>foo</div>", domain=domain)
        page_url = inline(f"<iframe src='{iframe_url_1}'></iframe>")
    
        await bidi_session.browsing_context.navigate(
            context=top_context["context"], url=page_url, wait="complete"
        )
    
        contexts = await bidi_session.browsing_context.get_tree(root=top_context["context"])
        iframe_context = contexts[0]["children"][0]
    
>       result = await bidi_session.browsing_context.locate_nodes(
            context=top_context["context"],
            locator={"type": "context", "value": { "context": iframe_context["context"] }}
        )

bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fcf2684d070>
contexts   = [{'children': [{'children': [],
                'context': '15032385538',
                'originalOpener': None,
                'url': 'https://not-web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cdiv+id%3D%27in-iframe%27%3Efoo%3C%2Fdiv%3E&mime=text%2Fhtml&charset=UTF-8',
                'userContext': 'default'}],
  'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06',
  'originalOpener': None,
  'parent': None,
  'url': 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Ciframe+src%3D%27https%3A%2F%2Fnot-web-platform.test%3A8443%2Fwebdriver%2Ftests%2Fsupport%2Finline.py%3Fdoc%3D%253C%2521doctype%2Bhtml%253E%250A%253Cmeta%2Bcharset%253DUTF-8%253E%250A%253Cdiv%2Bid%253D%2527in-iframe%2527%253Efoo%253C%252Fdiv%253E%26mime%3Dtext%252Fhtml%26charset%3DUTF-8%27%3E%3C%2Fiframe%3E&mime=text%2Fhtml&charset=UTF-8',
  'userContext': 'default'}]
domain     = 'alt'
iframe_context = {'children': [],
 'context': '15032385538',
 'originalOpener': None,
 'url': 'https://not-web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cdiv+id%3D%27in-iframe%27%3Efoo%3C%2Fdiv%3E&mime=text%2Fhtml&charset=UTF-8',
 'userContext': 'default'}
iframe_url_1 = 'https://not-web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cdiv+id%3D%27in-iframe%27%3Efoo%3C%2Fdiv%3E&mime=text%2Fhtml&charset=UTF-8'
inline     = <function inline.<locals>.inline at 0x7fcf25d31d30>
page_url   = 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Ciframe+src%3D%27https%3A%2F%2Fnot-web-platform.test%3A8443%2Fwebdriver%2Ftests%2Fsupport%2Finline.py%3Fdoc%3D%253C%2521doctype%2Bhtml%253E%250A%253Cmeta%2Bcharset%253DUTF-8%253E%250A%253Cdiv%2Bid%253D%2527in-iframe%2527%253Efoo%253C%252Fdiv%253E%26mime%3Dtext%252Fhtml%26charset%3DUTF-8%27%3E%3C%2Fiframe%3E&mime=text%2Fhtml&charset=UTF-8'
top_context = {'children': [{'children': [],
               'context': '15032385537',
               'originalOpener': None,
               'url': 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cdiv+id%3D%27in-iframe%27%3Efoo%3C%2Fdiv%3E&mime=text%2Fhtml&charset=UTF-8',
               'userContext': 'default'}],
 'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06',
 'originalOpener': None,
 'parent': None,
 'url': 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Ciframe+src%3D%27https%3A%2F%2Fweb-platform.test%3A8443%2Fwebdriver%2Ftests%2Fsupport%2Finline.py%3Fdoc%3D%253C%2521doctype%2Bhtml%253E%250A%253Cmeta%2Bcharset%253DUTF-8%253E%250A%253Cdiv%2Bid%253D%2527in-iframe%2527%253Efoo%253C%252Fdiv%253E%26mime%3Dtext%252Fhtml%26charset%3DUTF-8%27%3E%3C%2Fiframe%3E&mime=text%2Fhtml&charset=UTF-8',
 'userContext': 'default'}

webdriver/tests/bidi/browsing_context/locate_nodes/locator.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <webdriver.bidi.modules.browsing_context.BrowsingContext object at 0x7fcf26841f70>
kwargs = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06', 'locator': {'type': 'context', 'value': {'context': '15032385538'}}}
raw_result = False
params = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06', 'locator': {'type': 'context', 'value': {'context': '15032385538'}}}
mod_name = 'browsingContext', cmd_name = 'browsingContext.locateNodes'
future = <Future finished exception=InvalidArgumentException(invalid argument, Expected "locator.type" to be one of accessibili...erver/WebSocketTransport.sys.mjs:127:18
handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14
)>

    @functools.wraps(params_fn)
    async def inner(self: Any, **kwargs: Any) -> Any:
        raw_result = kwargs.pop("raw_result", False)
        params = remove_undefined(params_fn(self, **kwargs))
    
        # Convert the classname and the method name to a bidi command name
        mod_name = owner.__name__[0].lower() + owner.__name__[1:]
        if hasattr(owner, "prefix"):
            mod_name = f"{owner.prefix}:{mod_name}"
        cmd_name = f"{mod_name}.{to_camelcase(name)}"
    
        future = await self.session.send_command(cmd_name, params)
>       result = await future
E       webdriver.bidi.error.InvalidArgumentException: invalid argument (Expected "locator.type" to be one of accessibility,css,innerText,xpath, got [object String] "context")
E       
E       Remote-end stacktrace:
E       
E       RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
E       WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
E       InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:392:5
E       assert.that/<@chrome://remote/content/shared/webdriver/Assert.sys.mjs:538:13
E       locateNodes@chrome://remote/content/webdriver-bidi/modules/root/browsingContext.sys.mjs:994:6
E       handleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:257:33
E       execute@chrome://remote/content/shared/webdriver/Session.sys.mjs:390:32
E       onPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:236:37
E       onMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18
E       handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14

cmd_name   = 'browsingContext.locateNodes'
future     = <Future finished exception=InvalidArgumentException(invalid argument, Expected "locator.type" to be one of accessibility,css,innerText,xpath, got [object String] "context", RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:392:5
assert.that/<@chrome://remote/content/shared/webdriver/Assert.sys.mjs:538:13
locateNodes@chrome://remote/content/webdriver-bidi/modules/root/browsingContext.sys.mjs:994:6
handleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:257:33
execute@chrome://remote/content/shared/webdriver/Session.sys.mjs:390:32
onPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:236:37
onMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18
handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14
)>
kwargs     = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06',
 'locator': {'type': 'context', 'value': {'context': '15032385538'}}}
mod_name   = 'browsingContext'
name       = 'locate_nodes'
owner      = <class 'webdriver.bidi.modules.browsing_context.BrowsingContext'>
params     = {'context': '0a0fba6b-7bd4-4490-be3c-e21f51c11f06',
 'locator': {'type': 'context', 'value': {'context': '15032385538'}}}
params_fn  = <function BrowsingContext.locate_nodes at 0x7fcf269f0a60>
raw_result = False
result_fn  = <function BrowsingContext._locate_nodes at 0x7fcf269f0af0>
self       = <webdriver.bidi.modules.browsing_context.BrowsingContext object at 0x7fcf26841f70>

tools/webdriver/webdriver/bidi/modules/_module.py:76: InvalidArgumentException
 0:50.02 INFO Got 2 unexpected results, with 0 unexpected passes
 0:50.02 wptserve INFO Stopped WebTransport over HTTP/3 server on 127.0.0.1:11000
 0:50.02 wptserve INFO Stopped http server on 127.0.0.1:8000
 0:50.02 wptserve INFO Stopped http server on 127.0.0.1:8444
 0:50.03 wptserve INFO Stopped http server on 127.0.0.1:8002
 0:50.06 wptserve INFO Stopped http server on 127.0.0.1:8443
 0:50.51 wptserve INFO Stopped http server on 127.0.0.1:8003
 0:50.51 wptserve INFO Stopped http server on 127.0.0.1:8445
 0:50.53 wptserve INFO Stopped http server on 127.0.0.1:8446
 0:50.53 wptserve INFO Stopped http server on 127.0.0.1:8001
 0:50.53 wptserve INFO Close on: (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 8889))
 0:50.53 wptserve INFO Stopped http server on 127.0.0.1:9000
 0:50.53 wptserve INFO Close on: (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 8888))
 0:50.59 INFO Removed font: Ahem.ttf
 0:50.61 INFO Closing logging queue
 0:50.61 INFO queue closed
 0:50.61 INFO Tolerating 2 unexpected results
[taskcluster 2025-01-10 13:10:29.781Z] === Task Finished ===
[taskcluster 2025-01-10 13:10:30.432Z] Successful task run with exit code: 0 completed in 156.608 seconds