@@ -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"
@@ -201,9 +205,7 @@ def test_privacy_policy(selenium_driver):
201205 driver = selenium_driver ("tests/notebooks/widget_answers.ipynb" )
202206 # we search for the button to appear so we can be sure that the privacy window
203207 # 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 )
207209 yes_button = None
208210 for button in privacy_buttons :
209211 if button .text == "Yes" :
0 commit comments