Skip to content

Commit 3977aa5

Browse files
committed
Update example tests
1 parent 5a33e73 commit 3977aa5

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

examples/test_iframes.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class FrameTests(BaseCase):
5+
def test_iframe_basics(self):
6+
self.open(
7+
"https://www.w3schools.com/html/tryit.asp"
8+
"?filename=tryhtml_iframe_height_width_css"
9+
)
10+
self.ad_block() # Reduce noise during automation
11+
self.switch_to_frame("iframeResult") # Enter the iFrame
12+
self.assert_text("HTML Iframes", "h2")
13+
self.switch_to_frame('[title*="Iframe"]') # Enter iFrame inside iFrame
14+
self.assert_text("This page is displayed in an iframe", "h1")
15+
self.switch_to_default_content() # Exit all iFrames
16+
self.switch_to_frame("iframeResult") # Go back inside 1st iFrame
17+
self.highlight('iframe[title="Iframe Example"]')
18+
19+
def test_set_content_to_frame(self):
20+
self.open(
21+
"https://www.w3schools.com/html/tryit.asp"
22+
"?filename=tryhtml_iframe_height_width_css"
23+
)
24+
self.set_content_to_frame("iframeResult")
25+
self.highlight('iframe[title="Iframe Example"]', loops=8)

examples/upload_file_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def test_file_upload_button(self):
1010
"https://www.w3schools.com/jsref/tryit.asp"
1111
"?filename=tryjsref_fileupload_get"
1212
)
13-
self.ad_block()
14-
self.switch_to_frame("iframeResult")
13+
self.set_content_to_frame("iframeResult")
1514
zoom_in = 'input[type="file"]{zoom: 1.6;-moz-transform: scale(1.6);}'
1615
self.add_css_style(zoom_in)
1716
self.highlight('input[type="file"]')

0 commit comments

Comments
 (0)