diff --git a/.codeclimate.yml b/.codeclimate.yml index e25ac86aa..890e414a0 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -3,6 +3,9 @@ plugins: rubocop: enabled: true channel: rubocop-1-56-3 + exclude_patterns: + - "vendor/" + - "lib/" exclude_patterns: - "bin/" - "config/" diff --git a/.github/workflows/next-rails.yml b/.github/workflows/next-rails.yml index 187eb2ed1..87d34a7df 100644 --- a/.github/workflows/next-rails.yml +++ b/.github/workflows/next-rails.yml @@ -26,7 +26,7 @@ jobs: echo "BUNDLE_CACHE_PATH=vendor/cache.next" >> $GITHUB_ENV - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2.2 + ruby-version: 3.3.0 bundler-cache: true - name: Prepare spec run: | diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 4c7af5acf..83b99f593 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2.2 + ruby-version: 3.3.0 bundler-cache: true # - name: Run Pronto # run: bundle exec pronto run @@ -32,6 +32,7 @@ jobs: RAILS_ENV: test CCTR: ./cc-test-reporter CCTR_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} strategy: matrix: suite: [models, features, controllers, ability, leftovers, cucumber] @@ -39,7 +40,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2.2 + ruby-version: 3.3.0 bundler-cache: true - name: Use Node.js uses: actions/setup-node@v1 @@ -59,17 +60,10 @@ jobs: bundle exec rake db:setup --trace bundle exec bin/rails webdrivers:chromedriver:update bundle exec rake factory_bot:lint RAILS_ENV=test - # TODO: Not all suites need xvfb - name: spec/${{ matrix.suite }} run: | xvfb-run --auto-servernum bundle exec rake spec:${{ matrix.suite }} - $CCTR format-coverage --output coverage/codeclimate.${{ matrix.suite }}.json --input-type simplecov - # - name: coverage upload ${{ matrix.suite }} - # uses: codacy/codacy-coverage-reporter-action@v1 - # if: github.ref == 'refs/heads/master' && always() - # with: - # project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - # coverage-reports: coverage/coverage.xml + $CCTR format-coverage --output coverage/codeclimate.${{ matrix.suite }}.json --input-type simplecov --id $CCTR_ID - name: Upload Capybara Failure Screenshots uses: actions/upload-artifact@v3 if: always() diff --git a/.ruby-version b/.ruby-version index be94e6f53..15a279981 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.3.0 diff --git a/.tool-versions b/.tool-versions index 80e5486ad..921b98237 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -ruby 3.2.2 +ruby 3.3.0 nodejs 16.20.2 diff --git a/Gemfile b/Gemfile index 29ba291ba..8aef58862 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ end source 'https://rubygems.org' -ruby ENV.fetch('OSEM_RUBY_VERSION', '3.2.2') +ruby ENV.fetch('OSEM_RUBY_VERSION', '3.3.0') # as web framework if next? @@ -25,6 +25,13 @@ gem 'responders', '~> 3.0' # as supported databases gem 'pg' +## RUBY 3.4.0 GEMS +## These should be reevaluated after future releases +gem 'base64' # used by activesupport +gem 'mutex_m' # used by activesupport +gem 'csv' +gem 'drb' # used by zeitwerk + # for tracking data changes gem 'paper_trail', '< 13' @@ -225,15 +232,17 @@ end group :test do # as test framework + gem 'rspec-rails' + gem 'capybara' gem 'cucumber-rails', require: false - gem 'cucumber-rails-training-wheels' # basic imperative step defs like "Then I should see..." - gem 'database_cleaner' - gem 'geckodriver-helper' - gem 'rspec-rails' + gem 'selenium-webdriver' gem 'webdrivers' + + gem 'database_cleaner' + # for measuring test coverage - gem 'simplecov', '<0.18' + gem 'simplecov' gem 'simplecov-cobertura' # for describing models gem 'shoulda-matchers', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 78a4032ca..449de7dd3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,9 +56,9 @@ GEM erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.13) - actionpack (>= 4.1, < 7.1) - activemodel (>= 4.1, < 7.1) + active_model_serializers (0.10.14) + actionpack (>= 4.1) + activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) activejob (7.0.8.1) @@ -96,15 +96,15 @@ GEM annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) - archive-zip (0.12.0) - io-like (~> 0.3.0) ast (2.4.2) - autoprefixer-rails (10.4.13.0) + autoprefixer-rails (10.4.16.0) execjs (~> 2) - awesome_nested_set (3.5.0) - activerecord (>= 4.0.0, < 7.1) + awesome_nested_set (3.6.0) + activerecord (>= 4.0.0, < 7.2) aws_cf_signer (0.1.3) - bcrypt (3.1.18) + base64 (0.2.0) + bcrypt (3.1.20) + bigdecimal (3.1.6) bindex (0.8.1) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) @@ -118,22 +118,21 @@ GEM uniform_notifier (~> 1.11) byebug (11.1.3) cancancan (3.5.0) - capybara (3.39.2) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.5) - activemodel (>= 5.0.0) - activesupport (>= 5.0.0) + carrierwave (3.0.5) + activemodel (>= 6.0.0) + activesupport (>= 6.0.0) addressable (~> 2.6) image_processing (~> 1.1) marcel (~> 1.0.0) - mini_mime (>= 0.1.3) ssrf_filter (~> 1.0) carrierwave-bombshelter (0.2.2) activesupport (>= 3.2.0) @@ -149,21 +148,23 @@ GEM caxlsx_rails (0.6.3) actionpack (>= 3.1) caxlsx (>= 3.0) - chartkick (5.0.2) + chartkick (5.0.6) chronic (0.10.2) chunky_png (1.4.0) climate_control (1.2.0) - cloudinary (1.25.0) + cloudinary (1.29.0) aws_cf_signer rest-client (>= 2.0.0) cocoon (1.2.15) - colorize (0.8.1) + colorize (1.1.0) concurrent-ruby (1.2.3) countable-rails (0.0.1) railties (>= 3.1) - crack (0.4.5) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) + csv (3.2.8) cucumber (7.1.0) builder (~> 3.2, >= 3.2.4) cucumber-core (~> 10.1, >= 10.1.0) @@ -198,14 +199,12 @@ GEM railties (>= 5.0, < 8) rexml (~> 3.0) webrick (~> 1.7) - cucumber-rails-training-wheels (1.0.0) - cucumber-rails (>= 1.1.1) cucumber-tag-expressions (4.1.0) cucumber-wire (6.2.1) cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) daemons (1.4.1) - dalli (3.2.5) + dalli (3.2.8) dante (0.2.0) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) @@ -216,10 +215,10 @@ GEM date (3.3.4) delayed_job (4.1.11) activesupport (>= 3.0, < 8.0) - delayed_job_active_record (4.1.7) + delayed_job_active_record (4.1.8) activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) - devise (4.9.2) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -227,36 +226,34 @@ GEM warden (~> 1.2.3) devise_ichain_authenticatable (0.3.2) devise (>= 2.2) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + domain_name (0.6.20240107) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) + drb (2.2.1) erubi (1.12.0) - execjs (2.8.1) - factory_bot (6.2.1) + execjs (2.9.1) + factory_bot (6.4.6) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.2.0) + faker (3.2.3) i18n (>= 1.8.11, < 2) - faraday (2.7.4) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - faraday-retry (2.0.0) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http + faraday-retry (2.2.0) faraday (~> 2.0) - fastimage (2.2.7) + fastimage (2.3.0) feature (1.4.0) ffi (1.16.3) - font-awesome-sass (6.4.0) + font-awesome-sass (6.5.1) sassc (~> 2.0) - geckodriver-helper (0.24.0) - archive-zip (~> 0.7) gitlab (4.19.0) httparty (~> 0.20) terminal-table (>= 1.5.1) @@ -280,7 +277,7 @@ GEM rainbow rubocop (>= 0.50.0) sysexits (~> 1.1) - hashdiff (1.0.1) + hashdiff (1.1.0) hashery (2.1.2) hashie (5.0.0) htmlentities (4.3.4) @@ -294,23 +291,22 @@ GEM concurrent-ruby (~> 1.0) i18n_data (0.17.1) simple_po_parser (~> 1.1) - icalendar (2.8.0) + icalendar (2.10.1) ice_cube (~> 0.16) ice_cube (0.16.4) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - io-like (0.3.1) iso-639 (0.3.6) jquery-datatables (1.10.20) - jquery-rails (4.5.1) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) json (2.7.1) - json-schema (4.0.0) + json-schema (4.1.1) addressable (>= 2.8) jsonapi-renderer (0.2.2) jwt (2.7.1) @@ -319,14 +315,14 @@ GEM addressable (~> 2.8) leaflet-rails (1.9.3) rails (>= 4.2.0) - letter_opener (1.8.1) + letter_opener (1.9.0) launchy (>= 2.2, < 3) letter_opener_web (2.0.0) actionmailer (>= 5.2) letter_opener (~> 1.7) railties (>= 5.2) rexml - lograge (0.12.0) + lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) @@ -342,20 +338,19 @@ GEM marcel (1.0.4) matrix (0.4.2) method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) - mina (1.2.4) - open4 (~> 1.3.4) + mime-types-data (3.2024.0206) + mina (1.2.5) rake mini_magick (4.12.0) mini_mime (1.1.5) minitest (5.22.2) momentjs-rails (2.29.4.1) railties (>= 3.1) - monetize (1.12.0) + monetize (1.13.0) money (~> 6.12) - money (6.16.0) + money (6.18.0) i18n (>= 0.6.4, <= 2) money-rails (1.15.0) activesupport (>= 3.0) @@ -365,6 +360,9 @@ GEM multi_json (1.15.0) multi_test (0.1.2) multi_xml (0.6.0) + mutex_m (0.2.0) + net-http (0.4.1) + uri net-imap (0.4.10) date net-protocol @@ -375,7 +373,7 @@ GEM net-smtp (0.4.0.1) net-protocol netrc (0.11.0) - next_rails (1.2.4) + next_rails (1.3.0) colorize (>= 0.8.1) nio4r (2.7.0) nokogiri (1.16.2-arm64-darwin) @@ -417,7 +415,6 @@ GEM omniauth-rails_csrf_protection (1.0.1) actionpack (>= 4.2) omniauth (~> 2.0) - open4 (1.3.4) orm_adapter (0.5.0) pagy (3.11.0) paper_trail (12.3.0) @@ -430,13 +427,13 @@ GEM pdf-core (0.9.0) pdf-inspector (1.3.0) pdf-reader (>= 1.0, < 3.0.a) - pdf-reader (2.11.0) + pdf-reader (2.12.0) Ascii85 (~> 1.0) afm (~> 0.2.1) hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.3) + pg (1.5.6) prawn (2.4.0) pdf-core (~> 0.9.0) ttfunk (~> 1.7) @@ -500,7 +497,7 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - rails-i18n (7.0.7) + rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) railties (7.0.8.1) @@ -512,14 +509,13 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.1.0) - recaptcha (5.14.0) - json + recaptcha (5.16.0) redcarpet (3.6.0) redis (4.7.1) regexp_parser (2.9.0) - request_store (1.5.1) + request_store (1.6.0) rack (>= 1.4) - responders (3.1.0) + responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) rest-client (2.1.0) @@ -533,19 +529,19 @@ GEM chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.2.0) - rspec-activemodel-mocks (1.1.0) + rspec-activemodel-mocks (1.2.0) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.0.2) + rspec-support (~> 3.13.0) + rspec-rails (6.1.1) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -553,7 +549,7 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.0) + rspec-support (3.13.1) rubocop (1.61.0) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -571,9 +567,9 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-performance (1.17.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.20.2) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rails (2.19.1) activesupport (>= 4.2.0) rack (>= 1.1) @@ -582,13 +578,12 @@ GEM rubocop (~> 1.33) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) - ruby-oembed (0.16.1) + ruby-oembed (0.17.0) ruby-openid (2.9.2) ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) ruby-vips (2.2.1) ffi (~> 1.12) - ruby2_keywords (0.0.5) rubyzip (2.3.2) rugged (1.5.1) sass-rails (6.0.0) @@ -609,24 +604,26 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-delayed_job (5.9.0) + sentry-delayed_job (5.16.1) delayed_job (>= 4.0) - sentry-ruby (~> 5.9.0) - sentry-rails (5.9.0) + sentry-ruby (~> 5.16.1) + sentry-rails (5.16.1) railties (>= 5.0) - sentry-ruby (~> 5.9.0) - sentry-ruby (5.9.0) + sentry-ruby (~> 5.16.1) + sentry-ruby (5.16.1) concurrent-ruby (~> 1.0, >= 1.0.2) - shoulda-matchers (5.3.0) + shoulda-matchers (6.1.0) activesupport (>= 5.2.0) simple_po_parser (1.1.6) - simplecov (0.17.1) + simplecov (0.19.0) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-cobertura (1.4.2) - simplecov (~> 0.8) - simplecov-html (0.10.2) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) @@ -637,27 +634,28 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.3-arm64-darwin) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) + sqlite3 (1.7.2-arm64-darwin) + sqlite3 (1.7.2-x86_64-darwin) + sqlite3 (1.7.2-x86_64-linux) ssrf_filter (1.1.2) stripe (5.55.0) - stripe-ruby-mock (3.1.0.rc3) + stripe-ruby-mock (3.1.0) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) sys-uname (1.2.2) ffi (~> 1.1) sysexits (1.2.0) - temple (0.10.1) + temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.3.1) tilt (2.1.0) - timecop (0.9.6) + timecop (0.9.8) timeout (0.4.1) transitions (1.3.0) - ttfunk (1.7.0) + ttfunk (1.8.0) + bigdecimal (~> 3.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -665,17 +663,15 @@ GEM concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) unicode-display_width (2.5.0) uniform_notifier (1.16.0) unobtrusive_flash (3.3.1) railties + uri (0.13.0) version_gem (1.1.3) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) @@ -684,7 +680,7 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) - webmock (3.18.1) + webmock (3.23.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -712,6 +708,7 @@ DEPENDENCIES annotate autoprefixer-rails awesome_nested_set + base64 bootstrap-sass (~> 3.4.0) bootstrap-switch-rails (= 3.3.3) bootstrap3-datetimepicker-rails (~> 4.17.47) @@ -727,8 +724,8 @@ DEPENDENCIES cloudinary cocoon countable-rails + csv cucumber-rails - cucumber-rails-training-wheels daemons dalli database_cleaner @@ -736,12 +733,12 @@ DEPENDENCIES devise devise_ichain_authenticatable dotenv-rails + drb factory_bot_rails faker faraday-retry feature font-awesome-sass - geckodriver-helper gravtastic haml-lint haml-rails @@ -762,6 +759,7 @@ DEPENDENCIES mina mini_magick money-rails + mutex_m next_rails omniauth omniauth-discourse! @@ -800,11 +798,12 @@ DEPENDENCIES ruby-oembed sass-rails (>= 4.0.2) selectize-rails + selenium-webdriver sentry-delayed_job sentry-rails sentry-ruby shoulda-matchers - simplecov (< 0.18) + simplecov simplecov-cobertura sprockets-rails sqlite3 @@ -821,7 +820,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 3.2.2 + ruby 3.3.0p0 BUNDLED WITH 2.5.6 diff --git a/info.yml b/info.yml deleted file mode 100644 index 40cec3e6a..000000000 --- a/info.yml +++ /dev/null @@ -1,32 +0,0 @@ -project: - name: 'snapcon' # Your project name, e.g. Cue-to-cue - owner: 'CS169L-23' # Do not change - teamId: '02' # Your team number, e.g. 02 - identities: - pivotal: 'https://www.pivotaltracker.com/n/projects/2487653' # Your Pivotal project URL - heroku: 'https://sp23-02-snapcon.herokuapp.com' # Your Heroku app URL - members: - member1: # Add all project members - name: 'Adam' # Member 1 name - surname: 'Salguero' # Member 1 last name - githubUsername: 'adamsalguero' # Member 1 GitHub username - pivotalUsername: 'adamsalguero' # Member 1 Pivotal username - herokuEmail: 'adam.a.salguero@berkeley.edu' # Member 1 Heroku username - member2: - name: 'Monis' - surname: 'Mohiuddin' - githubUsername: 'killamonis' - pivotalUsername: 'monis24' - herokuEmail: 'monmohiuddin@berkeley.edu' - member3: - name: 'Justin' - surname: 'Pau' - githubUsername: 'Juapu' - pivotalUsername: 'Jupau' - herokuEmail: 'jupau@berkeley.edu' - member4: - name: 'Shiv' - surname: 'Sethi' - githubUsername: 'Shiv-Sethi' - pivotalUsername: 'shiv_sethi' - herokuEmail: 'shiv_sethi@berkeley.edu' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 99a75f488..ab6d8adf5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,7 +15,7 @@ require 'rspec/rails' require 'shoulda/matchers' -require 'webdrivers' +require 'selenium-webdriver' # To avoid confusion on missed migrations - use Rails 4 checker to ensure # all migrations applied @@ -57,36 +57,38 @@ Capybara.disable_animation = true - Capybara.register_driver :firefox do |app| - Capybara::Selenium::Driver.new(app, browser: :firefox) - end + # Capybara.register_driver :firefox do |app| + # Capybara::Selenium::Driver.new(app, browser: :firefox) + # end - Capybara.register_driver :chrome do |app| - Capybara::Selenium::Driver.new(app, browser: :chrome) - end + # Capybara.register_driver :chrome do |app| + # Capybara::Selenium::Driver.new(app, browser: :chrome) + # end - Capybara.register_driver :firefox_headless do |app| - options = Selenium::WebDriver::Firefox::Options.new - options.args << '--headless' - options.args << '--window-size=1920,1080' - Capybara::Selenium::Driver.new(app, browser: :firefox, options: options) - end + # Capybara.register_driver :firefox_headless do |app| + # options = Selenium::WebDriver::Firefox::Options.new + # options.args << '--headless' + # options.args << '--window-size=1920,1080' + # Capybara::Selenium::Driver.new(app, browser: :firefox, options: options) + # end - Capybara.register_driver :chrome_headless do |app| - options = ::Selenium::WebDriver::Chrome::Options.new - options.args << '--window-size=1920x1080' - options.args << '--headless' - options.args << '--no-sandbox' - options.args << '--disable-gpu' - Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) - end + # Capybara.register_driver :chrome_headless do |app| + # options = ::Selenium::WebDriver::Chrome::Options.new + # options.args << '--window-size=1920x1080' + # options.args << '--headless' + # options.args << '--no-sandbox' + # options.args << '--disable-gpu' + # Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) + # end Capybara.default_max_wait_time = 10 # seconds # use a real browser for JS tests - Capybara.javascript_driver = ( - ENV.fetch('OSEM_TEST_DRIVER', 'chrome_headless').to_sym - ) + Capybara.default_driver = :selenium_chrome_headless + Capybara.javascript_driver = :selenium_chrome_headless + # Capybara.default_driver = ( + # ENV.fetch('OSEM_TEST_DRIVER', 'selenium_chrome_headless').to_sym + # ) # Includes helpers and connect them to specific types of tests config.include FactoryBot::Syntax::Methods diff --git a/spec/support/external_request.rb b/spec/support/external_request.rb index 6fd7af57f..d29a4df7d 100644 --- a/spec/support/external_request.rb +++ b/spec/support/external_request.rb @@ -2,7 +2,7 @@ # Mock external requests to youtube require 'webmock/rspec' -driver_urls = Webdrivers::Common.subclasses.map do |driver| +driver_urls = ::Selenium::WebDriver::Driver.subclasses.map do |driver| Addressable::URI.parse(driver.base_url).host end # Local chromedriver pings many sites. :(