2017-11-23 08:09:44 +00:00
|
|
|
|
2016-03-01 14:12:27 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class FirstStepsTest < TestCase
|
|
|
|
|
|
|
|
def test_basic
|
|
|
|
agent = "bob.smith_#{rand(99_999_999)}"
|
|
|
|
customer = "customer.smith_#{rand(99_999_999)}"
|
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
click(css: '.active.content .tab[data-area="first-steps-widgets"]')
|
2016-03-01 14:12:27 +00:00
|
|
|
watch_for(
|
|
|
|
css: '.active.content',
|
|
|
|
value: 'Configuration',
|
|
|
|
)
|
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
# invite agent (with more then one group)
|
|
|
|
click(css: '.active.content .js-inviteAgent')
|
2018-07-25 07:27:36 +00:00
|
|
|
|
|
|
|
modal_ready()
|
|
|
|
|
2016-03-01 14:12:27 +00:00
|
|
|
set(
|
|
|
|
css: '.modal [name="firstname"]',
|
|
|
|
value: 'Bob',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="lastname"]',
|
|
|
|
value: 'Smith',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="email"]',
|
|
|
|
value: "#{agent}@example.com",
|
|
|
|
)
|
2017-06-16 20:43:09 +00:00
|
|
|
check(css: '.modal .js-groupListItem[value=full]')
|
2016-03-01 14:12:27 +00:00
|
|
|
click(
|
|
|
|
css: '.modal button.btn.btn--primary',
|
2016-03-02 16:26:19 +00:00
|
|
|
fast: true,
|
2016-03-01 14:12:27 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
2016-03-01 14:12:27 +00:00
|
|
|
|
|
|
|
# invite customer
|
2016-03-07 06:46:11 +00:00
|
|
|
click(css: '.active.content .js-inviteCustomer')
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_ready()
|
2016-03-01 14:12:27 +00:00
|
|
|
set(
|
|
|
|
css: '.modal [name="firstname"]',
|
|
|
|
value: 'Client',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="lastname"]',
|
|
|
|
value: 'Smith',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="email"]',
|
|
|
|
value: "#{customer}@example.com",
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [data-name="note"]',
|
|
|
|
value: 'some note',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.modal button.btn.btn--primary',
|
2016-03-02 16:26:19 +00:00
|
|
|
fast: true,
|
2016-03-01 14:12:27 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
2016-03-01 14:12:27 +00:00
|
|
|
|
|
|
|
# test ticket
|
|
|
|
click(
|
|
|
|
css: '.active.content .js-testTicket',
|
2016-03-02 16:26:19 +00:00
|
|
|
fast: true,
|
2016-03-01 14:12:27 +00:00
|
|
|
)
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_ready()
|
2016-03-01 14:12:27 +00:00
|
|
|
watch_for(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'A Test Ticket has been created',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.modal .modal-body',
|
2016-03-02 16:26:19 +00:00
|
|
|
fast: true,
|
2016-03-01 14:12:27 +00:00
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Test Ticket',
|
|
|
|
)
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
|
|
|
|
2016-03-01 14:12:27 +00:00
|
|
|
execute(
|
|
|
|
js: '$(".active.content .sidebar").show()',
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: '.active.content .js-activityContent',
|
|
|
|
value: 'Nicole Braun created Article for Test Ticket!',
|
|
|
|
timeout: 35,
|
|
|
|
)
|
|
|
|
|
|
|
|
# check update
|
2016-03-07 06:46:11 +00:00
|
|
|
click(css: '.active.content a[href="#channels/form"]')
|
2016-03-01 14:12:27 +00:00
|
|
|
sleep 2
|
|
|
|
switch(
|
2016-09-27 17:46:23 +00:00
|
|
|
css: '.content.active .js-formSetting',
|
2016-03-01 14:12:27 +00:00
|
|
|
type: 'on',
|
|
|
|
)
|
2016-03-07 06:46:11 +00:00
|
|
|
click(css: '#navigation a[href="#dashboard"]')
|
2016-03-01 14:12:27 +00:00
|
|
|
hit = false
|
2017-10-01 12:25:52 +00:00
|
|
|
37.times do
|
2016-03-01 14:12:27 +00:00
|
|
|
next if !@browser.find_elements(css: '.active.content a[href="#channels/form"].todo.is-done')[0]
|
|
|
|
hit = true
|
|
|
|
break
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2016-03-01 14:12:27 +00:00
|
|
|
assert(hit)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|