diff --git a/drivers/hmis/spec/system/hmis/assessment_definitions_spec.rb b/drivers/hmis/spec/system/hmis/assessment_definitions_spec.rb index ded0012c1d..2b695b8fb1 100644 --- a/drivers/hmis/spec/system/hmis/assessment_definitions_spec.rb +++ b/drivers/hmis/spec/system/hmis/assessment_definitions_spec.rb @@ -76,7 +76,7 @@ end it 'upgrades to the newer version when you unlock for editing' do - click_link old_definition.title + click_link 'View Assessment' assert_text old_definition.title @@ -101,7 +101,7 @@ # Re-open the assessment to ensure it is using the new form now assert_no_text old_definition.title - click_link definition.title + click_link 'View Assessment' assert_text 'New question' assert_text 'Answer to new question' assert_no_text 'Text on old form' @@ -113,7 +113,7 @@ let!(:wip_assessment) { create(:hmis_custom_assessment, definition: old_definition, wip: true, values: { 'assessment_date': today.strftime('%Y-%m-%d') }, enrollment: e1, assessment_date: today) } it 'uses old form version for editing' do - click_link old_definition.title + click_link 'View Assessment' assert_text old_definition.title expect(page).to have_field('Assessment Date', with: wip_assessment.assessment_date.strftime('%m/%d/%Y')) assert_text 'Text on old form' @@ -176,7 +176,7 @@ sign_in(hmis_user) visit "/client/#{c1.id}/enrollments/#{e1.id}/assessments" - click_link 'Intake' + click_link 'Finish Intake' end def select_member(client) diff --git a/drivers/hmis/spec/system/hmis/bulk_services_spec.rb b/drivers/hmis/spec/system/hmis/bulk_services_spec.rb index 03e3ec030e..0e0c2b8183 100644 --- a/drivers/hmis/spec/system/hmis/bulk_services_spec.rb +++ b/drivers/hmis/spec/system/hmis/bulk_services_spec.rb @@ -13,7 +13,7 @@ require_relative '../../requests/hmis/login_and_permissions' require_relative '../../support/hmis_base_setup' -RSpec.feature 'Hmis Form behavior', type: :system do +RSpec.feature 'Bulk Services behavior', type: :system do include_context 'hmis base setup' include_context 'hmis service setup' @@ -59,9 +59,9 @@ # Find the indices of the two columns we want to check header_cells = all('thead th') last_bed_night_date_index = header_cells.find_index { |cell| cell.text == 'Last Bed Night Date' } - assign_bed_night_index = header_cells.find_index { |cell| cell.text == "Assign Bed Night for #{bed_night_date.strftime('%m/%d/%Y')}" } + button_column_index = header_cells.find_index { |cell| cell.text == 'Actions' } expect(last_bed_night_date_index).not_to be_nil - expect(assign_bed_night_index).not_to be_nil + expect(button_column_index).not_to be_nil # Verify that all 3 rows have the expected attributes all('tbody tr').each do |row| @@ -69,8 +69,8 @@ last_bed_night_date = row.all('td')[last_bed_night_date_index].text expect(last_bed_night_date).to match(/#{bed_night_date.strftime('%m/%d/%Y')}/) - # Check the "Assign Bed Night for mm/dd/yyyy" column - assign_button = row.all('td')[assign_bed_night_index].find('button') + # Check the "Actions" column + assign_button = row.all('td')[button_column_index].first('button') expect(assign_button.text).to eq('Assigned') end diff --git a/drivers/hmis/spec/system/hmis/data_collection_features_spec.rb b/drivers/hmis/spec/system/hmis/data_collection_features_spec.rb index 1efccf1cc2..04a2303292 100644 --- a/drivers/hmis/spec/system/hmis/data_collection_features_spec.rb +++ b/drivers/hmis/spec/system/hmis/data_collection_features_spec.rb @@ -55,7 +55,7 @@ def side_nav_elements expect(table_row).to include(spouse.first_name) expect(table_row).to include('Safe Haven') - click_link spouse.first_name + click_link 'View CLS' assert_current_path("/client/#{spouse.id}/enrollments/#{spouse_enrollment.id}/current-living-situations") end @@ -76,7 +76,7 @@ def side_nav_elements assert_no_text 'Add Current Living Situation' - find('tbody').first('tr').trigger(:click) + click_button 'View CLS' assert_text 'View Current Living Situation' assert_no_text 'Not Found' assert_text 'Current Living Situation Safe Haven' @@ -147,7 +147,7 @@ def side_nav_elements assert_no_text 'Add Case Note' - find('tbody').first('tr').trigger(:click) + click_button 'View Case Note' click_button 'Edit' fill_in 'Note', with: 'An updated legacy custom case note' click_button 'Save' diff --git a/drivers/hmis/spec/system/hmis/enrollment_management_spec.rb b/drivers/hmis/spec/system/hmis/enrollment_management_spec.rb index 26ec3f3fd6..4956bbcc4e 100644 --- a/drivers/hmis/spec/system/hmis/enrollment_management_spec.rb +++ b/drivers/hmis/spec/system/hmis/enrollment_management_spec.rb @@ -97,7 +97,7 @@ def make_household(household_id: Hmis::Hud::Base.generate_uuid, enrollment_facto before(:each) do make_household(enrollment_factory: :hmis_hud_wip_enrollment) fill_in 'Search Clients', with: c1.last_name - click_link c1.brief_name + find('a', text: 'View Enrollment', match: :first).trigger(:click) click_link 'Household' click_link 'Manage Household' end @@ -155,7 +155,7 @@ def make_household(household_id: Hmis::Hud::Base.generate_uuid, enrollment_facto # now we have to go back and find the enrollment again to see prev members click_link 'Enrollments', match: :first assert_text(c1.brief_name) - click_link c1.brief_name, match: :first + find('a', text: 'View Enrollment', match: :first).trigger(:click) click_link 'Household' click_link 'Manage Household' diff --git a/drivers/hmis/spec/system/hmis/intake_assessment_spec.rb b/drivers/hmis/spec/system/hmis/intake_assessment_spec.rb index ae7ff0cbd8..04bb831133 100644 --- a/drivers/hmis/spec/system/hmis/intake_assessment_spec.rb +++ b/drivers/hmis/spec/system/hmis/intake_assessment_spec.rb @@ -8,7 +8,7 @@ require_relative '../../requests/hmis/login_and_permissions' require_relative '../../support/hmis_base_setup' -RSpec.feature 'Enrollment/household management', type: :system do +RSpec.feature 'Intake assessment', type: :system do include_context 'hmis base setup' # could parse CAPYBARA_APP_HOST let!(:ds1) { create(:hmis_data_source, hmis: 'localhost') } @@ -74,7 +74,7 @@ def complete_individual_assessment expect(e2.intake_assessment).to be_nil fill_in 'Search Clients', with: c1.last_name - click_link c1.brief_name + click_link "View Enrollment, #{c1.brief_name} #{e1.entry_date.strftime('%m/%d/%Y')} - Active" click_link 'Assessments' click_link 'Finish Intake'