@@ -1468,6 +1468,30 @@ def create_screenshot(file, *args)
14681468 expect ( input . text ) . to eq ( "replacement text" )
14691469 end
14701470
1471+ it "sets a date field" do
1472+ input = @session . find ( :css , "#date-field" )
1473+ input . set ( Time . new ( 2000 , 12 , 31 ) )
1474+ expect ( input . value ) . to eq ( "2000-12-31" )
1475+ end
1476+
1477+ it "sets a datetime-local field" do
1478+ input = @session . find ( :css , "#datetime-local-field" )
1479+ input . set ( Time . new ( 2000 , 12 , 31 , 17 , 15 ) )
1480+ expect ( input . value ) . to eq ( Time . new ( 2000 , 12 , 31 , 17 , 15 ) . strftime ( "%Y-%m-%dT%H:%M" ) )
1481+ end
1482+
1483+ it "sets a range field" do
1484+ input = @session . find ( :css , "#range-field" )
1485+ input . set ( 42 )
1486+ expect ( input . value ) . to eq ( "42" )
1487+ end
1488+
1489+ it "sets a color field" do
1490+ input = @session . find ( :css , "#color-field" )
1491+ input . set ( "#1270a4" )
1492+ expect ( input . value ) . to eq ( "#1270a4" )
1493+ end
1494+
14711495 it "sets a content editable childs content" do
14721496 @session . visit ( "/with_js" )
14731497 @session . find ( :css , "#existing_content_editable_child" ) . set ( "WYSIWYG" )
0 commit comments