[FIX] hr_evaluation: YAML
[odoo/odoo.git] / addons / hr_evaluation / test / test_hr_evaluation.yml
1 -
2   In order to test hr_evaluation module for OpenERP, I will create plan then create evaluation under that plan.
3 -
4
5   I create new Department.
6 -
7   !record {model: hr.department, id: hr_department_rd0}:
8     manager_id: base.user_root
9     name: 'R & D'
10 -
11   I create a new employee.
12 -
13   !record {model: hr.employee, id: hr_employee_employee0}:
14     address_home_id: base.res_partner_address_1
15     company_id: base.main_company
16     gender: male
17     marital: hr.hr_employee_marital_status_single
18     name: Mark Johnson
19     user_id: base.user_root
20     department_id: 'hr_department_rd0'
21 -
22   I create another new employee and assign first one as it's Manager.
23 -
24   !record {model: hr.employee, id: hr_employee_employee1}:
25     address_home_id: base.res_partner_address_3000
26     company_id: base.main_company
27     gender: male
28     name: Phil Graves
29     user_id: base.user_demo
30     parent_id: 'hr_employee_employee0'
31
32 -
33   I Create an "Employee Evaluation" survey for Manager's Evaluation Plan.
34 -
35     !record {model: 'survey', id: survey_0}:
36         title: 'Employee Evaluation'
37         max_response_limit: 20
38         response_user: 2
39 -
40   I Create an "Employee Evaluation" page in "Employee Evaluation" survey.
41 -
42     !record {model: 'survey.page', id: survey_employee_page_0}:
43         title: 'Employee Evaluation'
44         survey_id: survey_0
45 -
46   I Create "What is your Name" question in "Employee Evaluation" survey page.
47 -
48     !record {model: 'survey.question', id: survey_p_question_0}:
49         question: 'What is your Name?'
50         type: 'single_textbox'
51         sequence: 1
52         page_id: survey_employee_page_0
53 -
54   I Create "What is your gender" Question in "Employee Evaluation" survey page.
55 -
56     !record {model: 'survey.question', id: survey_p_question_1}:
57         question: 'What is your gender?'
58         type: multiple_choice_only_one_ans
59         sequence: 2
60         is_require_answer: true
61         page_id: survey_employee_page_0
62 -
63   I Create "Male" answer in question "What is your gender?"
64 -
65     !record {model: 'survey.answer', id: survey_p_1_1}:
66         answer: 'Male'
67         sequence: 1
68         question_id : survey_p_question_1
69 -
70   I Create "Female" answer in question "What is your gender?"
71 -
72     !record {model: 'survey.answer', id: survey_p_1_2}:
73         answer: 'Female'
74         sequence: 2
75         question_id : survey_p_question_1
76
77 -
78   I set the survey in open state.
79 -
80   !python {model: survey}: |
81        self.survey_open(cr, uid, [ref("survey_0")], context)
82
83 -
84   I create an Evaluation plan and select "Employee Evaluation" survey for "Send to Subordinates" and "Final interview with Manager" Phase.
85 -
86   !record {model: hr_evaluation.plan, id: hr_evaluation_plan_managersplan0}:
87     company_id: base.main_company
88     month_first: 3
89     month_next: 6
90     name: Manager's  Plan
91     phase_ids:
92       - action: bottom-up
93         name: Send to Subordinates
94         survey_id: 'survey_0'
95       - action: top-down
96         name: Final Interview with manager
97         sequence: 2
98         survey_id: 'survey_0'
99
100 -
101   I create an Evaluation for employee under "Manager Evaluation Plan".
102 -
103   !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
104     date: '2010-06-28'
105     employee_id: 'hr_employee_employee1'
106     plan_id: 'hr_evaluation_plan_managersplan0'
107     progress: 0.0
108     state: draft
109 -
110   I create an Interview Request record
111
112   !record {model: hr.evaluation.interview, id: hr_evaluation_interview_0}:
113     date_deadline: '2010-06-28'
114     evaluation_id: 'hr_evaluation_evaluation_0'
115     survey_id:  hr_evaluation.survey_0
116 -
117   I check that evaluation is in "Draft" state.
118 -
119   !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
120      - state == 'draft'
121 -
122   I start the evaluation process by click on "Start Evaluation" button.
123 -
124   !python {model: hr_evaluation.evaluation}: |
125      self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
126
127 -
128   I close this servey request by giving answer of survey question.
129 -
130   !python {model: hr.evaluation.interview}: |
131     self.survey_req_done(cr, uid, [ref('hr_evaluation_interview_0')])
132 -
133   I click on "Final Validation" button to finalise evaluation.
134 -
135   !python {model: hr_evaluation.evaluation}: |
136     self.button_final_validation(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")],
137       {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})
138
139 -
140   I check that state is "Final Validation".
141 -
142   !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
143       - state == 'progress'
144 -
145   Give Rating "Meet expectations" by selecting overall Rating.
146 -
147   !record {model: hr_evaluation.evaluation, id: hr_evaluation.hr_evaluation_evaluation_0}:
148     rating: '2'
149
150 -
151   I close this Evaluation by click on "Done" button of this wizard.
152 -
153   !python {model: hr_evaluation.evaluation}: |
154     self.button_done(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})