@@ -2988,8 +2988,7 @@ def save_screenshot_to_logs(
2988
2988
(The last_page / failure screenshot is always "screenshot.png")
2989
2989
The screenshot will be in PNG format."""
2990
2990
self .wait_for_ready_state_complete ()
2991
- test_id = self .__get_test_id ()
2992
- test_logpath = self .log_path + "/" + test_id
2991
+ test_logpath = os .path .join (self .log_path , self .__get_test_id ())
2993
2992
self .__create_log_path_as_needed (test_logpath )
2994
2993
if name :
2995
2994
name = str (name )
@@ -11202,6 +11201,7 @@ def __get_test_id(self):
11202
11201
)
11203
11202
if self ._sb_test_identifier and len (str (self ._sb_test_identifier )) > 6 :
11204
11203
test_id = self ._sb_test_identifier
11204
+ test_id = test_id .replace (".py::" , "." ).replace ("::" , "." )
11205
11205
return test_id
11206
11206
11207
11207
def __get_test_id_2 (self ):
@@ -11627,8 +11627,7 @@ def save_teardown_screenshot(self):
11627
11627
except Exception :
11628
11628
return
11629
11629
if self .__has_exception () or self .save_screenshot_after_test :
11630
- test_id = self .__get_test_id ()
11631
- test_logpath = self .log_path + "/" + test_id
11630
+ test_logpath = os .path .join (self .log_path , self .__get_test_id ())
11632
11631
self .__create_log_path_as_needed (test_logpath )
11633
11632
self .__set_last_page_screenshot ()
11634
11633
self .__set_last_page_url ()
@@ -11718,7 +11717,7 @@ def tearDown(self):
11718
11717
and not has_exception
11719
11718
and self .save_screenshot_after_test
11720
11719
):
11721
- test_logpath = self .log_path + "/" + test_id
11720
+ test_logpath = os . path . join ( self .log_path , test_id )
11722
11721
self .__create_log_path_as_needed (test_logpath )
11723
11722
if not self .__last_page_screenshot_png :
11724
11723
self .__set_last_page_screenshot ()
@@ -11731,7 +11730,7 @@ def tearDown(self):
11731
11730
)
11732
11731
self .__add_pytest_html_extra ()
11733
11732
if self .with_testing_base and has_exception :
11734
- test_logpath = self .log_path + "/" + test_id
11733
+ test_logpath = os . path . join ( self .log_path , test_id )
11735
11734
self .__create_log_path_as_needed (test_logpath )
11736
11735
if (
11737
11736
not self .with_screen_shots
@@ -11861,7 +11860,7 @@ def tearDown(self):
11861
11860
# (Nosetests)
11862
11861
if has_exception :
11863
11862
test_id = self .__get_test_id ()
11864
- test_logpath = self .log_path + "/" + test_id
11863
+ test_logpath = os . path . join ( self .log_path , test_id )
11865
11864
self .__create_log_path_as_needed (test_logpath )
11866
11865
log_helper .log_test_failure_data (
11867
11866
self ,
@@ -11885,7 +11884,7 @@ def tearDown(self):
11885
11884
)
11886
11885
elif self .save_screenshot_after_test :
11887
11886
test_id = self .__get_test_id ()
11888
- test_logpath = self .log_path + "/" + test_id
11887
+ test_logpath = os . path . join ( self .log_path , test_id )
11889
11888
self .__create_log_path_as_needed (test_logpath )
11890
11889
if not self .__last_page_screenshot_png :
11891
11890
self .__set_last_page_screenshot ()
0 commit comments