Skip to content

Commit a40298b

Browse files
committed
Add run_dialog label test
1 parent f1a412a commit a40298b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/ert/gui/simulation/run_dialog.py

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def __init__(
219219
self._snapshot_model.rowsInserted.connect(self.on_snapshot_new_iteration)
220220

221221
self._fm_step_label = QLabel(self)
222+
self._fm_step_label.setObjectName("fm_step_label")
222223
self._fm_step_overview = FMStepOverview(self._snapshot_model, self)
223224

224225
self.running_time = QLabel("")

tests/ert/unit_tests/gui/simulation/test_run_dialog.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
from pytestqt.qtbot import QtBot
77
from qtpy import QtWidgets
88
from qtpy.QtCore import Qt, QTimer
9-
from qtpy.QtWidgets import QApplication, QComboBox, QPushButton, QToolButton, QWidget
9+
from qtpy.QtWidgets import (
10+
QApplication,
11+
QComboBox,
12+
QLabel,
13+
QPushButton,
14+
QToolButton,
15+
QWidget,
16+
)
1017

1118
import ert
1219
from ert.config import ErtConfig
@@ -458,6 +465,15 @@ def test_run_dialog_memory_usage_showing(
458465
max_memory_value = fm_step_model.data(max_memory_column_proxy_index, Qt.DisplayRole)
459466
assert max_memory_value == "60.00 KB"
460467

468+
fm_step_label = run_dialog.findChild(QLabel, name="fm_step_label")
469+
470+
assert not fm_step_label.text()
471+
472+
realization_box._item_clicked(run_dialog._fm_step_overview.model().index(0, 0))
473+
# qtbot.mouseClick(realization_box, Qt.LeftButton)
474+
475+
assert fm_step_label.text() == "Realization id 0 in iteration 0"
476+
461477

462478
@pytest.mark.integration_test
463479
@pytest.mark.usefixtures("use_tmpdir")

0 commit comments

Comments
 (0)