Skip to content

Commit 10d4ab6

Browse files
committed
[rb] enable specs for new firefox functionality
1 parent ebb307e commit 10d4ab6

File tree

2 files changed

+56
-47
lines changed

2 files changed

+56
-47
lines changed

rb/spec/integration/selenium/webdriver/action_builder_spec.rb

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
module Selenium
2323
module WebDriver
24-
not_compliant_on browser: [:safari, :firefox] do
24+
not_compliant_on browser: [:safari] do
2525
not_compliant_on browser: [:firefox, :ff_nightly], driver: :remote do
2626
describe ActionBuilder do
2727
describe 'Key actions' do
@@ -70,68 +70,69 @@ module WebDriver
7070
expect(keylogger.text).to match(/keyup *$/)
7171
end
7272

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')
7775

78-
input = driver.find_element(css: '#working')
76+
input = driver.find_element(css: '#working')
77+
input.click
7978

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
8483

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
8687
driver.navigate.to url_for('formPage.html')
8788

8889
input = driver.find_element(css: '#working')
90+
input.click
8991

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')
9395
end
96+
end
9497

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
97101
driver.navigate.to url_for('formPage.html')
98102

99103
input = driver.find_element(css: '#working')
100104

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')
104108
end
105109
end
106110

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')
110113

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')
113116

114-
event_input.click
117+
event_input.click
115118

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 *$/)
119122

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 *$/)
124126
end
125127
end # Key actions
126128

127-
not_compliant_on browser: [:safari, :firefox, :ff_nightly] do
129+
not_compliant_on browser: [:safari, :firefox] do
128130
describe 'Pointer actions' do
129131
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')
135136
end
136137

137138
it 'can drag and drop' do
@@ -149,14 +150,19 @@ module WebDriver
149150
expect(text).to eq('Dropped!')
150151
end
151152

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')
155158

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
158162
end
159-
not_compliant_on browser: :phantomjs do
163+
164+
# Pending bug with Firefox
165+
not_compliant_on browser: [:phantomjs, :ff_nightly] do
160166
it 'context clicks an element' do
161167
driver.navigate.to url_for('javascriptPage.html')
162168
element = driver.find_element(id: 'doubleClickField')
@@ -166,7 +172,7 @@ module WebDriver
166172
end
167173
end
168174

169-
compliant_on driver: :firefox do
175+
compliant_on driver: :ff_nightly do
170176
it 'can release pressed buttons via release action' do
171177
driver.navigate.to url_for('javascriptPage.html')
172178

rb/spec/integration/selenium/webdriver/timeout_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ module WebDriver
9191
# w3c default is 300,000
9292
after { driver.manage.timeouts.page_load = 300000 }
9393

94-
it 'should be able to set the page load timeout' do
95-
expect { driver.manage.timeouts.page_load = 2 }.to_not raise_exception
94+
# The pageLoad change is currently only in Nightly
95+
not_compliant_on driver: :firefox do
96+
it 'should be able to set the page load timeout' do
97+
expect { driver.manage.timeouts.page_load = 2 }.to_not raise_exception
98+
end
9699
end
97100
end
98101
end

0 commit comments

Comments
 (0)