diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.scss b/app/assets/stylesheets/bootstrap_and_overrides.css.scss index 79e3aee..f291db6 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.scss +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.scss @@ -89,7 +89,6 @@ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value"); h3, .h3 { color: darken($info, 30%); font-weight: 500; - text-transform: uppercase; } h4, .h4, h5, .h5, h6, .h6 { diff --git a/test/system/students_test.rb b/test/system/students_test.rb index 8050926..dd66210 100644 --- a/test/system/students_test.rb +++ b/test/system/students_test.rb @@ -5,7 +5,7 @@ class StudentsTest < ApplicationSystemTestCase include SystemTestHelper # Include the SystemTestHelper module here - + setup do @gem_record = FactoryGirl.create(:gem_record) @@ -20,6 +20,35 @@ class StudentsTest < ApplicationSystemTestCase click_link('Start this thesis') end + test 'Starting a thesis' do + visit root_url + click_link('Gem Records') + click_link(@gem_record.studentname) + click_link('Create ETD Student Record') + page.accept_alert + click_link('Start this thesis') + select "EMBA", from: "thesis_degree_name" + select "Master's", from: "thesis_degree_level" + click_button('Create Thesis') + assert_selector "a", text: @gem_record.studentname + end + + test 'Editing a student' do + visit root_url + click_link('Gem Records') + click_link(@gem_record.studentname) + click_link('Create ETD Student Record') + page.accept_alert + click_link('Make changes') + + fill_in('Email *', with: "test@test.com") + fill_in('Name *', with: "#{@gem_record.studentname} (test)") + click_button('Update Student') + + assert_selector 'p', text: "test@test.com", visible: true + assert_selector 'h1', text: "#{@gem_record.studentname} (test)", visible: true + end + test 'Gem Record has committee members' do visit root_url click_link('Gem Records') @@ -31,7 +60,6 @@ class StudentsTest < ApplicationSystemTestCase assert_selector "p", text: committee_member.full_name end end - end test 'Log in as Student and add a thesis' do @@ -82,14 +110,14 @@ class StudentsTest < ApplicationSystemTestCase # Ensure Add Committee Members button is not present. assert_no_selector '.student-view .card .card-body a.btn.btn-success', text: 'Add committee member' - + # Ensure that the close links are not present within the #committee_members section refute_selector("#committee_members .btn-close") - + end ## Page 2 and 3 tests - should "upload primary file" do + should "upload primary file" do @thesis = FactoryGirl.create(:thesis) create(:loc_subject, name: "Accounting", category: "BUSINESS") create(:loc_subject, name: "Management", category: "BUSINESS") @@ -132,7 +160,7 @@ class StudentsTest < ApplicationSystemTestCase # Set Page size page.driver.browser.manage.window.resize_to(1920, 2500) - + ## Page 1 click_link("My ETD Submission") assert_selector "input#student_email_external" @@ -155,14 +183,14 @@ class StudentsTest < ApplicationSystemTestCase fill_in "thesis_keywords", with: "accounting-kw, management-kw" click_on("Continue") - ## Page 3 + ## Page 3 click_on("Upload Primary File") assert_selector "p", text: "Your primary file should be in PDF format.", visible: :all - + # assert_no_selector("p", text: "Smith_Jane_E_2014_PhD.pdf", visible: :all) assert_not(page.has_css?("p", text: "Smith_Jane_E_2014_PhD.pdf"), "Should not show 'example text' as per Spring 2024 requirements") - + attach_file("document_file", Rails.root.join('test/fixtures/files/Tony_Rich_E_2012_Phd.pdf')) click_button('Upload') @@ -170,7 +198,7 @@ class StudentsTest < ApplicationSystemTestCase click_on("Continue") - + ## Page 4 # assert_text "LAC Supplementary Licence File Upload".upcase @@ -193,16 +221,16 @@ class StudentsTest < ApplicationSystemTestCase # Ensure the checkbox is enabled # assert find('#thesis_yorkspace_licence_agreement').enabled? # assert_not find('#thesis_yorkspace_licence_agreement').disabled?, "ERROR: Yorkspace licence agreement checkbox is not enabled." - + checkbox = find('#thesis_yorkspace_licence_agreement') assert_not checkbox.disabled?, "ERROR: Yorkspace licence agreement checkbox is not enabled." - + # Check the checkbox checkbox.check - + # Verify that the checkbox is checked assert checkbox.checked?, "ERROR: Yorkspace licence agreement checkbox is not checked." - + end end @@ -211,6 +239,6 @@ class StudentsTest < ApplicationSystemTestCase # 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) } +# File.open("tmp/test-screenshots/error.html", "w") { |file| file.write(page.html) } # save_page() -######################################## \ No newline at end of file +######################################## diff --git a/test/system/theses_test.rb b/test/system/theses_test.rb index 6643663..a8a87ac 100644 --- a/test/system/theses_test.rb +++ b/test/system/theses_test.rb @@ -7,7 +7,7 @@ class ThesesTest < ApplicationSystemTestCase setup do FactoryGirl.create(:user, role: User::ADMIN) FactoryGirl.create(:user, role: User::MANAGER) - @thesis_01 = FactoryGirl.create(:thesis) + @thesis_01 = FactoryGirl.create(:thesis, degree_name: 'IMBA', degree_level: 'Master\'s') @thesis_02 = FactoryGirl.create(:thesis, status: Thesis::UNDER_REVIEW) end @@ -45,6 +45,76 @@ class ThesesTest < ApplicationSystemTestCase assert_selector 'span', text: 'test2, test1' end + test 'Remove committee member' do + visit root_url + click_link(@thesis_01.title) + click_on('Make Changes') + click_on('Add committee member') + click_on('Close') + click_on('Add committee member') + + fill_in('First Name', with: 'test1') + fill_in('Last Name', with: 'test2') + choose('Committee Member') + click_on('Add Member') + assert_selector 'span', text: 'test2, test1' + + accept_confirm do + find('span.fw-bold', text: 'test2, test1').find(:xpath, '../../div[@class="col-1"]/a[@class="btn btn-close pull-right"]').click + end + + assert_no_selector 'span', text: 'test2, test1' + end + + test 'Edit a thesis' do + visit root_url + click_link(@thesis_01.title) + click_on('Make Changes') + + fill_in "thesis_title", with: "title 10 (test)" + fill_in "thesis_program", with: "program 10 (test)" + fill_in "thesis_abstract", with: "Testing Abstract" + click_button('Update Thesis') + + assert_selector 'h3', text: 'title 10 (test)', visible: true + + assert_selector 'p', text: 'program 10 (test)', visible: true + + assert_selector 'p', text: 'Testing Abstract', visible: true + end + + test 'Returning a thesis' do + visit root_url + click_link(@thesis_01.title) + + find('a.btn.btn-secondary.btn-sm.dropdown-toggle').click + choose('status', option: 'under_review') + click_on('Change Status') + + + find('a.btn.btn-secondary.btn-sm.dropdown-toggle').click + choose('status', option: 'returned') + click_on('Change Status') + + assert_selector 'span.badge.bg-primary', text: 'Returned' + end + + test 'Accepting a thesis' do + visit root_url + click_link(@thesis_01.title) + + find('a.btn.btn-secondary.btn-sm.dropdown-toggle').click + choose('status', option: 'under_review') + click_on('Change Status') + + + find('a.btn.btn-secondary.btn-sm.dropdown-toggle').click + choose('status', option: 'accepted') + click_on('Change Status') + + assert_selector 'span.badge.bg-primary', text: 'Accepted' + end + test 'Add an embargo' do visit root_url click_link(@thesis_01.title)