1
- from selenium .webdriver .common .keys import Keys
2
1
from seleniumbase import BaseCase
3
2
4
3
@@ -19,22 +18,25 @@ def test_demo_page(self):
19
18
self .update_text ("textarea.area1" , "Testing Time!\n " )
20
19
self .update_text ('[name="preText2"]' , "Typing Text!" )
21
20
21
+ # Verify that a hover dropdown link changes page text
22
+ self .assert_text ("Automation Practice" , "h3" )
23
+ self .hover_and_click ("#myDropdown" , "#dropOption2" )
24
+ self .assert_text ("Link Two Selected" , "h3" )
25
+
22
26
# Verify that a button click changes text on the page
23
27
self .assert_text ("This Text is Green" , "#pText" )
24
28
self .click ("#myButton" )
25
29
self .assert_text ("This Text is Purple" , "#pText" )
26
30
27
- # Verify that the hover dropdown option changes text
28
- self .assert_text ("Automation Practice" , "h3" )
29
- self .hover_and_click ("#myDropdown" , "#dropOption2" )
30
- self .assert_text ("Link Two Selected" , "h3" )
31
+ # Assert that the given SVG is visible on the page
32
+ self .assert_element ('svg[name="svgName"]' )
31
33
32
- # Verify that moving a " slider" updates a progrss bar
34
+ # Verify that a slider control updates a progrss bar
33
35
self .assert_element ('progress[value="50"]' )
34
- self .send_keys ("#myslider" , Keys . RIGHT + Keys . RIGHT )
36
+ self .press_right_arrow ("#myslider" , times = 5 )
35
37
self .assert_element ('progress[value="100"]' )
36
38
37
- # Verify that the "select" option updates a meter bar
39
+ # Verify that a "select" option updates a meter bar
38
40
self .assert_element ('meter[value="0.25"]' )
39
41
self .select_option_by_text ("#mySelect" , "Set to 75%" )
40
42
self .assert_element ('meter[value="0.75"]' )
@@ -61,8 +63,5 @@ def test_demo_page(self):
61
63
self .click ("#radioButton2" )
62
64
self .assert_true (self .is_selected ("#radioButton2" ))
63
65
64
- # Assert that the SVG is visible on the page
65
- self .assert_element ('svg[name="svgName"]' )
66
-
67
66
# Assert the title of the current web page
68
67
self .assert_title ("Web Testing Page" )
0 commit comments