You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.5 KiB

  1. # -*- coding: utf-8 -*-
  2. import odoo.tests
  3. @odoo.tests.common.at_install(False)
  4. @odoo.tests.common.post_install(True)
  5. class TestUi(odoo.tests.HttpCase):
  6. def test_01_mail_all(self):
  7. # wait till page loaded and then click and wait again
  8. code = """
  9. setTimeout(function () {
  10. var reply_button = $('.o_mail_info:not(:has(.o_document_link))').find(".fa.fa-reply.o_thread_icon.o_thread_message_reply");
  11. if (reply_button.length === 0) {
  12. console.log('error');
  13. }
  14. reply_button[0].click();
  15. setTimeout(function () {
  16. var send_button = $(".btn.btn-sm.btn-primary.o_composer_button_send.hidden-xs:visible");
  17. if (send_button.length === 0) {
  18. console.log('error');
  19. }
  20. $("textarea.o_input.o_composer_text_field")[1].value = 'test';
  21. send_button.click();
  22. setTimeout(function () {
  23. if ($(".alert.o_mail_snackbar:visible").length === 0) {
  24. console.log('error');
  25. } else {
  26. console.log('ok');
  27. }
  28. }, 1000);
  29. }, 3000);
  30. }, 1000);
  31. """
  32. link = '/web#action=%s' % self.ref('mail.mail_channel_action_client_chat')
  33. self.phantom_js(link, code, "odoo.__DEBUG__.services['mail_reply.reply']", login="admin")