123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- require 'browser_test_helper'
- class AgentOrganizationProfileTest < TestCase
- def test_org_profile
- # work in one browser window
- message = '1 ' + rand(99_999_999).to_s
- note = 'some note ' + rand(99_999_999).to_s
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # search and open org
- organization_open_by_search(
- value: 'Zammad Foundation',
- )
- verify_task(
- data: {
- title: 'Zammad Foundation',
- }
- )
- watch_for(
- css: '.active .profile-window',
- value: 'note',
- )
- watch_for(
- css: '.active .profile-window',
- value: 'member',
- )
- # update note
- set(
- css: '.active .profile [data-name="note"]',
- value: note,
- )
- empty_search()
- sleep 2
- # check and change note again in edit screen
- click(css: '.active .js-action .icon-arrow-down', fast: true)
- click(css: '.active .js-action [data-type="edit"]')
- modal_ready()
- watch_for(
- css: '.active .modal',
- value: note,
- )
- set(
- css: '.modal [name="name"]',
- value: 'Z2',
- )
- set(
- css: '.active .modal [data-name="note"]',
- value: 'some note abc',
- )
- click(css: '.active .modal button.js-submit')
- modal_disappear()
- watch_for(
- css: '.active .profile-window',
- value: 'some note abc',
- )
- verify_task(
- data: {
- title: 'Z2',
- }
- )
- # change lastname back
- click(css: '.active .js-action .icon-arrow-down', fast: true)
- click(css: '.active .js-action [data-type="edit"]')
- modal_ready()
- set(
- css: '.modal [name="name"]',
- value: 'Zammad Foundation',
- )
- click(css: '.active .modal button.js-submit')
- modal_disappear()
- verify_task(
- data: {
- title: 'Zammad Foundation',
- }
- )
- # create new ticket
- ticket_create(
- data: {
- customer: 'nico',
- group: 'Users',
- title: 'org profile check ' + message,
- body: 'org profile check ' + message,
- },
- )
- # switch to org tab, verify if ticket is shown
- organization_open_by_search(
- value: 'Zammad Foundation',
- )
- watch_for(
- css: '.active .profile-window',
- value: 'org profile check ' + message,
- )
- tasks_close_all()
- # work with two browser windows
- message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s
- # use current session
- browser1 = @browser
- browser2 = browser_instance
- login(
- browser: browser2,
- username: 'agent1@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all(
- browser: browser2,
- )
- organization_open_by_search(
- browser: browser1,
- value: 'Zammad Foundation',
- )
- organization_open_by_search(
- browser: browser2,
- value: 'Zammad Foundation',
- )
- # update note
- set(
- browser: browser1,
- css: '.active .profile [data-name="note"]',
- value: message,
- )
- empty_search(
- browser: browser1,
- )
- # verify
- watch_for(
- browser: browser2,
- css: '.active .profile-window',
- value: message,
- )
- end
- def test_org_profile_user_active_update
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # search and open org
- organization_open_by_search(
- value: 'Zammad Foundation',
- )
- watch_for(
- css: '.active .profile-window .userList-entry a.user-popover',
- value: 'Nicole Braun',
- )
- exists(
- css: '.active .profile-window .userList-entry .avatar--unique',
- )
- # open user and change status to inactive
- click(
- css: '.active .profile-window .userList-entry a.user-popover',
- )
- click(
- css: '.active .profile-window .dropdown #userAction',
- )
- click(
- css: '.active .profile-window .dropdown li[data-type="edit"]',
- )
- modal_ready()
- select(
- css: '.active .modal select[name="active"]',
- value: 'inactive'
- )
- click(
- css: '.modal .js-submit',
- )
- modal_disappear()
- # go back to the org and check for inactive status update
- click(
- css: '#navigation .nav-tab[data-key="Organization-1"]',
- )
- watch_for(
- css: '.active .profile-window .userList-entry .avatar--unique.avatar--inactive',
- )
- # open user and change status to active again
- click(
- css: '.active .profile-window .userList-entry a.user-popover',
- )
- click(
- css: '.active .profile-window .dropdown #userAction',
- )
- click(
- css: '.active .profile-window .dropdown li[data-type="edit"]',
- )
- modal_ready()
- select(
- css: '.active .modal select[name="active"]',
- value: 'active'
- )
- click(
- css: '.modal .js-submit',
- )
- modal_disappear()
- # go back to the org and check for active status update
- click(
- css: '#navigation .nav-tab[data-key="Organization-1"]',
- )
- watch_for(
- css: '.active .profile-window .userList-entry .avatar--unique',
- )
- exists_not(
- css: '.active .profile-window .userList-entry .avatar--unique.avatar--inactive',
- )
- end
- end
|