Skip to content

Commit

Permalink
Firefox and safari do not update the attribute but they do update the…
Browse files Browse the repository at this point in the history
… property.

Attribute mainly points towards a static field on an html element like an anchor tag's href field while properties are changeable. The attribute _can_ also be updated but it seems to be optional and only chrome actually does. I still can't get firefox to handle unicode characters
  • Loading branch information
Matthew McGarvey committed May 12, 2020
1 parent 4fd02ae commit d9410eb
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions spec/features/element_interactions_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Selenium::Command
end
end

it "can clear", tags: ["firefox", "safari"] do
it "can clear" do
TestServer.route "/home", <<-HTML
<input type="text" id="name" value="John">
HTML
Expand All @@ -26,21 +26,33 @@ module Selenium::Command
session.navigate_to("http://localhost:3002/home")
element = session.find_element(:css, "#name")
element.clear
element.attribute("value").should be_empty
element.property("value").should be_empty
end
end

it "can send keys", tags: ["firefox", "safari"] do
it "can send keys" do
TestServer.route "/home", <<-HTML
<input type="text" id="name" value="">
HTML

with_session do |session|
session.navigate_to("http://localhost:3002/home")
element = session.find_element(:css, "#name")
element.send_keys(["Jenny", :space])
element.send_keys("Smith")
element.attribute("value").should eq("Jenny Smith")
element.send_keys("Joe")
element.property("value").should eq("Joe")
end
end

it "can send keys with unicode", tags: ["firefox"] do
TestServer.route "/home", <<-HTML
<input type="text" id="name" value="">
HTML

with_session do |session|
session.navigate_to("http://localhost:3002/home")
element = session.find_element(:css, "#name")
element.send_keys(["Montana", :add, "Joe"])
element.property("value").should eq("Montana+Joe")
end
end

Expand Down

0 comments on commit d9410eb

Please sign in to comment.