Skip to content

Commit

Permalink
[wdspec] always expect stack traces (#50170)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN authored Jan 20, 2025
1 parent c1a7a77 commit ecc26ad
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions webdriver/tests/bidi/log/entry_added/stacktrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@

@pytest.mark.asyncio
@pytest.mark.parametrize(
"log_method, expect_stack",
"log_method",
[
("assert", True),
("debug", False),
("error", True),
("info", False),
("log", False),
("table", False),
("trace", True),
("warn", True),
"assert",
"debug",
"error",
"info",
"log",
"table",
"trace",
"warn",
],
)
async def test_console_entry_sync_callstack(
bidi_session, subscribe_events, inline, top_context, wait_for_event, wait_for_future_safe, log_method, expect_stack
bidi_session, subscribe_events, inline, top_context, wait_for_event, wait_for_future_safe, log_method
):
if log_method == "assert":
# assert has to be called with a first falsy argument to trigger a log.
Expand Down Expand Up @@ -46,14 +46,11 @@ async def test_console_entry_sync_callstack(

on_entry_added = wait_for_event("log.entryAdded")

if expect_stack:
expected_stack = [
{"columnNumber": 41, "functionName": "foo", "lineNumber": 4, "url": url},
{"columnNumber": 33, "functionName": "bar", "lineNumber": 5, "url": url},
{"columnNumber": 16, "functionName": "", "lineNumber": 6, "url": url},
]
else:
expected_stack = None
expected_stack = [
{"columnNumber": 41, "functionName": "foo", "lineNumber": 4, "url": url},
{"columnNumber": 33, "functionName": "bar", "lineNumber": 5, "url": url},
{"columnNumber": 16, "functionName": "", "lineNumber": 6, "url": url},
]

await bidi_session.browsing_context.navigate(
context=top_context["context"], url=url, wait="complete"
Expand Down

0 comments on commit ecc26ad

Please sign in to comment.