feat: group multi-browser output by source
Testing / remote-protocol-compat (0.9.3) (push) Successful in 52s
Testing / test (push) Successful in 1m2s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 1m0s
Package Extension / package-extension (push) Successful in 1m11s
Build & Publish Package / publish (push) Successful in 1m7s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 52s
Testing / test (push) Successful in 1m2s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 1m0s
Package Extension / package-extension (push) Successful in 1m11s
Build & Publish Package / publish (push) Successful in 1m7s
- Add browser source grouping metadata to SDK-created tabs, groups, list results, and aggregate count results. - Render grouped local/remote browser tables consistently for clients, tabs, groups, windows, sessions, and remote status output. - Document remote control, auth, HTTP gateway usage, and the refreshed project structure in the README. - Add coverage for grouped output and BrowserCounts browser_groups. - Bump the Python package, extension manifest, and lockfile to 0.15.6. - Add a just publish helper for building and publishing release artifacts.
This commit is contained in:
+35
-6
@@ -559,12 +559,37 @@ class TestTabs:
|
||||
mock_send.side_effect = [3, 4]
|
||||
result = b.tabs.count("github")
|
||||
|
||||
assert result == BrowserCounts(total=7, by_browser={"uuid-1": 3, "work": 4})
|
||||
assert result == BrowserCounts(
|
||||
total=7,
|
||||
by_browser={"uuid-1": 3, "work": 4},
|
||||
browser_groups={"uuid-1": "local", "work": "local"},
|
||||
)
|
||||
assert mock_send.call_args_list == [
|
||||
call("tabs.count", {"pattern": "github"}, profile="default"),
|
||||
call("tabs.count", {"pattern": "github"}, profile="work"),
|
||||
]
|
||||
|
||||
def test_tabs_count_multi_browser_keeps_remote_display_groups(self, b, mock_send):
|
||||
with patch(
|
||||
"browser_cli.active_browser_targets",
|
||||
return_value=[
|
||||
BrowserTarget("main", "browser-host.example:main", "", remote="browser-host.example:8765", display_group="browser-host.example"),
|
||||
BrowserTarget("work", "browser-host.example:work", "", remote="browser-host.example:8765", display_group="browser-host.example"),
|
||||
],
|
||||
):
|
||||
mock_send.side_effect = [1, 2]
|
||||
result = b.tabs.count()
|
||||
|
||||
assert result == BrowserCounts(
|
||||
total=3,
|
||||
by_browser={"browser-host.example:main": 1, "browser-host.example:work": 2},
|
||||
browser_groups={"browser-host.example:main": "browser-host.example", "browser-host.example:work": "browser-host.example"},
|
||||
)
|
||||
assert mock_send.call_args_list == [
|
||||
call("tabs.count", {"pattern": None}, profile="main", remote="browser-host.example:8765", key=None),
|
||||
call("tabs.count", {"pattern": None}, profile="work", remote="browser-host.example:8765", key=None),
|
||||
]
|
||||
|
||||
def test_tabs_query(self, b, mock_send):
|
||||
mock_send.return_value = [TAB_DATA]
|
||||
result = b.tabs.query("example")
|
||||
@@ -713,7 +738,11 @@ class TestGroups:
|
||||
mock_send.side_effect = [2, 5]
|
||||
result = b.groups.count()
|
||||
|
||||
assert result == BrowserCounts(total=7, by_browser={"uuid-1": 2, "work": 5})
|
||||
assert result == BrowserCounts(
|
||||
total=7,
|
||||
by_browser={"uuid-1": 2, "work": 5},
|
||||
browser_groups={"uuid-1": "local", "work": "local"},
|
||||
)
|
||||
|
||||
def test_group_query(self, b, mock_send):
|
||||
mock_send.return_value = [GROUP_DATA]
|
||||
@@ -772,8 +801,8 @@ class TestWindows:
|
||||
result = b.windows.list()
|
||||
|
||||
assert result == [
|
||||
{"id": 1, "tabCount": 2, "state": "normal", "browser": "uuid-1"},
|
||||
{"id": 2, "tabCount": 3, "state": "maximized", "browser": "work"},
|
||||
{"id": 1, "tabCount": 2, "state": "normal", "browser": "uuid-1", "browserGroup": "local"},
|
||||
{"id": 2, "tabCount": 3, "state": "maximized", "browser": "work", "browserGroup": "local"},
|
||||
]
|
||||
|
||||
def test_windows_open_without_url(self, b, mock_send):
|
||||
@@ -907,8 +936,8 @@ class TestSession:
|
||||
result = b.session.list()
|
||||
|
||||
assert result == [
|
||||
{"name": "first", "tabs": 2, "savedAt": 1712707200000, "browser": "uuid-1"},
|
||||
{"name": "second", "tabs": 5, "savedAt": 1712707300000, "browser": "work"},
|
||||
{"name": "first", "tabs": 2, "savedAt": 1712707200000, "browser": "uuid-1", "browserGroup": "local"},
|
||||
{"name": "second", "tabs": 5, "savedAt": 1712707300000, "browser": "work", "browserGroup": "local"},
|
||||
]
|
||||
assert mock_send.call_args_list == [
|
||||
call("session.list", {}, profile="default"),
|
||||
|
||||
Reference in New Issue
Block a user