File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 1- """Call a file with "python" instead of using "pytest" directly .
1+ """Call a file with "python" instead of "pytest".
22To run, use: "python raw_file_call.py".
33On newer version of SeleniumBase, use:
44BaseCase.main(__name__, __file__)"""
55from seleniumbase import BaseCase
66
7- if __name__ == "__main__" : # If "python", run pytest
7+ if __name__ == "__main__" :
88 from pytest import main
99 main ([__file__ , "-s" ])
1010
Original file line number Diff line number Diff line change @@ -26,11 +26,10 @@ def test_beautiful_soup_and_tinymce(self):
2626 self .type ('input[aria-label="Width"].mce-textbox' , "300" )
2727 image_url = "https://seleniumbase.github.io/img/sb_logo_10.png"
2828 self .type ("input.mce-textbox" , image_url + "\n " )
29- self .switch_to_frame ("iframe" )
30- self .click ("h2" )
31- self .switch_to_default_content ()
32- self .post_message ("Automate anything with SeleniumBase!" )
29+ with self .frame_switch ("iframe" ):
30+ self .click ("h2" )
31+ self .post_message ("Automate anything with SeleniumBase!" )
3332 self .click_menu_item ("File" )
3433 self .click_menu_item ("Preview" )
35- self .switch_to_frame ('iframe[sandbox="allow-scripts"]' )
36- self .post_message ("Learn SeleniumBase Today!" )
34+ with self .frame_switch ('iframe[sandbox="allow-scripts"]' ):
35+ self .post_message ("Learn SeleniumBase Today!" )
Original file line number Diff line number Diff line change @@ -11,15 +11,14 @@ def test_tinymce(self):
1111 self .click ('span:contains("Heading 2")' )
1212 self .switch_to_frame ("iframe" )
1313 self .add_text ("#tinymce" , "Automate anything with SeleniumBase!\n " )
14- self .switch_to_default_content ()
14+ self .switch_to_parent_frame ()
1515 self .click ("button i.mce-i-image" )
1616 self .type ('input[aria-label="Width"].mce-textbox' , "300" )
1717 image_url = "https://seleniumbase.github.io/img/sb_logo_10.png"
1818 self .type ("input.mce-textbox" , image_url + "\n " )
19- self .switch_to_frame ("iframe" )
20- self .click ("h2" )
21- self .post_message ("Automate anything with SeleniumBase!" )
22- self .switch_to_default_content ()
19+ with self .frame_switch ("iframe" ):
20+ self .click ("h2" )
21+ self .post_message ("Automate anything with SeleniumBase!" )
2322 self .click ('span:contains("File")' )
2423 self .click ('span:contains("Preview")' )
2524 self .switch_to_frame ('iframe[sandbox="allow-scripts"]' )
You can’t perform that action at this time.
0 commit comments