From 65afc2f1f46e95769fb65b217ab254aac0513723 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Mon, 31 May 2010 17:55:32 +0530 Subject: [PATCH] [ADD]: hr_evaluation: add yaml file for hr_evaluation module. bzr revid: atp@tinyerp.co.in-20100531122532-vqkf1mc12xwlt4h6 --- addons/hr_evaluation/__openerp__.py | 4 +- addons/hr_evaluation/test/test_hr_evaluation.yml | 152 ++++++++++++++++++++++ 2 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 addons/hr_evaluation/test/test_hr_evaluation.yml diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py index 36b54b6..f4d0f4a 100644 --- a/addons/hr_evaluation/__openerp__.py +++ b/addons/hr_evaluation/__openerp__.py @@ -35,12 +35,14 @@ is done by the manager.Every evaluation filled by the employees can be viewed in the form of """, "init_xml" : [], - "demo_xml" : ["hr_evaluation_demo.xml"], + "demo_xml" : ["hr_evaluation_demo.xml", + ], "update_xml" : [ "security/ir.model.access.csv", "wizard/hr_evaluation_mail_view.xml", "hr_evaluation_view.xml", "report/hr_evaluation_report_view.xml"], + "test": ["test/test_hr_evaluation.yml"], "active": False, "installable": True } diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml new file mode 100644 index 0000000..6e9b11d --- /dev/null +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -0,0 +1,152 @@ +- | + In order to test hr_evaluation module for OpenERP, I will create plan then create evaluation under that plan. +- + | + Given that I have "R & D" Department for employee. +- + !record {model: hr.department, id: hr_department_rd0}: + manager_id: base.user_root + name: 'R & D ' +- + | + Given that I have Employee “Mark Johnson” which take Interview. + select "R & D" Department. +- + !record {model: hr.employee, id: hr_employee_employee0}: + address_home_id: base.res_partner_address_1 + company_id: base.main_company + gender: male + marital: hr.hr_employee_marital_status_single + name: Mark Johnson + user_id: base.user_root + department_id: 'hr_department_rd0' +- | + I create new employee “Phil Graves ” and select "Mark Johnson" as + Manager. +- + !record {model: hr.employee, id: hr_employee_employee1}: + address_home_id: base.res_partner_address_3000 + company_id: base.main_company + gender: male + name: Phil Graves + user_id: base.user_demo + parent_id: 'hr_employee_employee0' + +- | + I Create "Employee Evaluation" survey for Manager's Evaluation Plan. +- + !record {model: 'survey', id: survey_0}: + title: 'Employee Evaluation' + max_response_limit: 20 + response_user: 2 +- | + I Create "Employee Evaluation" page in "Employee Evaluation" survey. +- + !record {model: 'survey.page', id: survey_employee_page_0}: + title: 'Employee Evaluation' + survey_id: survey_0 +- | + I Create "What is your Name" question in "Employee Evaluation" survey page. +- + !record {model: 'survey.question', id: survey_p_question_0}: + question: 'What is your Name?' + type: 'single_textbox' + sequence: 1 + page_id: survey_employee_page_0 +- | + I Create "What is your gender" Question in "Employee Evaluation" survey page. +- + !record {model: 'survey.question', id: survey_p_question_1}: + question: 'What is your gender?' + type: multiple_choice_only_one_ans + sequence: 2 + is_require_answer: true + page_id: survey_employee_page_0 +- | + I Create "Male" answer in question "What is your gender?" +- + !record {model: 'survey.answer', id: survey_p_1_1}: + answer: 'Male' + sequence: 1 + question_id : survey_p_question_1 +- | + I Create "Female" answer in question "What is your gender?" +- + !record {model: 'survey.answer', id: survey_p_1_2}: + answer: 'Female' + sequence: 2 + question_id : survey_p_question_1 + +- | + Now Survey set in open state. +- + !python {model: survey}: | + self.survey_open(cr, uid, [ref("survey_0")], context) + +- | + I creating a Evaluation plan and select "Employee Evaluation" survey for "Send to Subordinates" and "Final interview with Manager" Phase. +- + !record {model: hr_evaluation.plan, id: hr_evaluation_plan_managersplan0}: + company_id: base.main_company + month_first: 3 + month_next: 6 + name: Manager's Plan + phase_ids: + - action: bottom-up + name: Send to Subordinates + survey_id: 'survey_0' + - action: top-down + name: Final Interview with manager + sequence: 2 + survey_id: 'survey_0' + +- | + Now I create Evaluation for "Phil Graves" Employee under "Manager Evaluation Plan". +- + !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}: + date: '2010-06-28' + employee_id: 'hr_employee_employee1' + plan_id: 'hr_evaluation_plan_managersplan0' + progress: 0.0 + state: draft +- | + I check that Evaluation is in "Draft" state. +- + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}: + - state == 'draft' +- | + I start Evaluation process by click on "Start Evaluation" button. +- + !python {model: hr_evaluation.evaluation}: | + self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) + +- | + After that Manager Evaluation plan is In Progress. + I close this servey request by giving answer of survey question. +- + !python {model: hr.evaluation.interview}: | + self.survey_req_done(cr, uid, [ref('hr_evaluation_evaluation_0')]) +- | + I click on "Final Validation" button to finalize Evaluation. +- + !python {model: hr_evaluation.evaluation}: | + self.button_final_validation(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], + {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]}) + +- | + I check that state is "Final Validation". +- + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}: + - state == 'progress' +- | + Give Rating "Meet expectations" by selecting overall Rating. +- + !record {model: hr_evaluation.evaluation, id: hr_evaluation.hr_evaluation_evaluation_0}: + rating: '2' + +- | + I close this Evaluation by click on "Done" button of this wizard. +- + !python {model: hr_evaluation.evaluation}: | + self.button_done(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]}) + \ No newline at end of file -- 1.7.10.4