123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
- require 'browser_test_helper'
- class AgentTicketUpdateAndReloadTest < TestCase
- def test_agent_ticket_create_with_reload
- @browser = browser_instance
- login(
- username: 'agent1@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all
- # create ticket
- ticket_create(
- data: {
- customer: 'nicole',
- group: 'Users',
- title: 'some subject 4 - 123äöü',
- body: 'some body 4 - 123äöü',
- },
- do_not_submit: true,
- )
- sleep 6
- # check if customer is shown in sidebar
- click(css: '.active .tabsSidebar-tab[data-tab="customer"]')
- match(
- css: '.active .sidebar[data-tab="customer"]',
- value: 'nicole',
- )
- # check task title
- verify_task(
- data: {
- title: 'some subject 4 - 123äöü',
- }
- )
- # check page title
- verify_title(
- value: 'some subject 4 - 123äöü',
- )
- # reload instances, verify autosave
- reload
- # check if customer is still shown in sidebar
- click(css: '.active .tabsSidebar-tab[data-tab="customer"]')
- watch_for(
- css: '.active .sidebar[data-tab="customer"]',
- value: 'nicole',
- )
- sleep 2
- # finally create ticket
- click(css: '.content.active .js-submit')
- sleep 5
- location_check(
- url: '#ticket/zoom/',
- )
- # check ticket
- match(
- css: '.active div.ticket-article',
- value: 'some body 4 - 123äöü',
- )
- ticket_id = nil
- if @browser.current_url =~ %r{ticket/zoom/(.+?)$}i
- ticket_id = $1
- end
- # check task title
- verify_task(
- data: {
- title: 'some subject 4 - 123äöü',
- }
- )
- # check page title
- verify_title(
- value: 'some subject 4 - 123äöü',
- )
- # check if task is not marked as modified
- exists(
- css: ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"]",
- )
- exists_not(
- css: ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"].is-modified",
- )
- # reload
- reload
- sleep 4
- # check task title
- verify_task(
- data: {
- title: 'some subject 4 - 123äöü',
- }
- )
- # check page title
- verify_title(
- value: 'some subject 4 - 123äöü',
- )
- # go to dashboard
- location(
- url: browser_url
- )
- sleep 5
- # check page title
- verify_title(
- value: 'Dashboard',
- )
- # reload
- reload
- sleep 5
- # check page title
- verify_title(
- value: 'Dashboard',
- )
- # cleanup
- tasks_close_all
- end
- end
|