Skip to content

Commit

Permalink
Update test to reflect new html mockup on page and spacing tweak to u…
Browse files Browse the repository at this point in the history
…pload.html.erb
  • Loading branch information
asadaqain committed Jun 21, 2024
1 parent 95b006f commit 5261fb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 40 deletions.
3 changes: 0 additions & 3 deletions app/views/student_view/process/upload.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
<p>There are no <strong>supplementary</strong> files or documents attached to this thesis/dissertation.</p>
<% end %>
</diV>



</div>

<% unless block_thesis_changes?(@thesis) %>
Expand Down
41 changes: 4 additions & 37 deletions test/system/students_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'application_system_test_case'
# require '/app/test/helpers/system_test_helper'
require_relative '../helpers/system_test_helper'

class StudentsTest < ApplicationSystemTestCase
Expand Down Expand Up @@ -156,7 +155,7 @@ class StudentsTest < ApplicationSystemTestCase
attach_file("document_file", Rails.root.join('test/fixtures/files/Tony_Rich_E_2012_Phd.pdf'))
click_button('Upload')

assert_selector("p", text: /Primary\.pdf/)
assert_selector(".name", text: /Primary\.pdf/)

click_on("Continue")

Expand Down Expand Up @@ -191,46 +190,14 @@ class StudentsTest < ApplicationSystemTestCase
# Verify that the checkbox is checked
assert checkbox.checked?, "ERROR: Yorkspace licence agreement checkbox is not checked."




# within('#yorkspace-licence') do
# save_page()
# # assert_selector '.scrollable-content', visible: true
# page.execute_script('arguments[0].scrollTop = arguments[0].scrollHeight', find('#yorkspace-licence'))
# end
# assert page.has_unchecked_field?('thesis_yorkspace_licence_agreement', disabled: false)

# # Scroll through ETD Licence
# within('#etd-licence') do
# page.execute_script('arguments[0].scrollTop = arguments[0].scrollHeight', find('#etd-licence'))
# end
# assert page.has_unchecked_field?('thesis_etd_licence_agreement', disabled: false)


# assert_selector "a", text: "Accept and Continue"
# assert_selector "button", text: "Accept and Continue"


File.open("tmp/test-screenshots/error.html", "w") { |file| file.write(page.html) }
save_page()


save_screenshot()


# create(:document, thesis:, supplemental: false, file: fixture_file_upload('Tony_Rich_E_2012_Phd.pdf'))




end


end

########################################
## For Debugging and building tests ##
# page.driver.browser.manage.window.resize_to(1920, 2500)
# save_screenshot()
## HTML Save
# File.open("tmp/test-screenshots/error.html", "w") { |file| file.write(page.html) }
# save_page()
########################################

0 comments on commit 5261fb3

Please sign in to comment.