私はカピバラと非常に奇妙な行動をしています。それは頑強に私のログインフォームのフィールドに記入することを拒否します。楽しみが始まるカピバラは見つけることができますが、fill_inではありません
<fieldset>
<div class="clearfix">
<label for="user_email">E-Mail Adresse</label>
<div class="input">
<input id="user_email" name="user[email]" size="30" type="email" value="">
</div>
</div>
<div class="clearfix">
<label for="user_password">Passwort</label>
<div class="input">
<input id="user_password" name="user[password]" size="30" type="password" value="">
</div>
</div>
<div class="clearfix">
<div class="input">
<input name="user[remember_me]" type="hidden" value="0">
<input id="user_remember_me" name="user[remember_me]" type="checkbox" value="1">
<label for="user_remember_me">angemeldet bleiben</label>
</div>
</div>
</fieldset>
そして、ここでは、次のとおりです。
within("#login_form"){ find("#user_email")}
=> #<Capybara::Element tag="input" path="/html/body/div[2]/div[@id='content']/div/div[1]/form[@id='login_form']/fieldset/div[1]/div/input[@id='user_email']">
within("#login_form"){ fill_in("#user_email", with: "[email protected]")}
Capybara::ElementNotFound: Unable to find field "#user_email"
私はかなり見つけることができるようにすることが可能であるかを理解していない、まだ、要素を見つけることができません。 これについての別のペアの作品は高く評価されます。
'fill_in( 'user_email'、:with => '[email protected]')'を '# 'を付けずに試してみてください。 – depa