File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change
1
+ """ TAG:contains("TEXT") is a special, non-standard CSS Selector
2
+ that gets converted to XPath: '//TAG[contains(., "TEXT")]'
3
+ before it's used by Selenium calls. Also part of jQuery. """
1
4
from seleniumbase import BaseCase
2
5
3
6
Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ def test_mfa_login(self):
6
6
self .open ("https://seleniumbase.io/realworld/login" )
7
7
self .type ("#username" , "demo_user" )
8
8
self .type ("#password" , "secret_pass" )
9
- self .enter_mfa_code ("#totpcode" , "GAXG2MTEOR3DMMDG" )
10
- self .highlight ("img#image1" )
9
+ self .enter_mfa_code ("#totpcode" , "GAXG2MTEOR3DMMDG" ) # 6-digit
10
+ self .highlight ("img#image1" ) # A fancier assert_element() call
11
11
self .click ('a:contains("This Page")' )
12
12
self .assert_text ("Welcome!" , "h1" )
13
- self .save_screenshot_to_logs ()
13
+ self .save_screenshot_to_logs () # In "./latest_logs/" folder.
14
+ self .click_link ("Sign out" ) # Must be "a" tag. Not "button".
15
+ self .assert_element ('a:contains("Sign in")' )
16
+ self .assert_text ("You have been signed out!" , "#top_message" )
You can’t perform that action at this time.
0 commit comments