Skip to content

Commit 99e9d38

Browse files
committed
Tests: Add privacy button to global class names
The privacy button class name changed in lab 4.
1 parent d7727fe commit 99e9d38

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_widgets.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def test_setup_globals():
124124
# black formats this into one line which causes an error in the linter.
125125
# fmt: off
126126
global BUTTON_CLASS_NAME, OUTPUT_CLASS_NAME, TEXT_INPUT_CLASS_NAME, \
127-
CODE_MIRROR_CLASS_NAME, MATPLOTLIB_CANVAS_CLASS_NAME, CUE_BOX_CLASS_NAME
127+
CODE_MIRROR_CLASS_NAME, MATPLOTLIB_CANVAS_CLASS_NAME, CUE_BOX_CLASS_NAME, \
128+
PRIVACY_BUTTON
128129
global CUED_CUE_BOX_CLASS_NAME, RESET_CUE_BUTTON_CLASS_NAME, \
129130
CUED_RESET_CUE_BUTTON_CLASS_NAME
130131
# fmt: on
@@ -143,6 +144,7 @@ def test_setup_globals():
143144
"lm-Widget.lm-Panel.jupyter-widgets.widget-container"
144145
".widget-box.widget-vbox.scwidget-cue-box"
145146
)
147+
PRIVACY_BUTTON = "bp3-button.bp3-small.jp-toast-button.jp-Button"
146148
elif JUPYTER_TYPE == "lab" and JUPYTER_VERSION < Version("4.0.0"):
147149
BUTTON_CLASS_NAME = (
148150
"lm-Widget.p-Widget.jupyter-widgets.jupyter-button.widget-button"
@@ -160,6 +162,7 @@ def test_setup_globals():
160162
"lm-Widget.p-Widget.lm-Panel.p-Panel.jupyter-widgets."
161163
"widget-container.widget-box.widget-vbox.scwidget-cue-box"
162164
)
165+
PRIVACY_BUTTON = "bp3-button.bp3-small.jp-toast-button.jp-Button"
163166
elif JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
164167
BUTTON_CLASS_NAME = "lm-Widget.jupyter-widgets.jupyter-button.widget-button"
165168
OUTPUT_CLASS_NAME = (
@@ -176,6 +179,7 @@ def test_setup_globals():
176179
"lm-Widget.lm-Panel.jupyter-widgets.widget-container."
177180
"widget-box.widget-vbox.scwidget-cue-box"
178181
)
182+
PRIVACY_BUTTON = "jp-toast-button.jp-mod-small.jp-Button"
179183
else:
180184
raise ValueError(
181185
f"Tests do not support jupyter type {JUPYTER_TYPE!r} for version"
@@ -202,7 +206,7 @@ def test_privacy_policy(selenium_driver):
202206
# we search for the button to appear so we can be sure that the privacy window
203207
# appeared
204208
privacy_buttons = driver.find_elements(
205-
By.CLASS_NAME, "bp3-button.bp3-small.jp-toast-button.jp-Button"
209+
By.CLASS_NAME, PRIVACY_BUTTON
206210
)
207211
yes_button = None
208212
for button in privacy_buttons:

0 commit comments

Comments
 (0)