0
能夠與以下運行時,彈出的頁面步驟黃瓜:水豚/ Rails的/灰燼無法FILL_IN登錄名和密碼字段
Given(/^i go to the login page$/) do visit "http://localhost:3000" end When(/^i enter a valid email and password$/) do fill_in('email', :with => '[email protected]')
但是我不斷收到以下錯誤:
When i enter a valid email and password # features/step_definitions/loggingin_valid.rb:5 Unable to find field "email" (Capybara::ElementNotFound) ./features/step_definitions/loggingin_valid.rb:6:in `/^i enter a valid email and password$/' features/loggingin_valid.feature:5:in `When i enter a valid email and password'**
灰燼JS:
6 form.form-inline submit="login"
7 h2 Log In
8 Ember.TextField valueBinding="email"
9 Ember.TextField type="password" valueBinding="password"
11 input type="submit" value="Log In"
13 linkTo "register" |Register Now
網頁:
<form class="form-inline" data-ember-action="1">
<h2>Log In</h2>
<input id="ember440" class="ember-view ember-text-field" type="text">
<input id="ember441" class="ember-view ember-text-field" type="password">
<input type="submit" value="Log In">
<a id="ember444" class="ember-view" href="#/register">Register Now</a>
</form>
只是不能工作了,我怎麼輸入文本的電子郵件和密碼字段。他們是動態的,所以我不能使用ID。認爲可能有一種方法來使用「類型」,但沒有成功。任何指導將不勝感激。
謝謝傑里米,以爲有可能找到'類型'字段,只是fill_in文本。看起來相當合乎邏輯,正如你所建議的。會給那一槍。 –