Remove visual integration tests (#1893)

* remove visual integration tests

* Add rubocop rake tasks back in

* Update .travis.yml
This commit is contained in:
Benjamin Nickolls 2019-06-20 13:57:49 +01:00 коммит произвёл Andrew Nesbitt
Родитель 2e67f4cd9f
Коммит 11b1f2048c
6 изменённых файлов: 1 добавлений и 125 удалений

Просмотреть файл

@ -19,7 +19,7 @@ before_script:
- mysql -u root -e 'create database octobox_test;' || true
script:
- RAILS_ENV=test bundle exec rake --trace rubocop db:migrate test:skip_visuals
- RAILS_ENV=test bundle exec rake --trace rubocop db:migrate test
bundler_args: --without development production --deployment --jobs=3 --retry=3

Просмотреть файл

@ -56,8 +56,6 @@ group :test do
gem 'webmock'
gem 'mocha'
gem 'minitest'
gem 'selenium-webdriver'
gem 'capybara'
gem 'action-cable-testing'
gem 'timecop'
end

Просмотреть файл

@ -74,16 +74,6 @@ GEM
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.0.1)
capybara (3.24.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
childprocess (1.0.1)
rake (< 13.0)
chronic_duration (0.10.6)
numerizer (~> 0.1.1)
coderay (1.1.2)
@ -272,7 +262,6 @@ GEM
rb-inotify (0.10.0)
ffi (~> 1.0)
redis (4.1.2)
regexp_parser (1.5.1)
request_store (1.4.1)
rack (>= 1.4)
rgb (0.1.0)
@ -289,7 +278,6 @@ GEM
i18n
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
rubyzip (1.2.3)
rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5)
@ -305,9 +293,6 @@ GEM
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
selenium-webdriver (3.142.3)
childprocess (>= 0.5, < 2.0)
rubyzip (~> 1.2, >= 1.2.2)
shellany (0.0.1)
sidekiq (5.2.7)
connection_pool (~> 2.2, >= 2.2.2)
@ -375,8 +360,6 @@ GEM
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.19)
PLATFORMS
@ -394,7 +377,6 @@ DEPENDENCIES
bugsnag
bullet
byebug
capybara
commonmarker
dotenv-rails
factory_bot
@ -430,7 +412,6 @@ DEPENDENCIES
rubocop
rubocop-performance
sassc-rails
selenium-webdriver
sidekiq
sidekiq-scheduler
sidekiq-status

Просмотреть файл

@ -7,21 +7,6 @@ Rails.application.load_tasks
Rake::Task['assets:precompile'].enhance ['api_docs:generate']
task 'test:skip_visuals' => 'test:prepare' do
['channels', 'controllers', 'integration', 'helpers', 'lib', 'models',
'services', 'validators', 'workers'].each do |name|
$: << 'test'
Rails::TestUnit::Runner.rake_run(["test/#{name}"])
end
end
task 'test:visuals' => 'test:prepare' do
$: << "test"
Rails::TestUnit::Runner.rake_run(["test/visuals"])
end
task(:default).clear.enhance ['test:skip_visuals']
if %w[development test].include? Rails.env
require 'rubocop/rake_task'
RuboCop::RakeTask.new

Просмотреть файл

@ -1,10 +0,0 @@
require 'capybara/rails'
require 'capybara/minitest'
WebMock.disable_net_connect!(allow_localhost: true)
Capybara.default_driver = :selenium
def set_dark_theme(user)
user.theme = 'dark'
end

Просмотреть файл

@ -1,78 +0,0 @@
require 'test_helper'
require 'visual_test_helper'
class VisualIntegrationTest < ActionDispatch::IntegrationTest
# Make the Capybara DSL available in all integration tests
include Capybara::DSL
# Make `assert_*` methods behave like Minitest assertions
include Capybara::Minitest::Assertions
setup do
stub_fetch_subject_enabled(value: false)
stub_notifications_request
stub_repository_request
@user = create(:user)
end
# Reset sessions and driver between tests
# Use super wherever this method is redefined in your individual test classes
teardown do
Capybara.current_session.current_window.maximize
Capybara.reset_sessions!
Capybara.use_default_driver
end
test 'render a blank index page' do
visit root_path
page.has_content?('Sign in')
Capybara.current_session.current_window.resize_to(576,800)
end
test 'render a logged in user' do
sign_in_as(@user)
stub_fetch_subject_enabled
visit login_path
page.has_selector?('table tr')
end
test 'render the sidebar on small devices' do
sign_in_as(@user)
stub_fetch_subject_enabled
visit login_path
Capybara.current_session.current_window.resize_to(576,800)
click_button('sidebar_toggle', wait: 0.25)
find('.flex-sidebar').visible?
end
test 'render some filtered stuff' do
sign_in_as(@user)
stub_fetch_subject_enabled
visit login_path
visit '/?starred=true&q=repo%3Aa%2Fb'
page.has_content?('Nothing to see here.')
end
test 'render a docs page' do
visit documentation_path
page.has_content?('Documentation')
Capybara.current_session.current_window.resize_to(576,800)
click_button('sidebar_toggle', wait: 0.25)
find('.flex-sidebar').visible?
end
test 'Render a dark theme page' do
sign_in_as(@user)
set_dark_theme(@user)
stub_fetch_subject_enabled
visit login_path
has_unchecked_field?('label[for=select_all]', visible: :false)
end
end