File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 66class GoogleTests (BaseCase ):
77 def test_google_dot_com (self ):
88 self .open ("https://google.com/ncr" )
9- self .sleep (0.4 )
9+ self .assert_title_contains ("Google" )
10+ self .sleep (0.25 )
1011 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 ()
1216 self .type (HomePage .search_box , "github.com" )
1317 self .assert_element (HomePage .search_button )
1418 self .assert_element (HomePage .feeling_lucky_button )
Original file line number Diff line number Diff line change 66class GooglePage :
77 def go_to_google (self , sb ):
88 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 )
1217
1318 def do_search (self , sb , search_term ):
19+ sb .sleep (0.05 )
1420 sb .click ('[title="Search"]' )
1521 sb .type ('[title="Search"]' , search_term + "\n " )
1622
@@ -30,6 +36,8 @@ def test_page_objects(self):
3036 search_term = "SeleniumBase.io Docs"
3137 expected_text = "SeleniumBase"
3238 GooglePage ().go_to_google (self )
39+ GooglePage ().assert_google_title (self )
40+ GooglePage ().hide_sign_in_pop_up (self )
3341 GooglePage ().do_search (self , search_term )
3442 self .assert_text (expected_text , "#search" )
3543 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):
1010 self .clear_local_storage ()
1111 self .click ('a[href="examples/%s"]' % framework )
1212 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 ())
1317 new_todo_input = "input.new-todo"
1418 todo_count_span = "span.todo-count"
1519 self .type (new_todo_input , "Learn Python\n " )
You can’t perform that action at this time.
0 commit comments