123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- # encoding: utf-8
- require 'browser_test_helper'
- class AgentTicketTimeAccountingTest < TestCase
- def test_macro
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # enable time accounting
- click(
- css: 'a[href="#manage"]',
- )
- click(
- css: '.content.active a[href="#manage/time_accounting"]',
- )
- switch(
- css: '.content.active .js-timeAccountingSetting',
- type: 'on',
- )
- ticket1 = ticket_create(
- data: {
- customer: 'nico',
- group: 'Users',
- title: 'some subject - time accounting#1',
- body: 'some body - time accounting#1',
- },
- )
- ticket_update(
- data: {
- body: 'some note',
- },
- do_not_submit: true,
- )
- click(
- css: '.active .js-submit',
- )
- watch_for(
- css: '.content.active .modal',
- value: 'Time Accounting',
- )
- set(
- css: '.content.active .modal [name=time_unit]',
- value: '4',
- )
- click(
- css: '.content.active .modal .js-submit',
- )
- watch_for_disappear(
- css: '.content.active .modal',
- value: 'Time Accounting',
- )
- watch_for(
- css: '.content.active .js-timeUnit',
- value: '4',
- )
- ticket2 = ticket_create(
- data: {
- customer: 'nico',
- group: 'Users',
- title: 'some subject - time accounting#2',
- body: 'some body - time accounting#2',
- },
- )
- ticket_update(
- data: {
- body: 'some note',
- },
- do_not_submit: true,
- )
- click(
- css: '.active .js-submit',
- )
- watch_for(
- css: '.content.active .modal',
- value: 'Time Accounting',
- )
- set(
- css: '.content.active .modal [name=time_unit]',
- value: '4,6',
- )
- click(
- css: '.content.active .modal .js-submit',
- )
- watch_for_disappear(
- css: '.content.active .modal',
- value: 'Time Accounting',
- )
- watch_for(
- css: '.content.active .js-timeUnit',
- value: '4.6',
- )
- ticket_update(
- data: {
- body: 'some note2',
- },
- do_not_submit: true,
- )
- click(
- css: '.active .js-submit',
- )
- watch_for(
- css: '.content.active .modal',
- value: 'Time Accounting',
- )
- set(
- css: '.content.active .modal [name=time_unit]',
- value: '4abc',
- )
- click(
- css: '.content.active .modal .js-submit',
- )
- watch_for(
- css: '.content.active .modal [name=time_unit].has-error',
- )
- set(
- css: '.content.active .modal [name=time_unit]',
- value: '4 ',
- )
- click(
- css: '.content.active .modal .js-submit',
- )
- watch_for_disappear(
- css: '.content.active .modal',
- value: 'Time Accounting',
- )
- watch_for(
- css: '.content.active .js-timeUnit',
- value: '8.6',
- )
- # disable time accounting
- click(
- css: 'a[href="#manage"]',
- )
- click(
- css: '.content.active a[href="#manage/time_accounting"]',
- )
- switch(
- css: '.content.active .js-timeAccountingSetting',
- type: 'off',
- )
- end
- end
|