|
@@ -4,185 +4,128 @@ require 'browser_test_helper'
|
|
|
class AgentUserProfileTest < TestCase
|
|
|
def test_search_and_edit_verify_in_second
|
|
|
message = 'comment 1 ' + rand(99999999999999999).to_s
|
|
|
- tests = [
|
|
|
- {
|
|
|
- :name => 'start',
|
|
|
- :instance1 => browser_instance,
|
|
|
- :instance2 => browser_instance,
|
|
|
- :instance1_username => 'master@example.com',
|
|
|
- :instance1_password => 'test',
|
|
|
- :instance2_username => 'agent1@example.com',
|
|
|
- :instance2_password => 'test',
|
|
|
- :url => browser_url,
|
|
|
- :action => [
|
|
|
- {
|
|
|
- :where => :instance1,
|
|
|
- :execute => 'close_all_tasks',
|
|
|
- },
|
|
|
- {
|
|
|
- :where => :instance2,
|
|
|
- :execute => 'close_all_tasks',
|
|
|
- },
|
|
|
- {
|
|
|
- :where => :instance1,
|
|
|
- :execute => 'search_user',
|
|
|
- :term => 'Braun',
|
|
|
- },
|
|
|
- {
|
|
|
- :where => :instance2,
|
|
|
- :execute => 'search_user',
|
|
|
- :term => 'Braun',
|
|
|
- },
|
|
|
-
|
|
|
- # update note
|
|
|
- {
|
|
|
- :where => :instance1,
|
|
|
- :execute => 'set',
|
|
|
- :css => '.active [data-name="note"]',
|
|
|
- :value => message,
|
|
|
- },
|
|
|
- {
|
|
|
- :where => :instance1,
|
|
|
- :execute => 'click',
|
|
|
- :css => '.active .profile',
|
|
|
- },
|
|
|
- {
|
|
|
- :where => :instance1,
|
|
|
- :execute => 'wait',
|
|
|
- :value => 3,
|
|
|
- },
|
|
|
-
|
|
|
- # verify
|
|
|
- {
|
|
|
- :where => :instance2,
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .profile-window',
|
|
|
- :value => message,
|
|
|
- :match_result => true,
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ]
|
|
|
- browser_double_test(tests)
|
|
|
+
|
|
|
+ browser1 = browser_instance
|
|
|
+ login(
|
|
|
+ :browser => browser1,
|
|
|
+ :username => 'master@example.com',
|
|
|
+ :password => 'test',
|
|
|
+ :url => browser_url,
|
|
|
+ )
|
|
|
+ tasks_close_all(
|
|
|
+ :browser => browser1,
|
|
|
+ )
|
|
|
+
|
|
|
+ browser2 = browser_instance
|
|
|
+ login(
|
|
|
+ :browser => browser2,
|
|
|
+ :username => 'agent1@example.com',
|
|
|
+ :password => 'test',
|
|
|
+ :url => browser_url,
|
|
|
+ )
|
|
|
+ tasks_close_all(
|
|
|
+ :browser => browser2,
|
|
|
+ )
|
|
|
+
|
|
|
+ user_open_by_search(
|
|
|
+ :browser => browser1,
|
|
|
+ :value => 'Braun',
|
|
|
+ )
|
|
|
+ user_open_by_search(
|
|
|
+ :browser => browser2,
|
|
|
+ :value => 'Braun',
|
|
|
+ )
|
|
|
+
|
|
|
+ # update note
|
|
|
+ set(
|
|
|
+ :browser => browser1,
|
|
|
+ :css => '.active [data-name="note"]',
|
|
|
+ :value => message,
|
|
|
+ )
|
|
|
+ click(
|
|
|
+ :browser => browser1,
|
|
|
+ :css => '.active .profile',
|
|
|
+ )
|
|
|
+
|
|
|
+ watch_for(
|
|
|
+ :browser => browser2,
|
|
|
+ :css => '.active .profile-window',
|
|
|
+ :value => message,
|
|
|
+ )
|
|
|
end
|
|
|
|
|
|
def test_search_and_edit_in_one
|
|
|
message = '1 ' + rand(99999999).to_s
|
|
|
- tests = [
|
|
|
- {
|
|
|
- :name => 'search and edit',
|
|
|
- :action => [
|
|
|
- {
|
|
|
- :execute => 'close_all_tasks',
|
|
|
- },
|
|
|
-
|
|
|
- # search and open user
|
|
|
- {
|
|
|
- :execute => 'search_user',
|
|
|
- :term => 'Braun',
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .profile-window',
|
|
|
- :value => 'note',
|
|
|
- :match_result => true,
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .profile-window',
|
|
|
- :value => 'email',
|
|
|
- :match_result => true,
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- # update note
|
|
|
- {
|
|
|
- :execute => 'set',
|
|
|
- :css => '.active [data-name="note"]',
|
|
|
- :value => 'some note 123'
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'click',
|
|
|
- :css => '.active .profile',
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'wait',
|
|
|
- :value => 1,
|
|
|
- },
|
|
|
-
|
|
|
- # check and change note again in edit screen
|
|
|
- {
|
|
|
- :execute => 'click',
|
|
|
- :css => '.active .js-action .select-arrow',
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'click',
|
|
|
- :css => '.active .js-action a[data-type="edit"]',
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'wait',
|
|
|
- :value => 1,
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .modal',
|
|
|
- :value => 'note',
|
|
|
- :match_result => true,
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .modal',
|
|
|
- :value => 'some note 123',
|
|
|
- :match_result => true,
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'set',
|
|
|
- :css => '.active .modal [data-name="note"]',
|
|
|
- :value => 'some note abc'
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'click',
|
|
|
- :css => '.active .modal button.js-submit',
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'wait',
|
|
|
- :value => 4,
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .profile-window',
|
|
|
- :value => 'some note abc',
|
|
|
- :match_result => true,
|
|
|
- },
|
|
|
-
|
|
|
- # create new ticket
|
|
|
- {
|
|
|
- :execute => 'create_ticket',
|
|
|
- :group => 'Users',
|
|
|
- :subject => 'user profile check ' + message,
|
|
|
- :body => 'user profile check ' + message,
|
|
|
- },
|
|
|
- {
|
|
|
- :execute => 'wait',
|
|
|
- :value => 4,
|
|
|
- },
|
|
|
-
|
|
|
- # switch to org tab, verify if ticket is shown
|
|
|
- {
|
|
|
- :execute => 'search_user',
|
|
|
- :term => 'Braun',
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- :execute => 'match',
|
|
|
- :css => '.active .profile-window',
|
|
|
- :value => 'user profile check ' + message,
|
|
|
- :match_result => true,
|
|
|
- },
|
|
|
-
|
|
|
- ],
|
|
|
+
|
|
|
+ @browser = browser_instance
|
|
|
+ login(
|
|
|
+ :username => 'master@example.com',
|
|
|
+ :password => 'test',
|
|
|
+ :url => browser_url,
|
|
|
+ )
|
|
|
+ tasks_close_all()
|
|
|
+
|
|
|
+ # search and open user
|
|
|
+ user_open_by_search( :value => 'Braun' )
|
|
|
+
|
|
|
+ watch_for(
|
|
|
+ :css => '.active .profile-window',
|
|
|
+ :value => 'note',
|
|
|
+ )
|
|
|
+ watch_for(
|
|
|
+ :css => '.active .profile-window',
|
|
|
+ :value => 'email',
|
|
|
+ )
|
|
|
+
|
|
|
+ # update note
|
|
|
+ set(
|
|
|
+ :css => '.active [data-name="note"]',
|
|
|
+ :value => 'some note 123',
|
|
|
+ )
|
|
|
+
|
|
|
+ click( :css => '.active .profile' )
|
|
|
+ sleep 2
|
|
|
+
|
|
|
+ # check and change note again in edit screen
|
|
|
+ click( :css => '.active .js-action .select-arrow' )
|
|
|
+ click( :css => '.active .js-action a[data-type="edit"]' )
|
|
|
+
|
|
|
+ watch_for(
|
|
|
+ :css => '.active .modal',
|
|
|
+ :value => 'note',
|
|
|
+ )
|
|
|
+ watch_for(
|
|
|
+ :css => '.active .modal',
|
|
|
+ :value => 'some note 123',
|
|
|
+ )
|
|
|
+
|
|
|
+ set(
|
|
|
+ :css => '.modal [data-name="note"]',
|
|
|
+ :value => 'some note abc',
|
|
|
+ )
|
|
|
+ click( :css => '.active .modal button.js-submit' )
|
|
|
+
|
|
|
+ watch_for(
|
|
|
+ :css => '.active .profile-window',
|
|
|
+ :value => 'some note abc',
|
|
|
+ )
|
|
|
+
|
|
|
+ # create new ticket
|
|
|
+ ticket_create(
|
|
|
+ :data => {
|
|
|
+ :customer => 'nico',
|
|
|
+ :group => 'Users',
|
|
|
+ :title => 'user profile check ' + message,
|
|
|
+ :body => 'user profile check ' + message,
|
|
|
},
|
|
|
- ]
|
|
|
- browser_signle_test_with_login(tests, { :username => 'master@example.com' })
|
|
|
+ )
|
|
|
+ sleep 1
|
|
|
+
|
|
|
+ # switch to org tab, verify if ticket is shown
|
|
|
+ user_open_by_search( :value => 'Braun' )
|
|
|
+ watch_for(
|
|
|
+ :css => '.active .profile-window',
|
|
|
+ :value => 'user profile check ' + message,
|
|
|
+ )
|
|
|
end
|
|
|
end
|