为什么我的刺激变化事件在 Heroku CI 中没有触发



我有两个datetime输入,它们有一个变化事件(通过刺激(,当值变化时会触发函数。如果两个字段中的日期(无论时间是多少(相同,它会从下面的div中删除d-none类,以允许用户填充一个互补字段。

该功能非常有效,我在本地通行证上的所有测试也是如此。问题是当我在生产上推送分支时:我的测试失败了,因为div中本应显示的文本仍然隐藏着。

以下是我对每个输入的刺激事件:action: "change->client-timeslots-repeat#toggleRepeatContainer"

测试失败的部分:

within "#proposal-timeslots-creation-form" do
fill_in "timeslots_proposal[client_timeslots_attributes][0][starts_at]", with: "15022022t1800"
fill_in "timeslots_proposal[client_timeslots_attributes][0][ends_at]", with: "15022022t2000"
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 disponFin". (However, it was found 1 time including non-visible text.)

出于某种原因,我不知道,事件没有被触发,可能是因为环境不同,但它的确切部分是什么……我不知道你是否需要更多的信息来针对我的问题?

谢谢你的帮助!

当试图通过字符串值填充日期时间控件时,所需的顺序取决于浏览器设置的区域设置。从您在中指定字符串的顺序来看,我猜您在欧洲的某个地方,而Herokus服务器很可能配置为美国。这将导致您的字符串无效(没有第15个月(,因此无法更改日期/时间。相反,尝试之类的东西

fill_in "timeslots_proposal[client_timeslots_attributes][0][starts_at]", with: "02152022t1800"

fill_in "timeslots_proposal[client_timeslots_attributes][0][starts_at]", with: "02/15/2022t06:00P"

最新更新