Browse Source

[ADD] phantom test of sent button

pull/6/head
Ilyas 9 years ago
parent
commit
4a5adc481f
  1. 2
      mail_sent/static/src/xml/menu.xml
  2. 3
      mail_sent/tests/__init__.py
  3. 15
      mail_sent/tests/test_js.py

2
mail_sent/static/src/xml/menu.xml

@ -4,7 +4,7 @@
<t t-extend="mail.chat.Sidebar">
<t t-jquery="div[data-channel-id=channel_inbox]" t-operation="after">
<div t-attf-class="o_mail_chat_channel_item #{(active_channel_id == 'channel_sent') ? 'o_active': ''}" data-channel-id="channel_sent">
<span class="o_channel_name"> <i class="fa fa-send-o"/> Sent </span>
<span class="o_channel_name mail_sent"> <i class="fa fa-send-o"/> Sent </span>
</div>
</t>
</t>

3
mail_sent/tests/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import test_js

15
mail_sent/tests/test_js.py

@ -0,0 +1,15 @@
import openerp.tests
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_mail_sent(self):
# wait till page loaded and then click and wait again
code = """
setTimeout(function () {
$(".mail_sent").click();
setTimeout(function () {console.log('ok');}, 3000);
}, 3000);
"""
link = '/web#action=%s' % self.ref('mail.mail_channel_action_client_chat')
self.phantom_js(link, code, "", login="demo")
Loading…
Cancel
Save