File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
examples/offline_examples Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ import pytest
2
+ from seleniumbase import BaseCase
3
+
4
+
5
+ @pytest .mark .offline # Can be run with: "pytest -m offline"
6
+ class OfflineTests (BaseCase ):
7
+
8
+ def test_load_html_string (self ):
9
+ html = "<h2>Hello</h2><p><input /> <button>OK!</button></p>"
10
+ self .load_html_string (html ) # Open "data:text/html," then replace html
11
+ self .assert_text ("Hello" , "h2" )
12
+ self .assert_text ("OK!" , "button" )
13
+ self .type ("input" , "Goodbye" )
14
+ self .click ("button" )
15
+ new_html = '<h3>Checkbox</h3><p><input type="checkbox" />Check Me!</p>'
16
+ self .set_content (new_html ) # Same as load_html_string(), but keeps URL
17
+ self .assert_text ("Checkbox" , "h3" )
18
+ self .assert_text ("Check Me!" , "p" )
19
+ self .assert_false (self .is_selected ("input" ))
20
+ self .click ("input" )
21
+ self .assert_true (self .is_selected ("input" ))
You can’t perform that action at this time.
0 commit comments