前提・実現したいこと
RSpecを導入してテストをしたいのですが
どうもうまくいかなくて悩んでます
uninitialized constant Selenium::WebDriver::Logger
というエラーで特定のページ移動してテストができな状態です
Dockerもしようしています
gem
1group :development, :test do 2 gem 'capybara', '>= 2.15' 3 gem 'selenium-webdriver' 4 gem 'chromedriver-helper' 5 gem 'rspec-rails', '~> 3.7' 6 gem 'factory_bot_rails', '~> 4.8' 7
発生している問題・エラーメッセージ
10:48:09 rails-todo-app (master *+=) Command is $ dc run web bundle exec rspec spec/system/tasks_spec.rb Starting rails-todo-app_db_1 ... done F Failures: 1) タスク管理機能 ユーザーAがログインしているとき ユーザーAが作成したタスクが表示される Got 0 failures and 2 other errors: 1.1) Failure/Error: visit login_path NameError: uninitialized constant Selenium::WebDriver::Logger
該当のソースコード
Ruby
1require 'rails_helper' 2 3describe 'タスク管理機能', type: :system do 4 describe '一覧表示機能' do 5 before do 6 # ユーザーAを作成しておく 7 user_a = FactoryBot.create(:user, 8 name: "ユーザーA", 9 email: "a@example.com") 10 # 作成者がユーザーAであるタスクを作成しておく 11 FactoryBot.create(:task, name:"最初のタスク", user:user_a) 12 end 13 14 after do 15 # Do nothing 16 end 17 end 18 19 context 'ユーザーAがログインしているとき' do 20 before do 21 # ユーザーAでログインする 22 ########### 23 # 24 # 25 # ここでエラーになる 26 visit login_path 27 # 28 # 29 # 30 # 31 # fill_in 'メールアドレス', with: "a@example.com" 32 # fill_in 'パスワード', with: "password" 33 # click_button 'ログインする' 34 end 35 36 after do 37 # Do nothing 38 end 39 40 it 'ユーザーAが作成したタスクが表示される' do 41 # 作成済みのタスクの名称が画面上に表示されていること確認 42 # expect(page).to have_content('最初のタスク') 43 # pending 'Not implemented' 44 end 45 end 46end 47
試したこと
chromedriverをインストール
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
あなたの回答
tips
プレビュー