Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- features/support/step_definitions/management_steps.rb
- When(/^I submit \[Create New Task\] form using the following data:$/) do |table|
- step "I click ['New Task'] button"
- step 'I fill [Create New Task] form using the following data:', table
- step "I click ['Create Task'] button"
- end
- When(/^I fill \[Create New Task\] form using the following data:$/) do |table|
- wait_until('Create New Task form is not opened') { @vh.create_new_task_page.sel_client.visible? == true }
- wait_until('Create New Task form is not opened') { @vh.create_new_task_page.sel_assign_disabled.visible? == true }
- table.hashes.each do |task|
- client = task[:client]
- assigned_to = task[:assigned_to]
- due_date = task[:due_date]
- task_type = task[:task_type]
- task_description = task[:task_description]
- priority = task[:priority]
- @vh.create_new_task_page.select_client client
- @vh.create_new_task_page.select_assigned_to assigned_to
- @vh.create_new_task_page.select_task_priority priority
- @vh.create_new_task_page.select_task_type task_type
- @vh.create_new_task_page.txt_due_date.set convert_date(due_date, '%m/%d/%Y') if due_date
- @vh.create_new_task_page.txt_task_descr.set unique_value(task_description) if task_description
- @vh.create_new_task_page.btn_create_task
- end
- end
- When(/^I perform task search using the following data:$/) do |table|
- step 'I fill tasks search form using the following data:', table
- step "I click ['Search Task'] button"
- end
- When(/^I fill tasks search form using the following data:$/) do |table|
- @vh.tasks_page.wait_for_search_client_name_field
- table.hashes.each do |task|
- client = task[:client]
- due_date_from = task[:due_date_from]
- @vh.tasks_page.select_client_name(client)
- @vh.tasks_page.txt_due_date_from.set convert_date(due_date_from, '%m/%d/%Y')
- end
- end
- Then(/^I should see task in the task list with the following data:$/) do |table|
- table.hashes.each do |task|
- client = task[:client]
- assigned_to = task[:assigned_to]
- due_date = task[:due_date]
- task_type = task[:task_type]
- task_description = task[:task_description]
- priority = task[:priority]
- created_by = task[:created_by]
- @vh.tasks_page.task_column(assigned_to, unique_value(task_description), 2) if assigned_to
- @vh.tasks_page.client(client, unique_value(task_description)) if client
- @vh.tasks_page.task_column(priority, unique_value(task_description), 4) if priority
- @vh.tasks_page.task_column(convert_date(due_date, '%m/%d/%Y'), unique_value(task_description), 5) if due_date
- @vh.tasks_page.task_column(task_type, unique_value(task_description), 6) if task_type
- @vh.tasks_page.task_column($data[created_by]['name'], unique_value(task_description), 8) if created_by
- end
- end
- When (/^I click \[Update Task\] button for '(.*)' description$/) do |description|
- @vh.tasks_page.click_btn_update_task(unique_value(description))
- end
- When(/^I submit \[Update Task\] form using the following data:$/) do |table|
- wait_until('Create New Task form is not opened') { @vh.create_new_task_page.sel_client.visible? == true }
- wait_until('Create New Task form is not opened') { @vh.create_new_task_page.sel_assign.visible? == true }
- table.hashes.each do |task|
- assigned_to = task[:assigned_to]
- due_date = task[:due_date]
- priority = task[:priority]
- @vh.create_new_task_page.select_assigned_to assigned_to
- @vh.create_new_task_page.select_task_priority priority
- @vh.create_new_task_page.txt_due_date.set convert_date(due_date, '%m/%d/%Y') if due_date
- @vh.create_new_task_page.btn_create_task
- end
- step "I click ['Create Task'] button"
- end
- When (/^I click \[Delete Task\] button for '(.*)' description$/) do |description|
- @vh.tasks_page.click_btn_delete_task(unique_value(description))
- @vh.tasks_page.click_btn_confirm_delete_task
- end
- Then(/^I should( not)? find task in the task list with the following data:$/) do |negate, table|
- sleep 1
- table.hashes.each do |task|
- task_description = task[:task_description]
- visible = @vh.tasks_page.is_task_row_present? unique_value(task_description)
- negate ? visible.should(be_falsey) : visible.should(be_truthy)
- end
- end
- When (/^I click \[Task Memos\] button for '(.*)' description$/) do |description|
- @vh.tasks_page.click_btn_task_memo(unique_value(description))
- end
- When(/^I submit \[Task Memos\] form using the following data:$/) do |table|
- step 'I fill [Task Memos] form using the following data:', table
- step "I click ['Complete Task'] button"
- end
- When(/^I fill \[Task Memos\] form using the following data:$/) do |table|
- wait_until('Task Memos form is not opened') { @vh.tasks_page.txt_task_memo.visible? == true }
- table.hashes.each do |task|
- task_memos = task[:task_memos]
- @vh.tasks_page.txt_task_memo.set unique_value(task_memos) if task_memos
- end
- end
- When(/^I perform completed task search using the following data:$/) do |table|
- step "I click ['Completed Tab'] button"
- step 'I fill completed tasks search form using the following data:', table
- step "I click ['Search Task'] button"
- end
- When(/^I fill completed tasks search form using the following data:$/) do |table|
- @vh.tasks_page.wait_for_search_client_name_field
- table.hashes.each do |task|
- client = task[:client]
- due_date_from = task[:due_date_from]
- assigned_to = task[:assigned_to]
- @vh.tasks_page.select_client_name(client)
- @vh.tasks_page.txt_completed_due_date_from.set convert_date(due_date_from, '%m/%d/%Y')
- @vh.tasks_page.select_assigned_to assigned_to
- end
- end
- When(/^I submit \[Create New Acute Authorization\] form using the following data:$/) do |table|
- step "I click ['Authorizations'] button"
- step "I click ['New Acute'] button"
- step 'I fill [Create New Acute Authorization] form using the following data:', table
- step "I click ['Submit Acute'] button"
- end
- When(/^I fill \[Create New Acute Authorization\] form using the following data:$/) do |table|
- wait_until('Create New Acute Authorization form is not opened') { @vh.create_acute_authorization_page.sel_owner_disabled.visible? == true }
- table.hashes.each do |auth|
- member = auth[:member]
- servicing_provider = auth[:servicing_provider]
- facility = auth[:facility]
- authorization_begin_date = auth[:authorization_begin_date]
- authorization_end_date = auth[:authorization_end_date]
- discharge_date = auth[:discharge_date]
- primary_icd10_code = auth[:primary_icd10_code]
- units = auth[:units]
- status = auth[:status]
- @vh.create_acute_authorization_page.select_client member
- @vh.create_acute_authorization_page.select_provider servicing_provider
- @vh.create_acute_authorization_page.txt_facility.set facility if facility
- @vh.create_acute_authorization_page.txt_auth_begin_date.set convert_date(authorization_begin_date, '%m/%d/%Y') if authorization_begin_date
- @vh.create_acute_authorization_page.txt_auth_end_date.set convert_date(authorization_end_date, '%m/%d/%Y') if authorization_end_date
- @vh.create_acute_authorization_page.txt_auth_discharge_date.set convert_date(discharge_date, '%m/%d/%Y') if discharge_date
- @vh.create_acute_authorization_page.txt_primary_icd.set primary_icd10_code if primary_icd10_code
- @vh.create_acute_authorization_page.txt_units.set units if units
- @vh.create_acute_authorization_page.select_status status
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement