File tree Expand file tree Collapse file tree
OTAnalytics/plugin_ui/nicegui_gui/pages/analysis_form Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 ResourceManager ,
1111)
1212from OTAnalytics .plugin_ui .nicegui_gui .nicegui .elements .button_form import ButtonForm
13+ from OTAnalytics .plugin_ui .nicegui_gui .test_constants import TEST_ID
14+
15+ MARKER_BUTTON_EXPORT_TRACK_STATISTICS = "button-export-track-statistics"
1316
1417
1518class AnalysisForm (ButtonForm , AbstractFrame ):
@@ -57,7 +60,7 @@ def build(self) -> None:
5760 AnalysisKeys .BUTTON_TEXT_EXPORT_TRACK_STATISTICS
5861 ),
5962 on_click = self ._viewmodel .export_track_statistics ,
60- )
63+ ). props ( f" { TEST_ID } = { MARKER_BUTTON_EXPORT_TRACK_STATISTICS } " )
6164
6265 def get_general_buttons (self ) -> list [Button ]:
6366 general_buttons = []
Original file line number Diff line number Diff line change 1414import pytest
1515from playwright .sync_api import Page # type: ignore
1616
17- from OTAnalytics .application .resources .resource_manager import (
18- AnalysisKeys ,
19- ResourceManager ,
17+ from OTAnalytics .application .resources .resource_manager import ResourceManager
18+ from OTAnalytics . plugin_ui . nicegui_gui . pages . analysis_form . container import (
19+ MARKER_BUTTON_EXPORT_TRACK_STATISTICS ,
2020)
2121from tests .acceptance .conftest import PLAYWRIGHT_VISIBLE_TIMEOUT_MS , NiceGUITestServer
2222from tests .utils .playwright_helpers import (
2323 compare_csv_files ,
2424 export_file_via_dialog ,
2525 load_main_page ,
2626 open_project_otconfig ,
27+ search_for_marker_element ,
2728)
2829
2930playwright = pytest .importorskip (
@@ -68,10 +69,9 @@ def test_export_track_statistics(
6869 page .wait_for_timeout (PLAYWRIGHT_VISIBLE_TIMEOUT_MS )
6970
7071 # Click "Export track statistics ..." button
71- export_button = page .get_by_text (
72- resource_manager .get (AnalysisKeys .BUTTON_TEXT_EXPORT_TRACK_STATISTICS ),
73- exact = True ,
74- )
72+ export_button = search_for_marker_element (
73+ page , MARKER_BUTTON_EXPORT_TRACK_STATISTICS
74+ ).first
7575 export_button .click ()
7676
7777 # Handle export dialog and get output path
You can’t perform that action at this time.
0 commit comments