@@ -862,14 +862,14 @@ def calculate_test_id(file_name, scenario_name):
862
862
scenario_name = re .sub (r"[^\w" + r"_ " + r"]" , "" , scenario_name )
863
863
scenario_name = scenario_name .replace (" " , "_" )
864
864
if " -- @" in scenario_name :
865
- scenario_name = scenario_name .split (" -- @ " )[0 ]
865
+ scenario_name = scenario_name .split (" # " )[0 ]. rstrip ()
866
866
test_id = "%s.%s" % (file_name , scenario_name )
867
867
return test_id
868
868
869
869
870
870
def calculate_display_id (file_name , line_num , scenario_name ):
871
871
if " -- @" in scenario_name :
872
- scenario_name = scenario_name .split (" -- @ " )[0 ]
872
+ scenario_name = scenario_name .split (" # " )[0 ]. rstrip ()
873
873
display_id = "%s:%s => %s" % (file_name , line_num , scenario_name )
874
874
return display_id
875
875
@@ -879,7 +879,7 @@ def get_test_id():
879
879
file_name = file_name .replace ("/" , "." ).replace ("\\ " , "." )
880
880
scenario_name = sb_config .behave_scenario .name
881
881
if " -- @" in scenario_name :
882
- scenario_name = scenario_name .split (" -- @ " )[0 ]
882
+ scenario_name = scenario_name .split (" # " )[0 ]. rstrip ()
883
883
scenario_name = re .sub (r"[^\w" + r"_ " + r"]" , "" , scenario_name )
884
884
scenario_name = scenario_name .replace (" " , "_" )
885
885
test_id = "%s.%s" % (file_name , scenario_name )
@@ -891,7 +891,7 @@ def get_display_id():
891
891
line_num = str (sb_config .behave_scenario .line )
892
892
scenario_name = sb_config .behave_scenario .name
893
893
if " -- @" in scenario_name :
894
- scenario_name = scenario_name .split (" -- @ " )[0 ]
894
+ scenario_name = scenario_name .split (" # " )[0 ]. rstrip ()
895
895
display_id = "%s:%s => %s" % (file_name , line_num , scenario_name )
896
896
return display_id
897
897
@@ -966,7 +966,7 @@ def dashboard_pre_processing():
966
966
else :
967
967
scenario_name = row .split (" Scenario Outline: " )[- 1 ]
968
968
if " -- @" in scenario_name :
969
- scenario_name = scenario_name .split (" -- @ " )[0 ]
969
+ scenario_name = scenario_name .split (" # " )[0 ]. rstrip ()
970
970
elif " # features/" in scenario_name :
971
971
scenario_name = scenario_name .split (" # features/" )[0 ]
972
972
else :
@@ -989,7 +989,7 @@ def dashboard_pre_processing():
989
989
def _create_dashboard_assets_ ():
990
990
import codecs
991
991
from seleniumbase .js_code .live_js import live_js
992
- from seleniumbase .core .style_sheet import pytest_style
992
+ from seleniumbase .core .style_sheet import get_pytest_style
993
993
994
994
abs_path = os .path .abspath ("." )
995
995
assets_folder = os .path .join (abs_path , "assets" )
@@ -1001,11 +1001,11 @@ def _create_dashboard_assets_():
1001
1001
existing_pytest_style = None
1002
1002
with open (pytest_style_css , "r" ) as f :
1003
1003
existing_pytest_style = f .read ()
1004
- if existing_pytest_style == pytest_style :
1004
+ if existing_pytest_style == get_pytest_style () :
1005
1005
add_pytest_style_css = False
1006
1006
if add_pytest_style_css :
1007
1007
out_file = codecs .open (pytest_style_css , "w+" , encoding = "utf-8" )
1008
- out_file .writelines (pytest_style )
1008
+ out_file .writelines (get_pytest_style () )
1009
1009
out_file .close ()
1010
1010
live_js_file = os .path .join (assets_folder , "live.js" )
1011
1011
add_live_js_file = True
@@ -1082,8 +1082,17 @@ def _perform_behave_unconfigure_():
1082
1082
)
1083
1083
find_it_3 = '<td class="col-result">Untested</td>'
1084
1084
swap_with_3 = '<td class="col-result">Unreported</td>'
1085
- find_it_4 = 'href="%s"' % constants .Dashboard .DASH_PIE_PNG_1
1086
- swap_with_4 = 'href="%s"' % constants .Dashboard .DASH_PIE_PNG_2
1085
+ if sys .version_info [0 ] >= 3 :
1086
+ # These use caching to prevent extra method calls
1087
+ DASH_PIE_PNG_1 = constants .Dashboard .get_dash_pie_1 ()
1088
+ DASH_PIE_PNG_2 = constants .Dashboard .get_dash_pie_2 ()
1089
+ else :
1090
+ from seleniumbase .core import encoded_images
1091
+
1092
+ DASH_PIE_PNG_1 = encoded_images .get_dash_pie_png1 ()
1093
+ DASH_PIE_PNG_2 = encoded_images .get_dash_pie_png2 ()
1094
+ find_it_4 = 'href="%s"' % DASH_PIE_PNG_1
1095
+ swap_with_4 = 'href="%s"' % DASH_PIE_PNG_2
1087
1096
try :
1088
1097
abs_path = os .path .abspath ("." )
1089
1098
dashboard_path = os .path .join (abs_path , "dashboard.html" )
0 commit comments