Skip to content

Commit ab1e647

Browse files
committed
rb - clarify specs for handling missing element attribute call
1 parent f389150 commit ab1e647

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

rb/spec/integration/selenium/webdriver/element_spec.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,20 @@
6969
expect(driver.find_element(:id, "withText").attribute("rows")).to eq("5")
7070
end
7171

72-
# TODO - File Edge bug, this should return nil, but throws an error
73-
# Selenium::WebDriver::Error::UnknownError: unknown error
74-
it "should return nil for non-existent attributes" do
75-
driver.navigate.to url_for("formPage.html")
76-
expect(driver.find_element(:id, "withText").attribute("nonexistent")).to be_nil
72+
not_compliant_on :edge do
73+
it "should return nil for non-existent attributes" do
74+
driver.navigate.to url_for("formPage.html")
75+
expect(driver.find_element(:id, "withText").attribute("nonexistent")).to be_nil
76+
end
77+
end
78+
79+
# Per W3C spec this should return Invalid Argument not Unknown Error, but there is no comparable error code
80+
compliant_on :edge do
81+
it "should return nil for non-existent attributes" do
82+
driver.navigate.to url_for("formPage.html")
83+
element = driver.find_element(:id, "withText")
84+
expect {element.attribute("nonexistent")}.to raise_error(Selenium::WebDriver::Error::UnknownError)
85+
end
7786
end
7887

7988
it "should clear" do

0 commit comments

Comments
 (0)