@@ -42,6 +42,7 @@ def test_anything(self):
42
42
from seleniumbase .core .testcase_manager import TestcaseManager
43
43
from seleniumbase .core import download_helper
44
44
from seleniumbase .core import log_helper
45
+ from seleniumbase .core import style_sheet
45
46
from seleniumbase .fixtures import constants
46
47
from seleniumbase .fixtures import page_actions
47
48
from seleniumbase .fixtures import page_utils
@@ -860,46 +861,8 @@ def __activate_shepherd(self):
860
861
backbone_js = constants .Backbone .MIN_JS
861
862
spinner_css = constants .Messenger .SPINNER_CSS
862
863
863
- backdrop_style = (
864
- '''
865
- body.shepherd-active .shepherd-target.shepherd-enabled {
866
- box-shadow: 0 0 0 99999px rgba(0, 0, 0, 0.22);
867
- pointer-events: none !important;
868
- z-index: 9999;
869
- }
870
-
871
- body.shepherd-active .shepherd-orphan {
872
- box-shadow: 0 0 0 99999px rgba(0, 0, 0, 0.16);
873
- pointer-events: auto;
874
- z-index: 9999;
875
- }
876
-
877
- body.shepherd-active
878
- .shepherd-enabled.shepherd-element-attached-top {
879
- position: relative;
880
- }
881
-
882
- body.shepherd-active
883
- .shepherd-enabled.shepherd-element-attached-bottom {
884
- position: relative;
885
- }
886
-
887
- body.shepherd-active .shepherd-step {
888
- pointer-events: auto;
889
- z-index: 9999;
890
- }
891
-
892
- body.shepherd-active {
893
- pointer-events: none !important;
894
- }
895
- ''' )
896
-
897
- sh_style = ("""let test_tour = new Shepherd.Tour({
898
- defaults: {
899
- classes: 'shepherd-theme-dark',
900
- scrollTo: true
901
- }
902
- });""" )
864
+ sh_style = style_sheet .sh_style_test
865
+ backdrop_style = style_sheet .sh_backdrop_style
903
866
904
867
self .__activate_bootstrap ()
905
868
for x in range (4 ):
@@ -922,7 +885,7 @@ def __activate_shepherd(self):
922
885
for x in range (int (settings .MINI_TIMEOUT * 2.0 )):
923
886
# Shepherd needs a small amount of time to load & activate.
924
887
try :
925
- self .execute_script (sh_style )
888
+ self .execute_script (sh_style ) # Verify Shepherd has loaded
926
889
self .wait_for_ready_state_complete ()
927
890
self .execute_script (sh_style ) # Need it twice for ordering
928
891
time .sleep (0.05 )
@@ -936,14 +899,9 @@ def __activate_shepherd(self):
936
899
'''directive. ''' % self .driver .current_url )
937
900
938
901
def __is_shepherd_activated (self ):
939
- sh_style = ("""let test_tour = new Shepherd.Tour({
940
- defaults: {
941
- classes: 'shepherd-theme-dark',
942
- scrollTo: true
943
- }
944
- });""" )
902
+ sh_style = style_sheet .sh_style_test
945
903
try :
946
- self .execute_script (sh_style )
904
+ self .execute_script (sh_style ) # Verify Shepherd has loaded
947
905
return True
948
906
except Exception :
949
907
return False
0 commit comments