Skip to content

Commit ab43a74

Browse files
authored
Merge pull request #1541 from seleniumbase/fix-all-known-bugs
Fix all known bugs
2 parents 2e27f31 + b4b2180 commit ab43a74

File tree

15 files changed

+757
-549
lines changed

15 files changed

+757
-549
lines changed

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.5.3"
2+
__version__ = "4.5.4"

seleniumbase/behave/behave_sb.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -862,14 +862,14 @@ def calculate_test_id(file_name, scenario_name):
862862
scenario_name = re.sub(r"[^\w" + r"_ " + r"]", "", scenario_name)
863863
scenario_name = scenario_name.replace(" ", "_")
864864
if " -- @" in scenario_name:
865-
scenario_name = scenario_name.split(" -- @")[0]
865+
scenario_name = scenario_name.split(" # ")[0].rstrip()
866866
test_id = "%s.%s" % (file_name, scenario_name)
867867
return test_id
868868

869869

870870
def calculate_display_id(file_name, line_num, scenario_name):
871871
if " -- @" in scenario_name:
872-
scenario_name = scenario_name.split(" -- @")[0]
872+
scenario_name = scenario_name.split(" # ")[0].rstrip()
873873
display_id = "%s:%s => %s" % (file_name, line_num, scenario_name)
874874
return display_id
875875

@@ -879,7 +879,7 @@ def get_test_id():
879879
file_name = file_name.replace("/", ".").replace("\\", ".")
880880
scenario_name = sb_config.behave_scenario.name
881881
if " -- @" in scenario_name:
882-
scenario_name = scenario_name.split(" -- @")[0]
882+
scenario_name = scenario_name.split(" # ")[0].rstrip()
883883
scenario_name = re.sub(r"[^\w" + r"_ " + r"]", "", scenario_name)
884884
scenario_name = scenario_name.replace(" ", "_")
885885
test_id = "%s.%s" % (file_name, scenario_name)
@@ -891,7 +891,7 @@ def get_display_id():
891891
line_num = str(sb_config.behave_scenario.line)
892892
scenario_name = sb_config.behave_scenario.name
893893
if " -- @" in scenario_name:
894-
scenario_name = scenario_name.split(" -- @")[0]
894+
scenario_name = scenario_name.split(" # ")[0].rstrip()
895895
display_id = "%s:%s => %s" % (file_name, line_num, scenario_name)
896896
return display_id
897897

@@ -966,7 +966,7 @@ def dashboard_pre_processing():
966966
else:
967967
scenario_name = row.split(" Scenario Outline: ")[-1]
968968
if " -- @" in scenario_name:
969-
scenario_name = scenario_name.split(" -- @")[0]
969+
scenario_name = scenario_name.split(" # ")[0].rstrip()
970970
elif " # features/" in scenario_name:
971971
scenario_name = scenario_name.split(" # features/")[0]
972972
else:
@@ -989,7 +989,7 @@ def dashboard_pre_processing():
989989
def _create_dashboard_assets_():
990990
import codecs
991991
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
993993

994994
abs_path = os.path.abspath(".")
995995
assets_folder = os.path.join(abs_path, "assets")
@@ -1001,11 +1001,11 @@ def _create_dashboard_assets_():
10011001
existing_pytest_style = None
10021002
with open(pytest_style_css, "r") as f:
10031003
existing_pytest_style = f.read()
1004-
if existing_pytest_style == pytest_style:
1004+
if existing_pytest_style == get_pytest_style():
10051005
add_pytest_style_css = False
10061006
if add_pytest_style_css:
10071007
out_file = codecs.open(pytest_style_css, "w+", encoding="utf-8")
1008-
out_file.writelines(pytest_style)
1008+
out_file.writelines(get_pytest_style())
10091009
out_file.close()
10101010
live_js_file = os.path.join(assets_folder, "live.js")
10111011
add_live_js_file = True
@@ -1082,8 +1082,17 @@ def _perform_behave_unconfigure_():
10821082
)
10831083
find_it_3 = '<td class="col-result">Untested</td>'
10841084
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
10871096
try:
10881097
abs_path = os.path.abspath(".")
10891098
dashboard_path = os.path.join(abs_path, "dashboard.html")

seleniumbase/console_scripts/sb_behave_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def main():
452452
else:
453453
scenario_name = row.split(" Scenario Outline: ")[-1]
454454
if " -- @" in scenario_name:
455-
scenario_name = scenario_name.split(" -- @")[0]
455+
scenario_name = scenario_name.split(" # ")[0].rstrip()
456456
elif " # features/" in scenario_name:
457457
scenario_name = scenario_name.split(" # features/")[0]
458458
else:

0 commit comments

Comments
 (0)