Is it possible to interact with hidden elements with capybara?

前端 未结 7 1040
孤街浪徒
孤街浪徒 2021-02-06 21:08

I have a file field that has opacity: 0 and is overlaping a fake button. Its a common css technic to fake a sort of \"Upload button\" that displays consistently acr

7条回答
  •  佛祖请我去吃肉
    2021-02-06 21:35

    You can interact with hidden elements using the visible: false property in Capybara.

    If you want to click on hidden element use:

    find("#photos", visible: false).click
    

    Don't use click_button('#photo') directly

提交回复
热议问题