前提・実現したいこと
ローカル環境では、テストが成功しますが、
Circleci上でテストが失敗します。
対処方法ご存知の方見えましたらご教授願います
発生している問題・エラーメッセージ
Capybara::ElementNotFound: Unable to find field "user_email" that is not disabled
該当のソースコード
##テストコード
before do user_a = FactoryBot.create(:user) FactoryBot.build(:book) visit new_user_session_path fill_in 'user_email', with: 'test@test.com' fill_in 'user_password', with: 'testpass' click_button "ログイン" end
###config.yml
version: 2 jobs: test: docker: - image: circleci/ruby:2.5.0-node-browsers environment: BUNDLE_PATH: "vendor/bundle" BUNDLER_VERSION: 1.16.1 MYSQL_USERNAME: 'root' MYSQL_PASSWORD: '20186hinsitu@' MYSQL_DATABASE: app_name_test MYSQL_PORT: 3306 DB_HOST: 127.0.0.1 - image: circleci/mysql:5.7 working_directory: ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "Gemfile.lock" }} - v1-dependencies- - run: name: yarn install --check-files command: | yarn install --check-files - run: name: install bundle command: | bundle install --jobs=4 --retry=3 --path vendor/bundle - save_cache: paths: - ./vendor/bundle key: v1-dependencies-{{ checksum "Gemfile.lock" }} - run: name: データベースの起動を待機 command: dockerize -wait tcp://127.0.0.1:3306 -timeout 1m #- run: mv config/database.yml.ci config/database.yml - run: bundle exec rake db:create - run: name: データベースのセットアップ command: bundle exec rake db:schema:load - run: name: gem install bundler command: gem install bundler # Align chrome-driver's version installed by chromedriver-helper - run: name: rspecを実行 command: bundle exec rspec
補足情報(FW/ツールのバージョンなど)
Rails 5.2.3
ローカル環境のruby 2.5.0
Rspec
Capybara
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。