Files
odoo_source/addons/website_livechat/controllers/test.py
T
David Beguin 190dab8144 [IMP] website_livechat : add various tests on livechat and visitors
Adds Python tests and javascripts tours on livechat (website and visitor
integration). Because breaking livechat every two days in rush periods
(or even not) is getting quite annoying.

Those tests are testing :

- The client side flow (open livechat, send messages,
  send rating and close the livechat session)
- The channel and message author naming, visitor page view history
- Chat request flow (complete chat request flow, open empty operator's
  chat request and cancel due to visitor's new chat session)

Task ID : 2079087
PR #40052

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-17 12:21:48 +00:00

20 lines
930 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.http import Controller, request, route
class TestBusController(Controller):
"""
This controller is only useful for test purpose. Bus is unavailable in test mode, but there is no way to know,
at client side, if we are running in test mode or not. This route can be called while running tours to mock
some behaviour in function of the test mode status (activated or not).
E.g. : To test the livechat and to check there is no duplicates in message displayed in the chatter,
in test mode, we need to mock a 'message added' notification that is normally triggered by the bus.
In Normal mode, the bus triggers itself the notification.
"""
@route('/bus/test_mode_activated', type="json", auth="public")
def is_test_mode_activated(self):
return request.registry.in_test_mode()