File tree Expand file tree Collapse file tree 3 files changed +15
-18
lines changed Expand file tree Collapse file tree 3 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,13 @@ class MyTestClass(BaseCase):
72
72
self .open(' http://xkcd.com/353/' )
73
73
self .assert_element(' img[alt="Python"]' )
74
74
self .click(' a[rel="license"]' )
75
- self .assert_text(' copy and reuse' , ' div center' )
75
+ text = self .get_text(" div center" )
76
+ self .assertTrue(" reuse any of my drawings" in text)
76
77
self .open(' http://xkcd.com/1481/' )
77
- caption = self .get_attribute(' #comic img' , ' title' )
78
- self .assertTrue(' connections to the server' in caption )
78
+ title = self .get_attribute(' #comic img' , ' title' )
79
+ self .assertTrue(' connections to the server' in title )
79
80
self .click_link_text(' Blag' )
80
- self .assert_text(' xkcd' , ' #site-title' )
81
- header_text = self .get_text(' header h2' )
82
- self .assertTrue(' The blag of the webcomic' in header_text)
81
+ self .assert_text(' The blag of the webcomic' , ' h2' )
83
82
self .update_text(' input#s' , ' Robots!\n ' )
84
83
self .assert_text(' Hooray robots!' , ' #content' )
85
84
self .open(' http://xkcd.com/1319/' )
Original file line number Diff line number Diff line change @@ -7,14 +7,13 @@ def test_basic(self):
7
7
self .open ('http://xkcd.com/353/' ) # Navigate to the web page
8
8
self .assert_element ('img[alt="Python"]' ) # Assert element on page
9
9
self .click ('a[rel="license"]' ) # Click element on page
10
- self .assert_text ('copy and reuse' , 'div center' ) # Assert element text
10
+ text = self .get_text ("div center" ) # Grab text from page element
11
+ self .assertTrue ("reuse any of my drawings" in text )
11
12
self .open ('http://xkcd.com/1481/' )
12
- caption = self .get_attribute ('#comic img' , 'title' ) # Get attribute
13
- self .assertTrue ('connections to the server' in caption )
13
+ title = self .get_attribute ('#comic img' , 'title' ) # Grab an attribute
14
+ self .assertTrue ('connections to the server' in title )
14
15
self .click_link_text ('Blag' ) # Click on link with the text
15
- self .assert_text ('xkcd' , '#site-title' )
16
- header_text = self .get_text ('header h2' ) # Grab text from page element
17
- self .assertTrue ('The blag of the webcomic' in header_text )
16
+ self .assert_text ('The blag of the webcomic' , 'h2' ) # Assert text in h2
18
17
self .update_text ('input#s' , 'Robots!\n ' ) # Fill in field with the text
19
18
self .assert_text ('Hooray robots!' , '#content' )
20
19
self .open ('http://xkcd.com/1319/' )
Original file line number Diff line number Diff line change @@ -7,14 +7,13 @@ def test_basic(self):
7
7
self .open ('http://xkcd.com/353/' )
8
8
self .assert_element ('img[alt="Python"]' )
9
9
self .click ('a[rel="license"]' )
10
- self .assert_text ('copy and reuse' , 'div center' )
10
+ text = self .get_text ("div center" )
11
+ self .assertTrue ("reuse any of my drawings" in text )
11
12
self .open ('http://xkcd.com/1481/' )
12
- caption = self .get_attribute ('#comic img' , 'title' )
13
- self .assertTrue ('connections to the server' in caption )
13
+ title = self .get_attribute ('#comic img' , 'title' )
14
+ self .assertTrue ('connections to the server' in title )
14
15
self .click_link_text ('Blag' )
15
- self .assert_text ('xkcd' , '#site-title' )
16
- header_text = self .get_text ('header h2' )
17
- self .assertTrue ('The blag of the webcomic' in header_text )
16
+ self .assert_text ('The blag of the webcomic' , 'h2' )
18
17
self .update_text ('input#s' , 'Robots!\n ' )
19
18
self .assert_text ('Hooray robots!' , '#content' )
20
19
self .open ('http://xkcd.com/1319/' )
You can’t perform that action at this time.
0 commit comments