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.

138 lines
5.0 KiB

  1. /* © 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
  2. * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
  3. "use strict";
  4. (function ($) {
  5. openerp.Tour.register({
  6. id: "mass_mailing_partner",
  7. name: "Insert a newsletter snippet and subscribe",
  8. path: "/",
  9. mode: "test",
  10. steps: [
  11. {
  12. title: "Edit the homepage",
  13. waitFor: "button[data-action=edit]",
  14. element: "button[data-action=edit]",
  15. },
  16. {
  17. title: "Click on Insert Blocks",
  18. waitFor: "button[data-action=snippet]",
  19. element: "button[data-action=snippet]",
  20. },
  21. {
  22. title: "Click on Structure",
  23. waitFor: "a[href='#snippet_structure']",
  24. element: "a[href='#snippet_structure']",
  25. },
  26. {
  27. title: "Drag and drop a text snippet",
  28. waitFor: ".oe_snippet:contains('Text Block'):visible",
  29. snippet: ".oe_snippet:contains('Text Block')",
  30. },
  31. {
  32. title: "Click on Insert Blocks again",
  33. waitFor: "#wrap h2:contains('A Great Headline'), \
  34. button[data-action=snippet]",
  35. element: "button[data-action=snippet]",
  36. },
  37. {
  38. title: "Click on Content",
  39. waitFor: "a[href='#snippet_content']",
  40. element: "a[href='#snippet_content']",
  41. },
  42. {
  43. title: "Drag and drop a newsletter snippet",
  44. waitFor: ".oe_snippet:contains('Newsletter'):visible",
  45. snippet: ".oe_snippet:contains('Newsletter')",
  46. },
  47. {
  48. title: "Let the default mailing list",
  49. waitFor: ".modal button:contains('Continue'):visible",
  50. element: ".modal button:contains('Continue'):visible",
  51. },
  52. {
  53. title: "Save changes",
  54. waitNot: ".modal:visible",
  55. element: "button[data-action=save]",
  56. },
  57. {
  58. title: "Subscribe Administrator",
  59. waitFor: "button[data-action=edit]:visible, \
  60. .js_subscribe_btn:visible",
  61. element: ".js_subscribe_btn",
  62. },
  63. {
  64. title: "Open user menu",
  65. waitFor: ".js_subscribe .alert-success:visible",
  66. element: "#top_menu span:contains('Administrator')",
  67. },
  68. {
  69. title: "Log out",
  70. waitFor: ".js_usermenu a:contains('Logout'):visible",
  71. element: ".js_usermenu a:contains('Logout'):visible",
  72. },
  73. {
  74. title: "Try to subscribe without data",
  75. waitFor: "#top_menu a[href='/web/login']:visible, \
  76. .js_subscribe_btn:visible",
  77. element: ".js_subscribe_btn",
  78. },
  79. {
  80. title: "Enter a name",
  81. waitFor: ".js_subscribe.has-error",
  82. element: ".js_subscribe_name",
  83. sampleText: "Visitor",
  84. },
  85. {
  86. title: "Try to subscribe without email",
  87. element: ".js_subscribe_btn",
  88. },
  89. {
  90. title: "Remove the name",
  91. waitFor: ".js_subscribe.has-error",
  92. element: ".js_subscribe_name",
  93. sampleText: "",
  94. },
  95. {
  96. title: "Enter an email",
  97. element: ".js_subscribe_email",
  98. sampleText: "example@example.com",
  99. },
  100. {
  101. title: "Try to subscribe without name",
  102. element: ".js_subscribe_btn",
  103. },
  104. {
  105. title: "Enter the name again",
  106. waitFor: ".js_subscribe.has-error",
  107. element: ".js_subscribe_name",
  108. sampleText: "Visitor",
  109. },
  110. {
  111. title: "Enter a wrong email",
  112. element: ".js_subscribe_email",
  113. sampleText: "bad email",
  114. },
  115. {
  116. title: "Try to subscribe with a bad email",
  117. element: ".js_subscribe_btn",
  118. },
  119. {
  120. title: "Enter the good email",
  121. waitFor: ".js_subscribe.has-error",
  122. element: ".js_subscribe_email",
  123. sampleText: "example@example.com",
  124. },
  125. {
  126. title: "Try to subscribe with good information",
  127. element: ".js_subscribe_btn",
  128. },
  129. // Expect this test to work in v9 when uncommenting this
  130. // {
  131. // title: "Subscription successful",
  132. // waitFor: ".js_subscribe:not(.has-error) \
  133. // .alert-success:visible",
  134. // },
  135. ],
  136. });
  137. })(jQuery);