File tree 3 files changed +21
-5
lines changed 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 6
6
class GoogleTests (BaseCase ):
7
7
def test_google_dot_com (self ):
8
8
self .open ("https://google.com/ncr" )
9
- self .sleep (0.4 )
9
+ self .assert_title_contains ("Google" )
10
+ self .sleep (0.25 )
10
11
self .save_screenshot_to_logs () # ("./latest_logs" folder)
11
- self .sleep (0.2 )
12
+ self .sleep (0.15 )
13
+ self .hide_elements ('iframe' ) # Hide "Sign in" pop-up
14
+ self .sleep (0.15 )
15
+ self .save_screenshot_to_logs ()
12
16
self .type (HomePage .search_box , "github.com" )
13
17
self .assert_element (HomePage .search_button )
14
18
self .assert_element (HomePage .feeling_lucky_button )
Original file line number Diff line number Diff line change 6
6
class GooglePage :
7
7
def go_to_google (self , sb ):
8
8
sb .open ("https://google.com/ncr" )
9
- sb .sleep (0.1 )
10
- sb .hide_elements ('iframe' ) # Hide "Sign in" pop-up
11
- sb .sleep (0.2 )
9
+
10
+ def assert_google_title (self , sb ):
11
+ sb .assert_title_contains ("Google" )
12
+
13
+ def hide_sign_in_pop_up (self , sb ):
14
+ sb .sleep (0.25 )
15
+ sb .hide_elements ('iframe' )
16
+ sb .sleep (0.15 )
12
17
13
18
def do_search (self , sb , search_term ):
19
+ sb .sleep (0.05 )
14
20
sb .click ('[title="Search"]' )
15
21
sb .type ('[title="Search"]' , search_term + "\n " )
16
22
@@ -30,6 +36,8 @@ def test_page_objects(self):
30
36
search_term = "SeleniumBase.io Docs"
31
37
expected_text = "SeleniumBase"
32
38
GooglePage ().go_to_google (self )
39
+ GooglePage ().assert_google_title (self )
40
+ GooglePage ().hide_sign_in_pop_up (self )
33
41
GooglePage ().do_search (self , search_term )
34
42
self .assert_text (expected_text , "#search" )
35
43
GooglePage ().click_search_result (self , expected_text )
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ def test_todomvc(self, framework):
10
10
self .clear_local_storage ()
11
11
self .click ('a[href="examples/%s"]' % framework )
12
12
self .assert_element ("section.todoapp" )
13
+ self .assert_text ("todos" , "header h1" )
14
+ self .wait_for_ready_state_complete ()
15
+ title = self .get_title ()
16
+ self .assert_in (framework , title .lower ())
13
17
new_todo_input = "input.new-todo"
14
18
todo_count_span = "span.todo-count"
15
19
self .type (new_todo_input , "Learn Python\n " )
You can’t perform that action at this time.
0 commit comments