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.

118 lines
4.2 KiB

  1. /* Copyright 2016-2017 Jairo Llopis <jairo.llopis@tecnativa.com>
  2. * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
  3. odoo.define("website_mass_mailing_name.editor_and_public_tour", function (require) {
  4. "use strict";
  5. var base = require("web_editor.base");
  6. var tour = require("web_tour.tour");
  7. tour.register(
  8. "mass_mailing_name_editor_and_public",
  9. {
  10. test: true,
  11. wait_for: base.ready(),
  12. },
  13. [
  14. // Admin edits home page and adds subscription snippet
  15. {
  16. content: "Edit the homepage",
  17. trigger: ".o_menu_systray a[data-action=edit]",
  18. },
  19. {
  20. content: "Drag and drop a text snippet",
  21. trigger: ".oe_snippet[name='Text block'] .oe_snippet_thumbnail",
  22. run: "drag_and_drop #wrap",
  23. },
  24. {
  25. content: "Drag and drop a newsletter snippet",
  26. trigger: ".oe_snippet[name='Newsletter'] .oe_snippet_thumbnail",
  27. run: "drag_and_drop #wrap .s_text_block",
  28. },
  29. {
  30. content: "Let the default mailing list",
  31. trigger: ".modal-dialog button:contains('Continue')",
  32. },
  33. {
  34. content: "Save changes",
  35. extra_trigger: "body:not(:has(.modal:visible))",
  36. trigger: "#web_editor-top-edit button[data-action=save]",
  37. },
  38. {
  39. content: "Subscribe Administrator",
  40. extra_trigger: "body:not(:has(#web_editor-top-edit))",
  41. trigger: ".js_subscribe_btn",
  42. },
  43. // Log out
  44. {
  45. content: "Open user menu",
  46. extra_trigger: ".js_subscribe .alert-success",
  47. trigger: "#top_menu span:contains('Admin')",
  48. },
  49. {
  50. content: "Logout",
  51. trigger: "#o_logout",
  52. },
  53. // Now use the widget as a random public user
  54. {
  55. content: "Try to subscribe without data",
  56. extra_trigger: "a:contains('Sign in')",
  57. trigger: ".js_subscribe_btn",
  58. },
  59. {
  60. content: "Enter a name",
  61. extra_trigger: "div.input-group.js_subscribe",
  62. trigger: ".js_subscribe_name",
  63. run: "text Visitor",
  64. },
  65. {
  66. content: "Try to subscribe without email",
  67. trigger: ".js_subscribe_btn",
  68. },
  69. {
  70. content: "Remove the name",
  71. extra_trigger: "div.input-group.js_subscribe",
  72. trigger: ".js_subscribe_name",
  73. run: function () {
  74. $(".js_subscribe_name").val("");
  75. },
  76. },
  77. {
  78. content: "Enter an email",
  79. trigger: ".js_subscribe_email",
  80. run: "text example@example.com",
  81. },
  82. {
  83. content: "Try to subscribe without name",
  84. trigger: ".js_subscribe_btn",
  85. },
  86. {
  87. content: "Enter the name again",
  88. extra_trigger: "div.input-group.js_subscribe",
  89. trigger: ".js_subscribe_name",
  90. run: "text Visitor",
  91. },
  92. {
  93. content: "Enter a wrong email",
  94. trigger: ".js_subscribe_email",
  95. run: "text bad email",
  96. },
  97. {
  98. content: "Try to subscribe with a bad email",
  99. trigger: ".js_subscribe_btn",
  100. },
  101. {
  102. content: "Enter the good email",
  103. extra_trigger: "div.input-group.js_subscribe",
  104. trigger: ".js_subscribe_email",
  105. run: "text example@example.com",
  106. },
  107. {
  108. content: "Try to subscribe with good information",
  109. trigger: ".js_subscribe_btn",
  110. },
  111. {
  112. content: "Subscription successful",
  113. trigger: ".js_subscribe:not(.has-error) .alert-success",
  114. },
  115. ]
  116. );
  117. });