Skip to content

Commit

Permalink
Monitor the javascript that causes failing test
Browse files Browse the repository at this point in the history
This logs all three variables that may contribute to the test not
passing.
  • Loading branch information
jcoyne committed Apr 14, 2016
1 parent 1b6aabe commit 3e8ac63
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/features/create_work_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
expect(page).to have_content('Please note, making something visible to the world (i.e. marking this as Public) may be viewed as publishing which could impact your ability to')
# attach_file('Upload a file', fixture_file_path('files/image.png'))
check('agreement')
puts "Required metadata: #{page.evaluate_script(%{$('#form-progress').data('save_work_control').requiredFields.areComplete})}"
puts "Required files: #{page.evaluate_script(%{$('#form-progress').data('save_work_control').uploads.hasFiles})}"
puts "Agreement : #{page.evaluate_script(%{$('#form-progress').data('save_work_control').depositAgreement.isAccepted})}"
click_on('Save')
expect(page).to have_content('My Test Work (Generic Work)')
expect(page).to have_content "Your files are being processed by Sufia in the background."
Expand Down Expand Up @@ -69,6 +72,9 @@
expect(page).to have_content('Please note, making something visible to the world (i.e. marking this as Public) may be viewed as publishing which could impact your ability to')
select(second_user.user_key, from: 'On behalf of')
check('agreement')
puts "Required metadata: #{page.evaluate_script(%{$('#form-progress').data('save_work_control').requiredFields.areComplete})}"
puts "Required files: #{page.evaluate_script(%{$('#form-progress').data('save_work_control').uploads.hasFiles})}"
puts "Agreement : #{page.evaluate_script(%{$('#form-progress').data('save_work_control').depositAgreement.isAccepted})}"
click_on('Save')

expect(page).to have_content('My Test Work (Generic Work)')
Expand Down

0 comments on commit 3e8ac63

Please sign in to comment.