show mute status correctly when tab mute and add to get single tab status
This commit is contained in:
@@ -52,6 +52,13 @@ def test_tabs_active_in_window(browser):
|
||||
assert result["windowId"] == active["windowId"]
|
||||
|
||||
|
||||
def test_tabs_status(browser):
|
||||
result = browser("tabs.status", {})
|
||||
assert isinstance(result, dict)
|
||||
assert "id" in result
|
||||
assert "muted" in result
|
||||
|
||||
|
||||
def test_tabs_html(browser, http_tab):
|
||||
html = browser("tabs.html", {"tabId": http_tab["id"]})
|
||||
assert isinstance(html, str)
|
||||
@@ -133,3 +140,14 @@ def test_tabs_mute_and_unmute(browser, http_tab):
|
||||
listed = browser("tabs.list")
|
||||
listed_tab = next(t for t in listed if t["id"] == http_tab["id"])
|
||||
assert listed_tab["muted"] is False
|
||||
status = browser("tabs.status", {"tabId": http_tab["id"]})
|
||||
assert status["muted"] is False
|
||||
|
||||
|
||||
def test_tabs_mute_requires_explicit_tab_when_multiple_tabs_open(browser):
|
||||
opened = browser("navigate.open", {"url": "https://example.com", "background": True})
|
||||
try:
|
||||
with pytest.raises(RuntimeError, match="Refusing to mute without explicit tab ID"):
|
||||
browser("tabs.mute", {})
|
||||
finally:
|
||||
browser("tabs.close", {"tabId": opened["id"]})
|
||||
|
||||
Reference in New Issue
Block a user