我有兩個datetime輸入有一個變化事件(通過刺激),當值變化時觸發一個函式。如果兩個欄位中的日期(無論時間是什么)相同,它會d-none從下面的 div 中洗掉類以允許用戶填寫補充欄位。
該功能完美運行,我在本地通過的所有測驗也都通過了。問題是當我將分支推送到生產環境時:我的測驗失敗,因為 div 中應該顯示的文本仍然隱藏。
這是我對每個輸入的刺激事件:
action: "change->client-timeslots-repeat#toggleRepeatContainer"
測驗失敗的部分:
within "#proposal-timeslots-creation-form" do
fill_in "timeslots_proposal[client_timeslots_attributes][0][starts_at]", with: "15022022\t1800"
fill_in "timeslots_proposal[client_timeslots_attributes][0][ends_at]", with: "15022022\t2000"
expect(page).to have_content "Répéter ce créneau horaire"
end
和錯誤:
expected to find text "Répéter ce créneau horaire" in "Début de la dispo\nFin". (However, it was found 1 time including non-visible text.)
由于我不知道的原因,事件沒有被觸發,可能是因為環境不同,但它的確切部分是什么......我不知道您是否需要更多資訊來解決我的問題?
謝謝你的幫助!
uj5u.com熱心網友回復:
當嘗試通過字串值填充日期時間控制元件時,必要的順序取決于瀏覽器設定的區域設定。從您指定字串的順序來看,我猜您在歐洲某個地方,而 Herokus 服務器很可能配置為美國。這將導致您的字串無效(不是第 15 個月),因此無法更改日期/時間。而是嘗試類似的東西
fill_in "timeslots_proposal[client_timeslots_attributes][0][starts_at]", with: "02152022\t1800"
要么
fill_in "timeslots_proposal[client_timeslots_attributes][0][starts_at]", with: "02/15/2022\t06:00P"
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/436019.html
