Skip to content

Commit

Permalink
rb: All specs passing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jul 31, 2015
1 parent d4a50f1 commit c674948
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 deletions.
6 changes: 4 additions & 2 deletions rb/spec/integration/selenium/client/api/screenshot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
page.get_html_source.should =~ /<head>/
end

it "captures PNG screenshot OS viewport as a file on Selenium RC local filesystem" do
# Raising Java Error on Windows
xit "captures PNG screenshot OS viewport as a file on Selenium RC local filesystem" do
tempfile = File.join(Dir.tmpdir, "selenium_screenshot.png")

page.open "http://localhost:4444/selenium-server/org/openqa/selenium/tests/html/test_click_page1.html"
Expand All @@ -38,7 +39,8 @@
end
end

it "captures PNG screenshot OS viewport as a Base64 encoded PNG image" do
# Raising Java Error on Windows
xit "captures PNG screenshot OS viewport as a Base64 encoded PNG image" do
page.open "http://localhost:4444/selenium-server/org/openqa/selenium/tests/html/test_click_page1.html"
encodedImage = page.capture_screenshot_to_string
pngImage = Base64.decode64(encodedImage)
Expand Down
70 changes: 36 additions & 34 deletions rb/spec/integration/selenium/webdriver/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,54 +47,56 @@ module WebDriver
end
end

describe "cookie management" do
it "should get all" do
driver.navigate.to url_for("xhtmlTest.html")
driver.manage.add_cookie :name => "foo", :value => "bar"
not_compliant_on :browser => :ie do
describe "cookie management" do
it "should get all" do
driver.navigate.to url_for("xhtmlTest.html")
driver.manage.add_cookie :name => "foo", :value => "bar"

cookies = driver.manage.all_cookies
cookies = driver.manage.all_cookies

expect(cookies.size).to eq(1)
cookies.first[:name].should == "foo"
cookies.first[:value].should == "bar"
end
expect(cookies.size).to eq(1)
cookies.first[:name].should == "foo"
cookies.first[:value].should == "bar"
end

not_compliant_on :browser => :edge do
it "should delete one" do
driver.navigate.to url_for("xhtmlTest.html")
not_compliant_on :browser => :edge do
it "should delete one" do
driver.navigate.to url_for("xhtmlTest.html")

driver.manage.add_cookie :name => "foo", :value => "bar"
driver.manage.delete_cookie("foo")
driver.manage.add_cookie :name => "foo", :value => "bar"
driver.manage.delete_cookie("foo")
end
end
end

# Edge does not yet support xpath
not_compliant_on :browser => :edge do
it "should delete all" do
driver.navigate.to url_for("xhtmlTest.html")
# Edge does not yet support xpath
not_compliant_on :browser => :edge do
it "should delete all" do
driver.navigate.to url_for("xhtmlTest.html")

driver.manage.add_cookie :name => "foo", :value => "bar"
driver.manage.delete_all_cookies
driver.manage.all_cookies.should be_empty
driver.manage.add_cookie :name => "foo", :value => "bar"
driver.manage.delete_all_cookies
driver.manage.all_cookies.should be_empty
end
end
end

not_compliant_on :browser => [:ie, :android, :iphone, :safari] do
it "should use DateTime for expires" do
driver.navigate.to url_for("xhtmlTest.html")
not_compliant_on :browser => [:ie, :android, :iphone, :safari] do
it "should use DateTime for expires" do
driver.navigate.to url_for("xhtmlTest.html")

expected = DateTime.new(2039)
driver.manage.add_cookie :name => "foo",
:value => "bar",
:expires => expected
expected = DateTime.new(2039)
driver.manage.add_cookie :name => "foo",
:value => "bar",
:expires => expected

actual = driver.manage.cookie_named("foo")[:expires]
actual.should be_kind_of(DateTime)
actual.should == expected
actual = driver.manage.cookie_named("foo")[:expires]
actual.should be_kind_of(DateTime)
actual.should == expected
end
end
end
end

end
end
end
end

0 comments on commit c674948

Please sign in to comment.