0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Rspec Capybara】confirmダイアログが2回表示されるsystem specを書く

Last updated at Posted at 2020-11-27

やり方


単純にダイアログの回数分、

accept_confirm をネストすればOK。


# 1回目のダイアログ
page.accept_confirm do

  # 2回目のダイアログ
  page.accept_confirm do

    # ダイアログが全てOKなら実施したい何らかの処理
    first('div[data-cell="sample"]>div>form>button').click
  end
end



  • accept_confirmリファレンス

[https://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FSession:accept_confirm:embed:cite]




0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?