Skip to content

Commit d77472c

Browse files
authored
Merge pull request #1102 from seleniumbase/fix-log-path-issue-with-sb-fixture-tests
Use the correct log path for tests that use the "sb" fixture
2 parents 97ab233 + fd1eda6 commit d77472c

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ decorator==5.1.0;python_version>="3.5"
8888
ipython==5.10.0;python_version<"3.5"
8989
ipython==7.9.0;python_version>="3.5" and python_version<"3.6"
9090
ipython==7.16.1;python_version>="3.6" and python_version<"3.7"
91-
ipython==7.30.0;python_version>="3.7"
91+
ipython==7.30.1;python_version>="3.7"
9292
matplotlib-inline==0.1.3;python_version>="3.7"
9393
colorama==0.4.4
9494
platformdirs==2.0.2;python_version<"3.6"
@@ -109,7 +109,7 @@ Pillow==7.2.0;python_version>="3.5" and python_version<"3.6"
109109
Pillow==8.4.0;python_version>="3.6"
110110
typing-extensions==3.10.0.2;python_version<"3.6"
111111
typing-extensions==4.0.0;python_version>="3.6" and python_version<"3.8"
112-
rich==10.15.1;python_version>="3.6" and python_version<"4.0"
112+
rich==10.15.2;python_version>="3.6" and python_version<"4.0"
113113
tornado==5.1.1;python_version<"3.5"
114114
tornado==6.1;python_version>="3.5"
115115
pdfminer.six==20191110;python_version<"3.5"

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__ = "2.2.4"
2+
__version__ = "2.2.5"

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,8 +2988,7 @@ def save_screenshot_to_logs(
29882988
(The last_page / failure screenshot is always "screenshot.png")
29892989
The screenshot will be in PNG format."""
29902990
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())
29932992
self.__create_log_path_as_needed(test_logpath)
29942993
if name:
29952994
name = str(name)
@@ -11202,6 +11201,7 @@ def __get_test_id(self):
1120211201
)
1120311202
if self._sb_test_identifier and len(str(self._sb_test_identifier)) > 6:
1120411203
test_id = self._sb_test_identifier
11204+
test_id = test_id.replace(".py::", ".").replace("::", ".")
1120511205
return test_id
1120611206

1120711207
def __get_test_id_2(self):
@@ -11627,8 +11627,7 @@ def save_teardown_screenshot(self):
1162711627
except Exception:
1162811628
return
1162911629
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())
1163211631
self.__create_log_path_as_needed(test_logpath)
1163311632
self.__set_last_page_screenshot()
1163411633
self.__set_last_page_url()
@@ -11718,7 +11717,7 @@ def tearDown(self):
1171811717
and not has_exception
1171911718
and self.save_screenshot_after_test
1172011719
):
11721-
test_logpath = self.log_path + "/" + test_id
11720+
test_logpath = os.path.join(self.log_path, test_id)
1172211721
self.__create_log_path_as_needed(test_logpath)
1172311722
if not self.__last_page_screenshot_png:
1172411723
self.__set_last_page_screenshot()
@@ -11731,7 +11730,7 @@ def tearDown(self):
1173111730
)
1173211731
self.__add_pytest_html_extra()
1173311732
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)
1173511734
self.__create_log_path_as_needed(test_logpath)
1173611735
if (
1173711736
not self.with_screen_shots
@@ -11861,7 +11860,7 @@ def tearDown(self):
1186111860
# (Nosetests)
1186211861
if has_exception:
1186311862
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)
1186511864
self.__create_log_path_as_needed(test_logpath)
1186611865
log_helper.log_test_failure_data(
1186711866
self,
@@ -11885,7 +11884,7 @@ def tearDown(self):
1188511884
)
1188611885
elif self.save_screenshot_after_test:
1188711886
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)
1188911888
self.__create_log_path_as_needed(test_logpath)
1189011889
if not self.__last_page_screenshot_png:
1189111890
self.__set_last_page_screenshot()

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
'ipython==5.10.0;python_version<"3.5"',
208208
'ipython==7.9.0;python_version>="3.5" and python_version<"3.6"',
209209
'ipython==7.16.1;python_version>="3.6" and python_version<"3.7"',
210-
'ipython==7.30.0;python_version>="3.7"', # Requires matplotlib-inline
210+
'ipython==7.30.1;python_version>="3.7"', # Requires matplotlib-inline
211211
'matplotlib-inline==0.1.3;python_version>="3.7"', # ipython needs this
212212
"colorama==0.4.4",
213213
'platformdirs==2.0.2;python_version<"3.6"',
@@ -228,7 +228,7 @@
228228
'Pillow==8.4.0;python_version>="3.6"',
229229
'typing-extensions==3.10.0.2;python_version<"3.6"', # <3.8 for "rich"
230230
'typing-extensions==4.0.0;python_version>="3.6" and python_version<"3.8"', # noqa: E501
231-
'rich==10.15.1;python_version>="3.6" and python_version<"4.0"',
231+
'rich==10.15.2;python_version>="3.6" and python_version<"4.0"',
232232
'tornado==5.1.1;python_version<"3.5"',
233233
'tornado==6.1;python_version>="3.5"',
234234
'pdfminer.six==20191110;python_version<"3.5"',

0 commit comments

Comments
 (0)