Browse Source

Merge pull request #40 from ilyasProgrammer/mail-addons-9.0-res_partner_mails_count

[ADD] phantom test of sent button
pull/6/head
Ivan Yelizariev 9 years ago
parent
commit
a6244c2c4e
  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);
}, 1000);
"""
link = '/web#action=%s' % self.ref('mail.mail_channel_action_client_chat')
self.phantom_js(link, code, "odoo.__DEBUG__.services['mail_sent.sent']", login="demo")
Loading…
Cancel
Save