21
21
22
22
module Selenium
23
23
module WebDriver
24
- not_compliant_on browser : [ :safari , :firefox ] do
24
+ not_compliant_on browser : [ :safari ] do
25
25
not_compliant_on browser : [ :firefox , :ff_nightly ] , driver : :remote do
26
26
describe ActionBuilder do
27
27
describe 'Key actions' do
@@ -70,68 +70,69 @@ module WebDriver
70
70
expect ( keylogger . text ) . to match ( /keyup *$/ )
71
71
end
72
72
73
- # These requires pointer actions to be working in Firefox first
74
- not_compliant_on driver : [ :firefox , :ff_nightly ] do
75
- it 'can send keys to element' do
76
- driver . navigate . to url_for ( 'formPage.html' )
73
+ it 'can send multiple send_keys commands' do
74
+ driver . navigate . to url_for ( 'formPage.html' )
77
75
78
- input = driver . find_element ( css : '#working' )
76
+ input = driver . find_element ( css : '#working' )
77
+ input . click
79
78
80
- driver . action . send_keys ( input , 'abcd ' ) . perform
81
- wait . until { input . attribute ( :value ) . length == 4 }
82
- expect ( input . attribute ( :value ) ) . to eq ( 'abcd ' )
83
- end
79
+ driver . action . send_keys ( 'abcd' , 'dcba ' ) . perform
80
+ wait . until { input . attribute ( :value ) . length == 8 }
81
+ expect ( input . attribute ( :value ) ) . to eq ( 'abcddcba ' )
82
+ end
84
83
85
- it 'can send multiple send_keys commands' do
84
+ # Certain non-ascii keys are not working in Firefox yet (known but un-filed bug)
85
+ not_compliant_on driver : [ :firefox , :ff_nightly ] do
86
+ it 'can send non-ascii keys' do
86
87
driver . navigate . to url_for ( 'formPage.html' )
87
88
88
89
input = driver . find_element ( css : '#working' )
90
+ input . click
89
91
90
- driver . action . send_keys ( input , 'abcd' , 'dcba ') . perform
91
- wait . until { input . attribute ( :value ) . length == 8 }
92
- expect ( input . attribute ( :value ) ) . to eq ( 'abcddcba ' )
92
+ driver . action . send_keys ( 'abcd' , :left , 'a ') . perform
93
+ wait . until { input . attribute ( :value ) . length == 5 }
94
+ expect ( input . attribute ( :value ) ) . to eq ( 'abcad ' )
93
95
end
96
+ end
94
97
95
- # Certain non-ascii keys are not working in Firefox yet (known but un-filed bug)
96
- it 'can send non-ascii keys' do
98
+ # These requires pointer actions to be working in Firefox first
99
+ not_compliant_on driver : :firefox do
100
+ it 'can send keys to element' do
97
101
driver . navigate . to url_for ( 'formPage.html' )
98
102
99
103
input = driver . find_element ( css : '#working' )
100
104
101
- driver . action . send_keys ( input , 'abcd' , :left , 'a' ) . perform
102
- wait . until { input . attribute ( :value ) . length == 5 }
103
- expect ( input . attribute ( :value ) ) . to eq ( 'abcad ' )
105
+ driver . action . send_keys ( input , 'abcd' ) . perform
106
+ wait . until { input . attribute ( :value ) . length == 4 }
107
+ expect ( input . attribute ( :value ) ) . to eq ( 'abcd ' )
104
108
end
105
109
end
106
110
107
- compliant_on driver : :firefox do
108
- it 'can release pressed keys via release action' do
109
- driver . navigate . to url_for ( 'javascriptPage.html' )
111
+ it 'can release pressed keys via release action' do
112
+ driver . navigate . to url_for ( 'javascriptPage.html' )
110
113
111
- event_input = driver . find_element ( id : 'theworks' )
112
- keylogger = driver . find_element ( id : 'result' )
114
+ event_input = driver . find_element ( id : 'theworks' )
115
+ keylogger = driver . find_element ( id : 'result' )
113
116
114
- event_input . click
117
+ event_input . click
115
118
116
- driver . action . key_down ( :shift ) . perform
117
- wait . until { keylogger . text . include? 'down' }
118
- expect ( keylogger . text ) . to match ( /keydown *$/ )
119
+ driver . action . key_down ( :shift ) . perform
120
+ wait . until { keylogger . text . include? 'down' }
121
+ expect ( keylogger . text ) . to match ( /keydown *$/ )
119
122
120
- driver . action . release_actions
121
- wait . until { keylogger . text . include? 'up' }
122
- expect ( keylogger . text ) . to match ( /keyup *$/ )
123
- end
123
+ driver . action . release_actions
124
+ wait . until { keylogger . text . include? 'up' }
125
+ expect ( keylogger . text ) . to match ( /keyup *$/ )
124
126
end
125
127
end # Key actions
126
128
127
- not_compliant_on browser : [ :safari , :firefox , :ff_nightly ] do
129
+ not_compliant_on browser : [ :safari , :firefox ] do
128
130
describe 'Pointer actions' do
129
131
it 'clicks an element' do
130
- driver . navigate . to url_for ( 'formPage.html' )
131
- original_title = driver . title
132
- driver . action . click ( driver . find_element ( id : 'imageButton' ) ) . perform
133
- Wait . new . until { driver . title != original_title }
134
- expect ( driver . title ) . to eq 'We Arrive Here'
132
+ driver . navigate . to url_for ( 'javascriptPage.html' )
133
+ element = driver . find_element ( id : 'clickField' )
134
+ driver . action . click ( element ) . perform
135
+ expect ( element . attribute ( :value ) ) . to eq ( 'Clicked' )
135
136
end
136
137
137
138
it 'can drag and drop' do
@@ -149,14 +150,19 @@ module WebDriver
149
150
expect ( text ) . to eq ( 'Dropped!' )
150
151
end
151
152
152
- it 'double clicks an element' do
153
- driver . navigate . to url_for ( 'javascriptPage.html' )
154
- element = driver . find_element ( id : 'doubleClickField' )
153
+ # Pending bug with Firefox
154
+ not_compliant_on driver : [ :ff_nightly ] do
155
+ it 'double clicks an element' do
156
+ driver . navigate . to url_for ( 'javascriptPage.html' )
157
+ element = driver . find_element ( id : 'doubleClickField' )
155
158
156
- driver . action . double_click ( element ) . perform
157
- expect ( element . attribute ( :value ) ) . to eq ( 'DoubleClicked' )
159
+ driver . action . double_click ( element ) . perform
160
+ expect ( element . attribute ( :value ) ) . to eq ( 'DoubleClicked' )
161
+ end
158
162
end
159
- not_compliant_on browser : :phantomjs do
163
+
164
+ # Pending bug with Firefox
165
+ not_compliant_on browser : [ :phantomjs , :ff_nightly ] do
160
166
it 'context clicks an element' do
161
167
driver . navigate . to url_for ( 'javascriptPage.html' )
162
168
element = driver . find_element ( id : 'doubleClickField' )
@@ -166,7 +172,7 @@ module WebDriver
166
172
end
167
173
end
168
174
169
- compliant_on driver : :firefox do
175
+ compliant_on driver : :ff_nightly do
170
176
it 'can release pressed buttons via release action' do
171
177
driver . navigate . to url_for ( 'javascriptPage.html' )
172
178
0 commit comments