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.

32 lines
1.1 KiB

  1. from werkzeug import url_encode
  2. import odoo.tests
  3. @odoo.tests.common.at_install(True)
  4. @odoo.tests.common.post_install(True)
  5. class TestUi(odoo.tests.HttpCase):
  6. def test_01_mail_sent(self):
  7. # wait till page loaded and then click and wait again
  8. # needed because tests are run before the module is marked as
  9. # installed. In js web will only load qweb coming from modules
  10. # that are returned by the backend in module_boot. Without
  11. # this you end up with js, css but no qweb.
  12. self.env["ir.module.module"].search(
  13. [("name", "=", "mail_sent")], limit=1
  14. ).state = "installed"
  15. code = """
  16. setTimeout(function () {
  17. $(".mail_sent").click();
  18. setTimeout(function () {console.log('ok');}, 3000);
  19. }, 1000);
  20. """
  21. link = "/web#%s" % url_encode({"action": "mail.action_discuss"})
  22. self.phantom_js(
  23. link,
  24. code,
  25. "odoo.__DEBUG__.services['web_tour.tour'].tours.mail_tour.ready",
  26. login="demo",
  27. )