LoginSignup
3
2

More than 5 years have passed since last update.

Cucumber Capybara Rspec

Posted at

Cucumber

テスト実行の事前準備

$ bundle exec rake db:migrate RAILS_ENV=test

テストの実行

  • 実行コマンドの形
    $ bundle exec cucumber features/~

  • タグでフックしている部分だけ実行したい時
    $ bundle exec cucumber --tags @hoge features/~

Capybara

Capybaraでwaitを実現する

saomefiles.
$ find('#dom-id').should have_content 'something'

参考
https://aranair.github.io/posts/2016/07/27/capybara-and-waiting/

Rspec

時間を指定して試験を行いたい場合

日付を指定した検索機能などを試験したい場合、Timecopというgemをインストールすると実現できる。
インストール元はこちら
https://github.com/travisjeffery/timecop

3
2
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
3
2