现在我可以与价格滑块交互,但是价格过滤不受附加价格滑块手柄低价格滑块手柄高的影响,站点:https://www.tajawal.ae/en/flights/DXB-RUH/2019-03-30/Economy/1Adult HTML
<div class="horizontal-slider" style="position: relative;">
<div class="bar bar-0" style="position: absolute; left: 0px; right: 176.001px;"></div>
<div class="bar bar-1" style="position: absolute; left: 48.999px; right: 54.975px;"></div>
<div class="bar bar-2" style="position: absolute; left: 170.025px; right: 0px;"></div>
<div class="handle handle-0 active" tabindex="0" role="slider" aria-valuenow="1226.36" aria-valuemin="94.36"
aria-valuemax="5292.42" style="position: absolute; z-index: 2; left: 48.999px; will-change: left;"></div>
<div class="handle handle-1 " tabindex="0" role="slider" aria-valuenow="4022.36" aria-valuemin="94.36"
aria-valuemax="5292.42" style="position: absolute; z-index: 1; left: 170.025px; will-change: left;"></div>
</div>柏木台阶
cy.get('#content-section div.horizontal-slider')
.find('div.handle.handle-1').invoke('attr', 'style', "position: absolute; z-index: 1; left: 150.025px; will-change: left;").trigger('change')
cy.get('#content-section div.horizontal-slider')
.find('div.handle.handle-0').invoke('attr', 'style', "position: absolute; z-index: 1; left: 56.025px; will-change: left;").click()

发布于 2019-03-18 17:46:38
这和柏树没有关系。基本上,当您与滑块交互时,您会忽略它是如何更新的:
mousedown、mousemove、mouseup或touchstart、touchmove、touchend等)。left属性
您使用Cypress所做的工作基本上是更改句柄拖动的结果。你在改变第四步的结果,但结果只是.相反,您需要破解步骤1或充当用户并复制步骤0(这正是您在示例中要完成的)。
所以:我能用柏树来完成吗?您需要触发应用程序脚本(mousedown、mousemove等)所侦听的事件。瞧一瞧
如果你需要更多的东西,请告诉我
https://stackoverflow.com/questions/55222761
复制相似问题