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".
2
2
To run, use: "python raw_file_call.py".
3
3
On newer version of SeleniumBase, use:
4
4
BaseCase.main(__name__, __file__)"""
5
5
from seleniumbase import BaseCase
6
6
7
- if __name__ == "__main__" : # If "python", run pytest
7
+ if __name__ == "__main__" :
8
8
from pytest import main
9
9
main ([__file__ , "-s" ])
10
10
Original file line number Diff line number Diff line change @@ -26,11 +26,10 @@ def test_beautiful_soup_and_tinymce(self):
26
26
self .type ('input[aria-label="Width"].mce-textbox' , "300" )
27
27
image_url = "https://seleniumbase.github.io/img/sb_logo_10.png"
28
28
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!" )
33
32
self .click_menu_item ("File" )
34
33
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):
11
11
self .click ('span:contains("Heading 2")' )
12
12
self .switch_to_frame ("iframe" )
13
13
self .add_text ("#tinymce" , "Automate anything with SeleniumBase!\n " )
14
- self .switch_to_default_content ()
14
+ self .switch_to_parent_frame ()
15
15
self .click ("button i.mce-i-image" )
16
16
self .type ('input[aria-label="Width"].mce-textbox' , "300" )
17
17
image_url = "https://seleniumbase.github.io/img/sb_logo_10.png"
18
18
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!" )
23
22
self .click ('span:contains("File")' )
24
23
self .click ('span:contains("Preview")' )
25
24
self .switch_to_frame ('iframe[sandbox="allow-scripts"]' )
You can’t perform that action at this time.
0 commit comments