Browse Source

Merge pull request #173 from KolushovAlexandr/10.0-mail_private-tests

🛡️ mail_private tests
pull/175/head
Ivan Yelizariev 6 years ago
committed by GitHub
parent
commit
da48187055
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      mail_attachment_popup/README.rst
  2. 2
      mail_attachment_popup/__manifest__.py
  3. 2
      mail_private/__manifest__.py
  4. 2
      mail_private/full_composer_wizard.xml
  5. 48
      mail_private/static/src/js/test_private.js
  6. 3
      mail_private/template.xml
  7. 4
      mail_private/tests/__init__.py
  8. 26
      mail_private/tests/test_js.py

10
mail_attachment_popup/README.rst

@ -13,23 +13,23 @@ Contributors
Sponsors
--------
* `IT-Projects LLC <https://it-projects.info>`_
* `IT-Projects LLC <https://it-projects.info>`__
Maintainers
-----------
* `IT-Projects LLC <https://it-projects.info>`_
* `IT-Projects LLC <https://it-projects.info>`__
The module is not maintained in future versions because it's functionality built-in since Odoo 11.0.
Further information
===================
Demo: http://runbot.it-projects.info/demo/mail-addons/9.0
Demo: http://runbot.it-projects.info/demo/mail-addons/10.0
HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_attachment_popup/
HTML Description: https://apps.odoo.com/apps/modules/10.0/mail_attachment_popup/
Usage instructions: `<doc/index.rst>`_
Changelog: `<doc/changelog.rst>`_
Tested on Odoo 9.0 021878f9c41c6d652abf345c3c5537fe92f8bc5b
Tested on Odoo 10.0 9cf666288076dc4e315e62e7ca0d6fc59995a498

2
mail_attachment_popup/__manifest__.py

@ -3,7 +3,7 @@
"name": """Popup Attachments""",
"summary": """Open attached mail images in popup""",
"category": "Extra Tools",
"version": "1.0.0",
"version": "10.0.1.0.0",
"images": ['images/popup_image.png'],
"author": "IT-Projects LLC, Dinar Gabbasov",

2
mail_private/__manifest__.py

@ -4,7 +4,7 @@
"summary": """Send private messages to specified recipients, regardless of who are in followers list.""",
"category": "Discuss",
"images": ['images/mail_private_image.png'],
"version": "1.0.1",
"version": "10.0.1.0.1",
"application": False,
"author": "IT-Projects LLC, Pavel Romanchenko",

2
mail_private/full_composer_wizard.xml

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="email_compose_message_wizard_form_private">
<field name="name">mail.compose.message.form.private</field>
@ -23,5 +22,4 @@
</field>
</record>
</data>
</odoo>

48
mail_private/static/src/js/test_private.js

@ -0,0 +1,48 @@
/* Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).*/
odoo.define('mail_private.tour', function (require) {
"use strict";
var tour = require("web_tour.tour");
var core = require('web.core');
var _t = core._t;
var email = 'You Are Whalecum';
var steps = [{
trigger: '.o_thread_message strong.o_mail_redirect:contains("Agrolait")',
content: _t("Open Partners Form"),
position: 'bottom',
}, {
trigger: "button.oe_compose_post_private",
content: _t("Click on Private mail creating button"),
position: "bottom"
}, {
// for some reason (due to tricky renderings) button.oe_composer_uncheck could not be find by the tour manager
trigger: ".o_control_panel.o_breadcrumb_full li.active",
content: _t("Dummy action"),
}, {
trigger: "button.oe_composer_uncheck",
extra_trigger: "button.oe_composer_uncheck",
content: _t("Uncheck all Followers"),
timeout: 22000,
}, {
trigger: "div.o_composer_suggested_partners input:first",
content: _t("Check the first one"),
}, {
trigger: "textarea.o_composer_text_field:first",
content: _t("Write some email"),
run: function() {
$('textarea.o_composer_text_field:first').val(email);
},
}, {
trigger: ".o_composer_buttons .o_composer_button_send",
content: _t("Send email"),
}, {
trigger: ".o_mail_thread .o_thread_message:contains(" + email + ")",
content: _t("Send email"),
}
];
tour.register('mail_private_tour', { test: true, url: '/web' }, steps);
});

3
mail_private/template.xml

@ -9,6 +9,9 @@
<script
type="text/javascript"
src="/mail_private/static/src/js/mail_private.js"></script>
<script
type="text/javascript"
src="/mail_private/static/src/js/test_private.js"></script>
</xpath>
</template>
</data>

4
mail_private/tests/__init__.py

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from . import test_js

26
mail_private/tests/test_js.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import odoo.tests
from odoo.api import Environment
@odoo.tests.common.at_install(True)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_mail_private(self):
# needed because tests are run before the module is marked as
# installed. In js web will only load qweb coming from modules
# that are returned by the backend in module_boot. Without
# this you end up with js, css but no qweb.
cr = self.registry.cursor()
env = Environment(cr, self.uid, {})
env['ir.module.module'].search([('name', '=', 'mail_private')], limit=1).state = 'installed'
cr.release()
self.phantom_js("/web",
"odoo.__DEBUG__.services['web_tour.tour'].run('mail_private_tour', 1000)",
"odoo.__DEBUG__.services['web_tour.tour'].tours.mail_private_tour.ready",
login="admin", timeout=70)
Loading…
Cancel
Save