LoginSignup
7
5

More than 5 years have passed since last update.

capybara-webkitでエンターキーを押下する

Posted at

Capybaraでは

find(:user_name).native.send_keys(:return)

といった形で<input type="text" name="user[name]>に対するエンターキーの押下をシミュレートできようだが、capybara-webkitではsend_keysメソッドがNotImplementedErrorだった。

ちょっと怪しいやり方だが、エンターキーの押下は以下でシミュレートできた。

fill_in(:user_name, with: "John Doe" + "\n")
7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5