mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix(test/e2e): autoupdate e2e rewritten
This commit is contained in:
@ -1,8 +1,9 @@
|
|||||||
# This file was automatically generated by generate_cli.py
|
# This file was automatically generated by generate_cli.py
|
||||||
|
|
||||||
from bec_widgets.cli.client_utils import rpc_call, RPCBase, BECGuiClientMixin
|
|
||||||
from typing import Literal, Optional, overload
|
from typing import Literal, Optional, overload
|
||||||
|
|
||||||
|
from bec_widgets.cli.client_utils import BECGuiClientMixin, RPCBase, rpc_call
|
||||||
|
|
||||||
|
|
||||||
class BECPlotBase(RPCBase):
|
class BECPlotBase(RPCBase):
|
||||||
@property
|
@property
|
||||||
|
@ -225,9 +225,8 @@ def test_spiral_bar_scan_update(bec_client_lib, rpc_server_dock):
|
|||||||
assert bar_config["rings"][1]["max_value"] == final_samy
|
assert bar_config["rings"][1]["max_value"] == final_samy
|
||||||
|
|
||||||
|
|
||||||
def test_auto_update(rpc_server_dock, bec_client, qtbot):
|
def test_auto_update(bec_client_lib, rpc_server_dock):
|
||||||
dock = BECDockArea(rpc_server_dock.gui_id)
|
dock = BECDockArea(rpc_server_dock)
|
||||||
dock._client = bec_client
|
|
||||||
|
|
||||||
AutoUpdates.enabled = True
|
AutoUpdates.enabled = True
|
||||||
AutoUpdates.create_default_dock = True
|
AutoUpdates.create_default_dock = True
|
||||||
@ -238,16 +237,13 @@ def test_auto_update(rpc_server_dock, bec_client, qtbot):
|
|||||||
# we need to start the update script manually; normally this is done when the GUI is started
|
# we need to start the update script manually; normally this is done when the GUI is started
|
||||||
dock._start_update_script()
|
dock._start_update_script()
|
||||||
|
|
||||||
client = bec_client
|
client = bec_client_lib
|
||||||
dev = client.device_manager.devices
|
dev = client.device_manager.devices
|
||||||
scans = client.scans
|
scans = client.scans
|
||||||
queue = client.queue
|
queue = client.queue
|
||||||
|
|
||||||
status = scans.line_scan(dev.samx, -5, 5, steps=10, exp_time=0.05, relative=False)
|
status = scans.line_scan(dev.samx, -5, 5, steps=10, exp_time=0.05, relative=False)
|
||||||
|
status.wait()
|
||||||
# wait for scan to finish
|
|
||||||
while not status.status == "COMPLETED":
|
|
||||||
qtbot.wait(200)
|
|
||||||
|
|
||||||
last_scan_data = queue.scan_storage.storage[-1].data
|
last_scan_data = queue.scan_storage.storage[-1].data
|
||||||
|
|
||||||
@ -263,10 +259,7 @@ def test_auto_update(rpc_server_dock, bec_client, qtbot):
|
|||||||
status = scans.grid_scan(
|
status = scans.grid_scan(
|
||||||
dev.samx, -10, 10, 5, dev.samy, -5, 5, 5, exp_time=0.05, relative=False
|
dev.samx, -10, 10, 5, dev.samy, -5, 5, 5, exp_time=0.05, relative=False
|
||||||
)
|
)
|
||||||
|
status.wait()
|
||||||
# wait for scan to finish
|
|
||||||
while not status.status == "COMPLETED":
|
|
||||||
qtbot.wait(200)
|
|
||||||
|
|
||||||
plt = dock.auto_updates.get_default_figure()
|
plt = dock.auto_updates.get_default_figure()
|
||||||
widgets = plt.widget_list
|
widgets = plt.widget_list
|
||||||
|
Reference in New Issue
Block a user