Skip to content

Commit ef0223e

Browse files
committed
Update examples
1 parent fd4bef3 commit ef0223e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

examples/raw_parameter_script.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
sb.js_checking_on = False
7979
sb.recorder_mode = False
8080
sb.recorder_ext = False
81+
sb.record_sleep = False
82+
sb.rec_behave = False
8183
sb.report_on = False
8284
sb.is_pytest = False
8385
sb.slow_mode = False

examples/test_download_files.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,29 @@
33

44

55
class DownloadTests(BaseCase):
6-
def test_download_files(self):
6+
def test_download_chromedriver_notes(self):
7+
self.open("https://chromedriver.chromium.org/downloads")
8+
notes_file = "notes.txt"
9+
notes_link = (
10+
"https://chromedriver.storage.googleapis.com"
11+
"/101.0.4951.41/%s" % notes_file
12+
)
13+
self.download_file(notes_link)
14+
self.assert_downloaded_file(notes_file)
15+
notes_path = self.get_path_of_downloaded_file(notes_file)
16+
with open(notes_path, "r") as f:
17+
notes_data = f.read()
18+
self.assert_true(len(notes_data) > 100) # Verify file not empty
19+
text = "Switching to nested frame fails with chrome/chromedriver 100"
20+
self.assert_true(text in notes_data) # Verify file has expected data
21+
22+
def test_download_files_from_pypi_with_edge(self):
23+
if self.browser != "edge":
24+
self.open("data:,")
25+
print("\n This test is only for Microsoft Edge (Chromium)!")
26+
print(' (Run this test using "--edge" or "--browser=edge")')
27+
self.skip('Use "--edge" or "--browser=edge"')
28+
729
self.open("https://pypi.org/project/seleniumbase/#files")
830
pkg_header = self.get_text("h1.package-header__name").strip()
931
pkg_name = pkg_header.replace(" ", "-")

0 commit comments

Comments
 (0)