@@ -124,7 +124,8 @@ def test_setup_globals():
124
124
# black formats this into one line which causes an error in the linter.
125
125
# fmt: off
126
126
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
128
129
global CUED_CUE_BOX_CLASS_NAME , RESET_CUE_BUTTON_CLASS_NAME , \
129
130
CUED_RESET_CUE_BUTTON_CLASS_NAME
130
131
# fmt: on
@@ -143,6 +144,7 @@ def test_setup_globals():
143
144
"lm-Widget.lm-Panel.jupyter-widgets.widget-container"
144
145
".widget-box.widget-vbox.scwidget-cue-box"
145
146
)
147
+ PRIVACY_BUTTON = "bp3-button.bp3-small.jp-toast-button.jp-Button"
146
148
elif JUPYTER_TYPE == "lab" and JUPYTER_VERSION < Version ("4.0.0" ):
147
149
BUTTON_CLASS_NAME = (
148
150
"lm-Widget.p-Widget.jupyter-widgets.jupyter-button.widget-button"
@@ -160,6 +162,7 @@ def test_setup_globals():
160
162
"lm-Widget.p-Widget.lm-Panel.p-Panel.jupyter-widgets."
161
163
"widget-container.widget-box.widget-vbox.scwidget-cue-box"
162
164
)
165
+ PRIVACY_BUTTON = "bp3-button.bp3-small.jp-toast-button.jp-Button"
163
166
elif JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version ("4.0.0" ):
164
167
BUTTON_CLASS_NAME = "lm-Widget.jupyter-widgets.jupyter-button.widget-button"
165
168
OUTPUT_CLASS_NAME = (
@@ -176,6 +179,7 @@ def test_setup_globals():
176
179
"lm-Widget.lm-Panel.jupyter-widgets.widget-container."
177
180
"widget-box.widget-vbox.scwidget-cue-box"
178
181
)
182
+ PRIVACY_BUTTON = "jp-toast-button.jp-mod-small.jp-Button"
179
183
else :
180
184
raise ValueError (
181
185
f"Tests do not support jupyter type { JUPYTER_TYPE !r} for version"
@@ -201,9 +205,7 @@ def test_privacy_policy(selenium_driver):
201
205
driver = selenium_driver ("tests/notebooks/widget_answers.ipynb" )
202
206
# we search for the button to appear so we can be sure that the privacy window
203
207
# appeared
204
- privacy_buttons = driver .find_elements (
205
- By .CLASS_NAME , "bp3-button.bp3-small.jp-toast-button.jp-Button"
206
- )
208
+ privacy_buttons = driver .find_elements (By .CLASS_NAME , PRIVACY_BUTTON )
207
209
yes_button = None
208
210
for button in privacy_buttons :
209
211
if button .text == "Yes" :
0 commit comments