File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,19 @@ def test_iframe_basics(self):
17
17
self .switch_to_frame ("iframeResult" ) # Go back inside 1st iframe
18
18
self .highlight ('iframe[title="Iframe Example"]' )
19
19
20
+ def test_iframes_with_context_manager (self ):
21
+ self .open ("https://seleniumbase.io/w3schools/iframes.html" )
22
+ with self .frame_switch ("iframeResult" ):
23
+ self .assert_text ("HTML Iframes" , "h2" )
24
+ with self .frame_switch ('[title*="Iframe"]' ):
25
+ self .assert_text ("This page is displayed in an iframe" , "h1" )
26
+ self .assert_text ("Use CSS width & height to specify" , "p" )
27
+ with self .frame_switch ('[title*="Iframe"]' ):
28
+ self .assert_text ("seleniumbase.io/w3schools/iframes" , "a" )
29
+ self .click ("button#runbtn" )
30
+ with self .frame_switch ("iframeResult" ):
31
+ self .highlight ('iframe[title="Iframe Example"]' )
32
+
20
33
def test_set_content_to_frame (self ):
21
34
self .open ("https://seleniumbase.io/w3schools/iframes.html" )
22
35
self .set_content_to_frame ("iframeResult" )
You can’t perform that action at this time.
0 commit comments