2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2013-02-22 10:36:00 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2013-02-23 22:54:48 +00:00
|
|
|
class AaaGettingStartedTest < TestCase
|
2014-11-18 21:09:01 +00:00
|
|
|
def test_a_getting_started
|
|
|
|
if !ENV['MAILBOX_INIT']
|
2021-07-16 13:44:10 +00:00
|
|
|
# raise "Need MAILBOX_INIT as ENV variable like export MAILBOX_INIT='unittest01@znuny.com:somepass'"
|
2014-12-11 10:44:23 +00:00
|
|
|
puts "NOTICE: Need MAILBOX_INIT as ENV variable like export MAILBOX_INIT='unittest01@znuny.com:somepass'"
|
|
|
|
return
|
2014-11-18 21:09:01 +00:00
|
|
|
end
|
|
|
|
mailbox_user = ENV['MAILBOX_INIT'].split(':')[0]
|
|
|
|
mailbox_password = ENV['MAILBOX_INIT'].split(':')[1]
|
2014-11-16 23:46:39 +00:00
|
|
|
|
2015-03-01 23:16:36 +00:00
|
|
|
@browser = browser_instance
|
2016-03-23 07:24:25 +00:00
|
|
|
location(url: browser_url)
|
2015-03-01 23:16:36 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.setup.wizard',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'setup new system',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: '.js-start .btn--primary')
|
2015-09-29 08:51:15 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.setup.wizard',
|
2015-09-29 08:51:15 +00:00
|
|
|
value: 'admin',
|
|
|
|
)
|
2015-03-01 23:16:36 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-admin input[name="firstname"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Test Master',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-admin input[name="lastname"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Agent',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-admin input[name="email"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'master@example.com',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-admin input[name="firstname"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Test Master',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-admin input[name="password"]',
|
2020-08-28 14:07:30 +00:00
|
|
|
value: 'TEst1234äöüß',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-admin input[name="password_confirm"]',
|
2020-08-28 14:07:30 +00:00
|
|
|
value: 'TEst1234äöüß',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: '.js-admin .btn--success')
|
2013-04-21 23:03:19 +00:00
|
|
|
|
2015-03-01 23:16:36 +00:00
|
|
|
# getting started - base
|
2015-08-28 00:53:14 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-base h2',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Organization',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-base input[name="organization"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Some Organization',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-base input[name="url"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some host',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.js-base .btn--primary',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2020-12-08 14:12:36 +00:00
|
|
|
value: 'An URL looks like this',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-base input[name="url"]',
|
2016-02-01 22:21:47 +00:00
|
|
|
value: browser_url,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.js-base .btn--primary',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2015-08-28 00:53:14 +00:00
|
|
|
|
|
|
|
# getting started - email notification
|
2015-03-01 23:16:36 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-outbound h2',
|
2015-08-28 00:53:14 +00:00
|
|
|
value: 'Email Notification',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
location_check(
|
2015-08-28 00:53:14 +00:00
|
|
|
url: '#getting_started/email_notification',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.js-outbound .btn--primary',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2014-11-16 23:46:39 +00:00
|
|
|
|
2015-03-01 23:16:36 +00:00
|
|
|
# getting started - create email account
|
2015-08-28 00:53:14 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-channel h2',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Connect Channels',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2015-08-28 00:53:14 +00:00
|
|
|
location_check(
|
|
|
|
url: '#getting_started/channel',
|
|
|
|
)
|
2015-03-01 23:16:36 +00:00
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.js-channel .email .provider_name',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-intro input[name="realname"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Some Realname',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-intro input[name="email"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: mailbox_user,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-intro input[name="password"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: mailbox_password,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.js-intro .btn--primary',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
|
|
|
value: 'verify',
|
2015-04-27 13:42:53 +00:00
|
|
|
timeout: 20,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
|
|
|
value: 'invite',
|
2015-04-27 13:42:53 +00:00
|
|
|
timeout: 100,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2014-11-16 23:46:39 +00:00
|
|
|
|
2015-03-01 23:16:36 +00:00
|
|
|
# invite agent1
|
2015-08-28 00:53:14 +00:00
|
|
|
location_check(
|
|
|
|
url: '#getting_started/agents',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2018-09-17 07:01:17 +00:00
|
|
|
watch_for(
|
|
|
|
css: '.js-agent input[name="firstname"]',
|
|
|
|
)
|
2015-03-01 23:16:36 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-agent input[name="firstname"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Agent 1',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-agent input[name="lastname"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Test',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.js-agent input[name="email"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'agent1@example.com',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2016-03-07 06:46:11 +00:00
|
|
|
# not needed since we hide group selections if only one group exists
|
2021-07-16 13:44:10 +00:00
|
|
|
# click(
|
2016-03-07 06:46:11 +00:00
|
|
|
# css: '.js-agent input[name="group_ids"][value="1"]',
|
2021-07-16 13:44:10 +00:00
|
|
|
# )
|
2015-03-01 23:16:36 +00:00
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.js-agent .btn--success',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Invitation sent',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
location_check(
|
2015-04-27 13:42:53 +00:00
|
|
|
url: '#getting_started/agents',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.js-agent .btn--primary',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'My Stats',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
location_check(
|
2016-02-11 02:31:18 +00:00
|
|
|
url: '#clues',
|
2016-05-30 07:09:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
clues_close(
|
|
|
|
optional: false,
|
|
|
|
)
|
|
|
|
|
|
|
|
# verify organization and fqdn
|
|
|
|
click(
|
|
|
|
css: 'a[href="#manage"]',
|
|
|
|
)
|
|
|
|
click(
|
2016-09-27 17:46:23 +00:00
|
|
|
css: '.content.active a[href="#settings/branding"]',
|
2016-05-30 07:09:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active input[name="organization"]',
|
2016-05-30 07:09:07 +00:00
|
|
|
value: 'Some Organization',
|
|
|
|
)
|
|
|
|
click(
|
2016-09-27 17:46:23 +00:00
|
|
|
css: '.content.active a[href="#settings/system"]',
|
2016-05-30 07:09:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
fqdn = nil
|
|
|
|
if browser_url =~ %r{://(.+?)(:.+?|/.+?|)$}
|
|
|
|
fqdn = $1
|
|
|
|
end
|
|
|
|
raise "Unable to get fqdn based on #{browser_url}" if !fqdn
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-05-30 07:09:07 +00:00
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active input[name="fqdn"]',
|
2016-05-30 07:09:07 +00:00
|
|
|
value: fqdn,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2013-02-22 10:36:00 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|