customer_ticket_create_test.rb 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # encoding: utf-8
  2. require 'browser_test_helper'
  3. class CustomerTicketCreateTest < TestCase
  4. def test_customer_ticket_create
  5. tests = [
  6. {
  7. :name => 'customer ticket create',
  8. :action => [
  9. {
  10. :execute => 'click',
  11. :css => 'a[href="#new"]',
  12. },
  13. {
  14. :execute => 'click',
  15. :css => 'a[href="#customer_ticket_new"]',
  16. },
  17. {
  18. :execute => 'wait',
  19. :value => 2,
  20. },
  21. {
  22. :execute => 'check',
  23. :css => '.newTicket',
  24. :result => true,
  25. },
  26. {
  27. :execute => 'select',
  28. :css => '.newTicket select[name="group_id"]',
  29. :value => 'Users',
  30. },
  31. {
  32. :execute => 'set',
  33. :css => '.newTicket input[name="title"]',
  34. :value => 'some subject 123äöü',
  35. },
  36. {
  37. :execute => 'set',
  38. :css => '.newTicket [data-name="body"]',
  39. :value => 'some body 123äöü',
  40. },
  41. {
  42. :execute => 'click',
  43. :css => '.newTicket button.submit',
  44. },
  45. {
  46. :execute => 'wait',
  47. :value => 3,
  48. },
  49. {
  50. :execute => 'check',
  51. :element => :url,
  52. :result => '#ticket/zoom/',
  53. },
  54. # check ticket
  55. {
  56. :execute => 'match',
  57. :css => '.active div.ticket-article',
  58. :value => 'some body 123äöü',
  59. :match_result => true,
  60. },
  61. # update ticket
  62. {
  63. :execute => 'check',
  64. :css => '.active [data-name="body"]',
  65. :result => true,
  66. },
  67. {
  68. :execute => 'set',
  69. :css => '.active [data-name="body"]',
  70. :value => 'some body 1234 äöüß',
  71. },
  72. {
  73. :execute => 'click',
  74. :css => '.active button.js-submit',
  75. :type => 'submit',
  76. },
  77. {
  78. :execute => 'watch_for',
  79. :area => 'body',
  80. :value => 'some body 1234 äöüß',
  81. },
  82. ],
  83. },
  84. ]
  85. browser_signle_test_with_login(tests)
  86. end
  87. end