Show the offline screen when the network link is gone; plain panel
With no address on any interface (cable out, no wifi) the kiosk now switches to the offline screen right away and returns when the network and server are back. An unreachable server with the network up still leaves the page running for InfoFlow's offline cache. The panel on the local pages loses its blue top edge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4d061f5211
commit
be80288a6e
3 files changed
+51
-8
No files matched your search
+25
-1
@@ -100,7 +100,7 @@ def test_chromium_error_page_is_replaced(env):
|
||||
assert "offline.html" in browser.url
|
||||
|
||||
|
||||
def test_running_page_is_left_alone_when_network_drops(env):
|
||||
def test_running_page_is_left_alone_when_the_server_is_unreachable(env):
|
||||
"""Pages with their own offline cache (e.g. InfoFlow displays) must keep running."""
|
||||
agent, browser, probe, clock, _ = env
|
||||
browser.url = "https://schermen-ijsselflat.voxip.nl"
|
||||
@@ -178,3 +178,27 @@ def test_offline_page_never_receives_the_token(env, paths):
|
||||
agent.tick()
|
||||
assert "offline.html" in browser.url
|
||||
assert "geheim" not in browser.url and "3456" in browser.url
|
||||
|
||||
|
||||
def test_offline_page_when_the_network_link_is_gone_then_back(env):
|
||||
agent, browser, probe, clock, _ = env
|
||||
network = {"eth0": ["192.168.1.20/24"]}
|
||||
agent.addresses = lambda: dict(network)
|
||||
browser.url = "https://schermen-ijsselflat.voxip.nl"
|
||||
agent.tick()
|
||||
assert browser.navigations == []
|
||||
|
||||
network.clear() # cable out
|
||||
probe.ok = False
|
||||
clock.t += 5
|
||||
agent.tick()
|
||||
assert "offline.html" in browser.url and "netwerkkabel" in browser.url
|
||||
clock.t += 5
|
||||
agent.tick()
|
||||
assert len(browser.navigations) == 1 # no re-navigation while it stays down
|
||||
|
||||
network["eth0"] = ["192.168.1.20/24"] # cable back in
|
||||
probe.ok = True
|
||||
clock.t += 11
|
||||
agent.tick()
|
||||
assert browser.url == "https://schermen-ijsselflat.voxip.nl"
|
||||
Reference in new issue
Block a user