Login as Folio Admin
Go to admin panel
Select approval option to test
Login as corresponding approver
Click on notification to review
Approve PD
Logout
Login as another user
Go to PDs page
Click to Add PD button
Login as user who submitted PD
Click on reviewed PD notification
Expect 'Approval Status: Approved'
1. Change Approval Setting
2. Submit a PD Item
3. Approve PD Item
4. Check Approval of PD Item
That's gross.
When a feature affecting PD approval is added or changed, each option should be re-checked.
Over time, this could lead to hours spent going through the same repetitive, tedious testing process
"Capybara helps you test web applications by simulating how a real user would interact with your app."
visit('page_url') # navigate to page
click_link('id_of_link') # click link by id
click_link('link_text') # click link by link text
click_button('button_name') # fill text field
fill_in('First Name', :with => 'John') # fiil in form field
choose('radio_button') # choose radio button
check('checkbox') # check in checkbox
uncheck('checkbox') # uncheck in checkbox
select('option', :from=>'select_box') # select from dropdown
attach_file('image', 'path_to_image') # upload file
Quick Aside
Unit Testing
Integration Testing
Login as Folio Admin
Go to admin panel
Select approval option to test
Login as corresponding approver
Click on notification to review
Approve PD
Logout
Login as another user
Go to PDs page
Click to Add PD button
Login as user who submitted PD
Click on reviewed PD notification
Expect 'Approval Status: Approved'
1. Change Approval Setting
2. Submit a PD Item
3. Approve PD Item
4. Check Approval of PD Item
scenario 'pd item can be submitted and approved' do
sign_in admin_user
visit('/customization-manager')
within '#pd-approvals-required' do
find("option[value='1']").select_option
end
click_on('Update')
click_on('Logout')
sign_in user
visit new_professional_development_path
fill_in 'professional_development_title', with: 'Example Title'
click_on('Save')
visit professional_developments_path
click_on('Submit for Approval')
visit employee_professional_developments_path(employee_id: user.employee.id)
click_on('Logout')
.
.
.
sign_in user
visit employee_professional_developments_path(employee_id: user.employee.id)
expect(page).to have_content('Approval Status: Approved')
end
scenario 'pd item can be submitted and approved' do
set_single_approval_required
user_submit_in_pd
sign_in supervisor.user
supervisor_approve_pd
user_check_approval_status
end
def set_single_approval_required
sign_in admin_user
visit('/customization-manager')
within '#pd-approvals-required' do
find("option[value='1']").select_option
end
click_on('Update')
click_on('Logout')
end
def user_submit_in_pd
sign_in user
visit new_professional_development_path
fill_in 'professional_development_title', with: 'Example Title'
click_on('Save')
visit professional_developments_path
click_on('Submit for Approval')
visit employee_professional_developments_path(employee_id: user.employee.id)
click_on('Logout')
end
def user_check_approval_status
sign_in user
visit employee_professional_developments_path(employee_id: user.employee.id)
expect(page).to have_content('Approval Status: Approved')
end
...then this.
1 command line input
1 screen
~ 15 - 25 sec per option
Wonderful.