Skip to content

Commit

Permalink
modified test setup for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
nevrome committed Sep 13, 2019
1 parent c1d509a commit 46d3f0a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cache: bundler
rvm:
- 2.6.3

addons:
chrome: stable

env:
- DB=sqlite REGISTRATION_PASSPHRASE=DasisteinTest

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ group :test do
gem 'minitest-rails-capybara'
gem 'selenium-webdriver'
gem 'webdrivers'
gem 'capybara-selenium'
# Generating test data for models
gem 'factory_bot_rails'
gem 'faker'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
capybara-selenium (0.0.6)
capybara
selenium-webdriver
childprocess (1.0.1)
rake (< 13.0)
cocoon (1.2.14)
Expand Down Expand Up @@ -274,6 +277,7 @@ DEPENDENCIES
bootsnap (>= 1.1.0)
byebug
cancancan
capybara-selenium
cocoon
coffee-rails (~> 4.2)
devise (>= 4.7.1)
Expand Down
6 changes: 3 additions & 3 deletions test/integration/arch_object_flow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class ArchObjectFlowTest < Capybara::Rails::TestCase

click_on 'New Arch Object'

# Samples > Measurements
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][labnr]', with: 'AAA-123'

# Samples > Measurements > C14Measurement
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][c14_measurement_attributes][bp]', with: 2345
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][c14_measurement_attributes][std]', with: 12
Expand All @@ -23,9 +26,6 @@ class ArchObjectFlowTest < Capybara::Rails::TestCase
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][c14_measurement_attributes][delta_c13_std]', with: 10
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][c14_measurement_attributes][method]', with: "AMS"

# Samples > Measurements
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][labnr]', with: 'AAA-123'

# Samples > Measurements > C14Measurement > SourceDatabase
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][c14_measurement_attributes][source_database_attributes][name]', with: "Testdatabase"
fill_in 'arch_object[samples_attributes][0][measurements_attributes][0][c14_measurement_attributes][source_database_attributes][url]', with: "www.testdatabase.tw"
Expand Down
13 changes: 10 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ class ActiveSupport::TestCase
end

class ActionDispatch::IntegrationTest
Capybara.register_driver :selenium do |app|

# use this driver if you want to see the test happen in front of your eyes
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
end

Capybara.javascript_driver = :chrome
Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox headless disable-gpu disable-dev-shm-usage])
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end

Capybara.javascript_driver = :headless_chrome

Capybara.configure do |config|
config.default_max_wait_time = 10 # seconds
config.default_driver = :selenium
config.default_driver = :headless_chrome
end
end

0 comments on commit 46d3f0a

Please sign in to comment.