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.

39 lines
1.5 KiB

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