agent_ticket_update4_test.rb 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. require 'browser_test_helper'
  2. class AgentTicketUpdate4Test < TestCase
  3. def test_update_date_object_for_ticket
  4. @browser = browser_instance
  5. login(
  6. username: 'master@example.com',
  7. password: 'test',
  8. url: browser_url,
  9. )
  10. tasks_close_all()
  11. # date object
  12. object_manager_attribute_create(
  13. data: {
  14. name: 'date1',
  15. display: "Date-#{rand(999_999)}",
  16. data_type: 'Date',
  17. },
  18. )
  19. watch_for(
  20. css: '.content.active',
  21. value: 'Database Update required',
  22. )
  23. click(css: '.content.active .tab-pane.active div.js-execute')
  24. watch_for(
  25. css: '.modal',
  26. value: 'restart',
  27. )
  28. watch_for_disappear(
  29. css: '.modal',
  30. timeout: 240,
  31. )
  32. sleep 5
  33. watch_for(
  34. css: '.content.active',
  35. )
  36. # create new ticket
  37. ticket = ticket_create(
  38. data: {
  39. customer: 'nico',
  40. group: 'Users',
  41. priority: '2 normal',
  42. state: 'open',
  43. title: 'ticket attribute test #1',
  44. body: 'ticket attribute test #1',
  45. },
  46. custom_data_date: {
  47. date1: '02/28/2018',
  48. },
  49. disable_group_check: true,
  50. )
  51. ticket_open_by_search(
  52. browser: @browser,
  53. number: ticket[:number],
  54. )
  55. ticket_update(
  56. data: {},
  57. custom_data_date: {
  58. date1: '',
  59. },
  60. )
  61. click(css: '.content.active .js-submit')
  62. match_not(
  63. css: '.active .sidebar div[data-name="date1"] input[data-item="date"]',
  64. value: '02/28/2018',
  65. )
  66. end
  67. end