File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
examples/boilerplates/page_object_model Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ '''
2
+ Google.com page objects
3
+ '''
4
+
5
+
6
+ class HomePage (object ):
7
+ google_logo = 'img[alt="Google"]'
8
+ search_box = 'input[title="Search"]'
9
+ search_button = 'input[value="Google Search"]'
10
+ feeling_lucky_button = '''input[value="I'm Feeling Lucky"]'''
11
+
12
+
13
+ class ResultsPage (object ):
14
+ search_results = 'div#center_col'
Original file line number Diff line number Diff line change
1
+ '''
2
+ Google.com testing example
3
+ '''
4
+
5
+ from seleniumbase import BaseCase
6
+ from google_objects import HomePage , ResultsPage
7
+
8
+
9
+ class GoogleTests (BaseCase ):
10
+
11
+ def test_google_dot_com (self ):
12
+ self .open ('http://www.google.com' )
13
+ self .assert_element_present (HomePage .google_logo )
14
+ self .update_text (HomePage .search_box , "github\n " )
15
+ self .assert_text ("github.com" , ResultsPage .search_results )
16
+ self .click_link_text ("Images" )
17
+ self .assert_element ('img[alt="Image result for github"]' )
You can’t perform that action at this time.
0 commit comments