Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @allure.title('Create work order with comment and cancel it')
- def test_work_order_with_comment(self):
- affiliate = env_config.get('TEST_STATIC', 'affiliate_id')
- with step('Create work order'):
- user_id = self.ticket_api.get_user_info()['id']
- work_order_body = self.ticket_generator.generate_work_order_body(affiliate, user_id)
- work_order_id = self.ticket_api.create_work_order(work_order_body)['_id']
- with step('Comment work order'):
- comment_body = self.ticket_generator.generate_comment_body(affiliate, created_work_order['_id'], user_id)
- created_comment = self.ticket_api.add_comment_work_order(comment_body)
- with step('Check comment present for work order'):
- comments = self.ticket_api.get_work_order_comments({'work_order_id': created_work_order['_id']})['_items']
- assert created_comment['_id'] in [_['_id'] for _ in comments]
- outcome_comment = [_ for _ in comments if _['_id'] == created_comment['_id']][0]
- self.compare_values('text', outcome_comment['text'], created_comment['text'])
- with step('Cancel work order'):
- self.ticket_api.update_work_order(work_order_id, status='canceled')
- with step('Delete work order'):
- self.ticket_api.delete_all_test_work_orders_with_audit_and_comments(affiliate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement