Skip to content

Commit

Permalink
rb - marionette spec updates
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jun 16, 2016
1 parent c5aeece commit dd8f004
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/firefox/binary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def path
when :windows
windows_path
when :linux, :unix
Platform.find_binary("firefox3", "firefox2", "firefox") || "/usr/bin/firefox"
Platform.find_binary('firefox3', 'firefox2', 'firefox') || '/usr/bin/firefox'
else
raise Error::WebDriverError, "unknown platform: #{Platform.os}"
end
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/remote/w3c_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def dismiss_alert
end

def alert=(keys)
execute :sendAlertText, {}, {handler: 'prompt', message: keys}
execute :sendAlertText, {}, {handler: 'prompt', text: keys}
end

def alert_text
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/support/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def self.from_string(str)
array = [Regexp.last_match(1), Regexp.last_match(2), Regexp.last_match(3)]
new(*array.map { |e| (e * 2).to_i(16) })
when HSL_PATTERN, HSLA_PATTERN
from_hsl($1, $2, $3, $4)
from_hsl(Regexp.last_match(1), Regexp.last_match(2), Regexp.last_match(3), Regexp.last_match(4))
else
raise ArgumentError, "could not convert #{str.inspect} into color"
end
Expand Down
2 changes: 2 additions & 0 deletions rb/spec/integration/selenium/webdriver/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module WebDriver
end

# PhantomJS on windows issue: https://github.com/ariya/phantomjs/issues/10993
# Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1260233
not_compliant_on browser: [:android, :iphone, :safari, :edge, :marionette, :phantomjs] do
it 'should handle file uploads' do
driver.navigate.to url_for('formPage.html')
Expand Down Expand Up @@ -168,6 +169,7 @@ module WebDriver
expect(size.height).to be > 0
end

# Marionette - Waiting on implementation in httpd after spec section rewrite
not_compliant_on browser: [:safari, :marionette] do
it 'should drag and drop' do
driver.navigate.to url_for('dragAndDropTest.html')
Expand Down
2 changes: 1 addition & 1 deletion rb/spec/integration/selenium/webdriver/keyboard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

module Selenium
module WebDriver
# Marionette BUG - Interactions Not Supported
# Marionette - Waiting on implementation in httpd after spec section rewrite
# Firefox BUG - https://github.com/SeleniumHQ/selenium/issues/1792
not_compliant_on browser: [:android, :iphone, :safari, :marionette, :firefox] do
describe Keyboard do
Expand Down
2 changes: 1 addition & 1 deletion rb/spec/integration/selenium/webdriver/mouse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

module Selenium
module WebDriver
# Marionette BUG - Interactions Not Supported
# Marionette - Waiting on implementation in httpd after spec section rewrite
not_compliant_on browser: [:android, :iphone, :safari, :marionette] do
describe Mouse do
it 'clicks an element' do
Expand Down
2 changes: 1 addition & 1 deletion rb/spec/integration/selenium/webdriver/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module WebDriver
end
end

# Marionette BUG - Failed to convert expiry to Date
# Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1256007
not_compliant_on browser: [:android, :iphone, :safari, :marionette] do
it 'should use DateTime for expires' do
driver.navigate.to url_for('xhtmlTest.html')
Expand Down
8 changes: 3 additions & 5 deletions rb/spec/integration/selenium/webdriver/target_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module WebDriver
expect(driver.title).to eq('XHTML Test Page')
end

# Marionette BUG: Automatically switches browsing context to new window when it opens.
# Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1280517
not_compliant_on browser: [:marionette, :ie] do
context 'with more than two windows' do
it 'should close current window when more than two windows exist' do
Expand Down Expand Up @@ -252,10 +252,7 @@ module WebDriver
end
end

# Marionette BUG - http://www.w3.org/TR/webdriver/#send-alert-text
# Says message should be an array (I think), but we're getting
# InvalidArgumentError: 'message' not a string
# When trying a string, error: keysToSend.join is not a function
# Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1255906
# Edge Under Consideration - https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/
not_compliant_on browser: [:marionette, :edge] do
it 'allows the user to set the value of a prompt' do
Expand Down Expand Up @@ -301,6 +298,7 @@ module WebDriver
end
end

# Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1279211
not_compliant_on browser: :marionette do
it 'raises an UnhandledAlertError if an alert has not been dealt with' do
driver.navigate.to url_for('alerts.html')
Expand Down
1 change: 1 addition & 0 deletions rb/spec/integration/selenium/webdriver/window_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ module WebDriver
end
end

# Marionette - https://bugzilla.mozilla.org/show_bug.cgi?id=1189749
compliant_on browser: [:marionette, :edge] do
# Edge: Not Yet - https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/
not_compliant_on browser: [:marionette, :edge] do
Expand Down
3 changes: 2 additions & 1 deletion rb/spec/unit/selenium/webdriver/remote/bridge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ module Remote
request_body = JSON.generate(sessionId: '11123', value: {})
headers = {'Content-Type' => 'application/json'}
stub_request(:post, 'http://127.0.0.1:4444/wd/hub/session').to_return(
status: 200, body: request_body, headers: headers)
status: 200, body: request_body, headers: headers
)

bridge = Bridge.new
expect { bridge.upload('NotAFile') }.to raise_error(Error::WebDriverError)
Expand Down

0 comments on commit dd8f004

Please sign in to comment.