Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
JPrevost committed Jan 21, 2016
1 parent e9ed16d commit 4eba234
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -44,6 +44,8 @@ group :test do
gem 'minitest-reporters'
gem 'minitest-rails'
gem 'minitest-rails-capybara'
gem 'poltergeist'
gem 'selenium-webdriver'
gem 'vcr'
gem 'webmock'
end
20 changes: 20 additions & 0 deletions Gemfile.lock
Expand Up @@ -64,6 +64,9 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
cliver (0.3.2)
commonjs (0.2.7)
concurrent-ruby (1.0.0)
coveralls (0.8.10)
Expand All @@ -90,6 +93,7 @@ GEM
execjs (2.6.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
globalid (0.3.6)
activesupport (>= 4.1.0)
hashdiff (0.2.3)
Expand Down Expand Up @@ -166,6 +170,11 @@ GEM
rack
rake (>= 0.8.1)
pg (0.18.4)
poltergeist (1.8.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
rack (1.6.4)
rack-test (0.6.3)
Expand Down Expand Up @@ -218,6 +227,11 @@ GEM
ruby-progressbar (1.7.5)
rubyzip (1.1.7)
safe_yaml (1.0.4)
selenium-webdriver (2.49.0)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
simplecov (0.11.1)
docile (~> 1.1.0)
json (~> 1.8)
Expand Down Expand Up @@ -267,6 +281,10 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket (1.2.2)
websocket-driver (0.6.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -292,11 +310,13 @@ DEPENDENCIES
omniauth-oauth2
passenger
pg
poltergeist
rails (= 4.2.5)
rails_12factor
rest-client
rubocop
rubyzip
selenium-webdriver
skylight
sqlite3
therubyracer
Expand Down
12 changes: 10 additions & 2 deletions test/features/submission_status_pages_test.rb
Expand Up @@ -2,12 +2,15 @@

class SubmissionStatusPagesTest < Capybara::Rails::TestCase
def setup
Capybara.current_driver = :selenium
auth_setup
FileUtils.rm_f('tmp/69b9156a124c96bbdb55cad753810e14.zip')
FileUtils.rm_f('tmp/40550618d6b4d97792b0773c97207186.zip')
end

def teardown
super
Capybara.use_default_driver
auth_teardown
@sub.documents.map(&:remove!) if @sub
end
Expand All @@ -22,8 +25,13 @@ def base_valid_form

test 'deposit sets status when workflow enabled in dspace' do
base_valid_form
attach_file('submission[documents][]',
File.absolute_path('./test/fixtures/a_pdf.pdf'))
page.execute_script("seleniumUpload = window.$('<input/>').attr({id: 'seleniumUpload', type:'file'}).appendTo('body');")

attach_file('seleniumUpload', File.absolute_path('./test/fixtures/a_pdf.pdf'))

# Trigger the drop event
page.execute_script("e = $.Event('drop'); e.originalEvent = {dataTransfer : { files : seleniumUpload.get(0).files } }; $('.submissionUpload').trigger(e);")
sleep(10)
VCR.use_cassette('workflow_submission', preserve_exact_body_bytes: true) do
click_on('Create Submission')
end
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Expand Up @@ -10,9 +10,11 @@
require 'rails/test_help'
require 'minitest/rails/capybara'
require 'minitest/reporters'
require 'capybara/poltergeist'
Minitest::Reporters.use!

VCR.configure do |config|
config.ignore_localhost = true
config.cassette_library_dir = 'test/vcr_cassettes'
config.hook_into :webmock
end
Expand Down

0 comments on commit 4eba234

Please sign in to comment.