Skip to content

Commit 5f037de

Browse files
dannonahmedhamidawan
authored andcommitted
Use 'window manager' naming for selenium helpers
The earlier rename commit replaced 'WinBox' with 'scratchbook' in the selenium helper docstrings and the frame() context manager, which just swapped one inconsistent name for another. Converge on 'window manager' for everything I'm touching here.
1 parent a566757 commit 5f037de

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

lib/galaxy/selenium/navigates_galaxy.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,11 +2307,11 @@ def window_manager_is_active(self) -> bool:
23072307
return self.components.masthead.window_manager.has_class("toggle")
23082308

23092309
def window_manager_window_count(self) -> int:
2310-
"""Return number of open scratchbook windows."""
2310+
"""Return number of open window manager windows."""
23112311
return len(self.find_elements_by_selector(".window-manager-window"))
23122312

23132313
def window_manager_wait_for_window_count(self, expected_count: int):
2314-
"""Wait until the expected number of scratchbook windows exist."""
2314+
"""Wait until the expected number of window manager windows exist."""
23152315

23162316
def check_count(driver=None):
23172317
count = len(self.find_elements_by_selector(".window-manager-window"))
@@ -2320,38 +2320,38 @@ def check_count(driver=None):
23202320
self._wait_on(check_count, f"window count to be {expected_count}")
23212321

23222322
@contextlib.contextmanager
2323-
def scratchbook_frame(self, index=0):
2324-
"""Context manager to switch into a scratchbook window iframe by index.
2323+
def window_manager_frame(self, index=0):
2324+
"""Context manager to switch into a window manager iframe by index.
23252325
23262326
Usage:
2327-
with self.scratchbook_frame(0):
2327+
with self.window_manager_frame(0):
23282328
self.wait_for_selector_visible(".dataset-view")
23292329
"""
23302330
iframes = self.find_elements_by_selector(".window-manager-window iframe")
2331-
assert len(iframes) > index, f"Expected at least {index + 1} scratchbook iframes, found {len(iframes)}"
2331+
assert len(iframes) > index, f"Expected at least {index + 1} window manager iframes, found {len(iframes)}"
23322332
try:
23332333
self.switch_to_frame(iframes[index])
23342334
yield
23352335
finally:
23362336
self.switch_to_default_content()
23372337

23382338
def window_manager_get_titles(self) -> list:
2339-
"""Return list of window titles from all open scratchbook windows."""
2339+
"""Return list of window titles from all open window manager windows."""
23402340
elements = self.components.window_manager.title.all()
23412341
return [el.text for el in elements]
23422342

23432343
def window_manager_close_window(self, index=0):
2344-
"""Close a specific scratchbook window by index."""
2344+
"""Close a specific window manager window by index."""
23452345
close_buttons = self.components.window_manager.close_button.all()
23462346
assert len(close_buttons) > index, f"Expected at least {index + 1} close buttons, found {len(close_buttons)}"
23472347
close_buttons[index].click()
23482348

23492349
def window_manager_get_focused_title(self) -> str:
2350-
"""Return the title text of the currently focused scratchbook window."""
2350+
"""Return the title text of the currently focused window manager window."""
23512351
return self.components.window_manager.focused_title.wait_for_text()
23522352

23532353
def window_manager_click_focus_overlay(self, index=0):
2354-
"""Click the focus overlay of a scratchbook window to switch focus.
2354+
"""Click the focus overlay of a window manager window to switch focus.
23552355
23562356
Uses fire_mousedown to match the event the overlay actually listens for.
23572357
"""
@@ -2360,13 +2360,13 @@ def window_manager_click_focus_overlay(self, index=0):
23602360
self.fire_mousedown(overlays[index])
23612361

23622362
def window_manager_get_iframe_src(self, index=0) -> str:
2363-
"""Return the src attribute of a scratchbook window iframe by index."""
2363+
"""Return the src attribute of a window manager iframe by index."""
23642364
iframes = self.components.window_manager.iframe.all()
23652365
assert len(iframes) > index, f"Expected at least {index + 1} iframes, found {len(iframes)}"
23662366
return iframes[index].get_attribute("src") or ""
23672367

23682368
def window_manager_focused_count(self) -> int:
2369-
"""Return the number of focused scratchbook windows."""
2369+
"""Return the number of focused window manager windows."""
23702370
return len(self.components.window_manager.focused.all())
23712371

23722372
# avoids problematic ID and classes on markup

lib/galaxy_test/selenium/test_window_manager.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""E2E tests for Galaxy's scratchbook (floating window manager)."""
1+
"""E2E tests for Galaxy's window manager (floating windows)."""
22

33
from .framework import (
44
managed_history,
@@ -32,7 +32,7 @@ def test_toggle_window_manager(self):
3232
@selenium_test
3333
@managed_history
3434
def test_open_dataset_in_window(self):
35-
"""Display a dataset with WM active — a scratchbook window should appear."""
35+
"""Display a dataset with WM active — a window manager window should appear."""
3636
self.perform_upload(self.get_filename("1.fasta"))
3737
self.history_panel_wait_for_hid_ok(1)
3838

@@ -43,7 +43,7 @@ def test_open_dataset_in_window(self):
4343
item = self.history_panel_item_component(hid=1)
4444
item.display_button.wait_for_and_click()
4545

46-
# A scratchbook window should appear
46+
# A window manager window should appear
4747
self.components.window_manager._.wait_for_visible()
4848
assert self.window_manager_window_count() == 1
4949
self.screenshot("window_manager_dataset_opened")
@@ -56,7 +56,7 @@ def test_open_dataset_in_window(self):
5656
@selenium_test
5757
@managed_history
5858
def test_window_content_loads(self):
59-
"""Content inside the scratchbook iframe should render the dataset view."""
59+
"""Content inside the window manager iframe should render the dataset view."""
6060
self.perform_upload(self.get_filename("1.fasta"))
6161
self.history_panel_wait_for_hid_ok(1)
6262

@@ -66,14 +66,14 @@ def test_window_content_loads(self):
6666
self.components.window_manager._.wait_for_visible()
6767

6868
# Switch into the iframe and verify dataset view rendered
69-
with self.scratchbook_frame(0):
69+
with self.window_manager_frame(0):
7070
self.wait_for_selector_visible(".dataset-view")
7171
self.screenshot("window_manager_iframe_content")
7272

7373
@selenium_test
7474
@managed_history
7575
def test_multiple_windows(self):
76-
"""Opening multiple datasets creates multiple scratchbook windows with correct focus."""
76+
"""Opening multiple datasets creates multiple window manager windows with correct focus."""
7777
for _i in range(3):
7878
self.perform_upload(self.get_filename("1.fasta"))
7979
self.history_panel_wait_for_hid_ok(3)
@@ -102,7 +102,7 @@ def test_multiple_windows(self):
102102
@selenium_test
103103
@managed_history
104104
def test_close_window(self):
105-
"""Closing a scratchbook window removes it from DOM."""
105+
"""Closing a window manager window removes it from DOM."""
106106
self.perform_upload(self.get_filename("1.fasta"))
107107
self.perform_upload(self.get_filename("1.bed"))
108108
self.history_panel_wait_for_hid_ok(2)

0 commit comments

Comments
 (0)