Skip to content

Commit 5e3f3b8

Browse files
committed
Add test for asserting downloaded files
1 parent a028f9f commit 5e3f3b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/test_download_files.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class DownloadTests(BaseCase):
5+
6+
def test_download_files(self):
7+
self.open("https://pypi.org/project/seleniumbase/#files")
8+
pkg_header = self.get_text("h1.package-header__name")
9+
pkg_name = pkg_header.replace(" ", "-")
10+
whl_file = pkg_name + "-py2.py3-none-any.whl"
11+
self.click('div#files a[href$="%s"]' % whl_file)
12+
self.assert_downloaded_file(whl_file)
13+
tar_gz_file = pkg_name + ".tar.gz"
14+
self.click('div#files a[href$="%s"]' % tar_gz_file)
15+
self.assert_downloaded_file(tar_gz_file)

0 commit comments

Comments
 (0)