Skip to content

Commit 9cc8f00

Browse files
committed
Update the Shadow DOM example test
1 parent 8a03e0c commit 9cc8f00

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

examples/test_shadow_dom.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,28 @@ def download_tar_file_from_pypi(self, package):
1616
pkg_name = pkg_header.replace(" ", "-")
1717
tar_file = pkg_name + ".tar.gz"
1818
tar_selector = 'div#files a[href$="%s"]' % tar_file
19-
self.delete_downloaded_file_if_present(tar_file)
19+
self.delete_downloaded_file_if_present(tar_file, browser=True)
2020
self.click(tar_selector)
2121
return tar_file
2222

2323
def test_shadow_dom(self):
2424
if self.browser != "chrome":
2525
print("\n This test is for Google Chrome only!")
26-
self.skip('This test is for Google Chrome only!')
26+
self.skip("This test is for Google Chrome only!")
2727
if self.headless:
28-
print("\n This test does not run in headless mode!")
29-
self.skip('This test does not run in headless mode!')
28+
print("\n This test doesn't run in headless mode!")
29+
self.skip("This test doesn't run in headless mode!")
3030

31+
# Download Python package files from PyPI
3132
file_name_1 = self.download_tar_file_from_pypi("sbase")
3233
file_name_2 = self.download_tar_file_from_pypi("tensorpy")
34+
self.assert_downloaded_file(file_name_1, browser=True)
35+
self.assert_downloaded_file(file_name_2, browser=True)
3336

37+
# Navigate to the Chrome downloads page.
3438
self.open("chrome://downloads/")
39+
40+
# Shadow DOM selectors
3541
search_icon = (
3642
"downloads-manager::shadow downloads-toolbar::shadow"
3743
" cr-toolbar::shadow cr-toolbar-search-field::shadow"
@@ -64,3 +70,7 @@ def test_shadow_dom(self):
6470
self.assert_text("No search results found", no_downloads_area)
6571
self.click(clear_search_icon)
6672
self.assert_element(remove_button)
73+
74+
# Delete the downloaded files from the [Downloads Folder]
75+
self.delete_downloaded_file_if_present(file_name_1, browser=True)
76+
self.delete_downloaded_file_if_present(file_name_2, browser=True)

0 commit comments

Comments
 (0)