Maintenance: Activated rubocop Style/MethodCallWithoutArgsParentheses.

This commit is contained in:
Thorsten Eckel 2021-07-16 15:29:38 +02:00 committed by Martin Gruner
parent 814f7e997b
commit 5243efbc25
82 changed files with 326 additions and 331 deletions

View file

@ -91,11 +91,6 @@ Layout/LeadingCommentSpace:
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
Enabled: false
Style/MethodCallWithoutArgsParentheses:
Description: 'Do not use parentheses for method calls with no arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
Enabled: false
Layout/SpaceInsideReferenceBrackets:
Description: 'Checks the spacing inside referential brackets.'
Enabled: false

View file

@ -75,7 +75,7 @@ module ApplicationController::RendersModels
def model_destroy_render(object, params)
generic_object = object.find(params[:id])
generic_object.destroy!
model_destroy_render_item()
model_destroy_render_item
end
def model_destroy_render_item()

View file

@ -5,7 +5,7 @@ class PackagesController < ApplicationController
# GET /api/v1/packages
def index
packages = Package.all().order('name')
packages = Package.all.order('name')
render json: {
packages: packages
}

View file

@ -31,7 +31,7 @@ class CommunicateTelegramJob < ApplicationJob
api = TelegramAPI.new(channel.options[:api_token])
chat_id = ticket.preferences[:telegram][:chat_id]
result = api.sendMessage(chat_id, article.body)
me = api.getMe()
me = api.getMe
article.attachments.each do |file|
parts = file.filename.split(%r{^(.*)(\..+?)$})
t = Tempfile.new([parts[1], parts[2]])

View file

@ -118,7 +118,7 @@ example
timeout(check_type_timeout) do
@imap = ::Net::IMAP.new(options[:host], port, ssl, nil, false)
if starttls
@imap.starttls()
@imap.starttls
end
end
@ -232,7 +232,7 @@ example
Rails.logger.info " - verify email #{verify_string} found"
timeout(600) do
@imap.store(message_id, '+FLAGS', [:Deleted])
@imap.expunge()
@imap.expunge
end
disconnect
return {
@ -339,7 +339,7 @@ example
if !keep_on_server
begin
timeout(EXPUNGE_TIMEOUT) do
@imap.expunge()
@imap.expunge
end
rescue Timeout::Error => e
Rails.logger.error "Unable to expunge server (#{options[:host]}/#{options[:user]}): #{e.inspect}"
@ -382,7 +382,7 @@ example
return if !@imap
timeout(1.minute) do
@imap.disconnect()
@imap.disconnect
end
end

View file

@ -118,7 +118,7 @@ returns
permission_ids = Role.permission_ids_by_name(keys)
Role.joins(:permissions_roles).joins(:permissions).where(
'permissions_roles.permission_id IN (?) AND roles.active = ? AND permissions.active = ?', permission_ids, true, true
).distinct()
).distinct
end
=begin
@ -142,7 +142,7 @@ returns
permission_ids = Role.permission_ids_by_name(keys)
return true if Role.joins(:permissions_roles).joins(:permissions).where(
'roles.id = ? AND permissions_roles.permission_id IN (?) AND permissions.active = ?', id, permission_ids, true
).distinct().count.nonzero?
).distinct.count.nonzero?
false
end
@ -192,7 +192,7 @@ returns
def last_admin_check_admin_count
admin_role_ids = Role.joins(:permissions).where(permissions: { name: ['admin', 'admin.user'], active: true }, roles: { active: true }).where.not(id: id).pluck(:id)
User.joins(:roles).where(roles: { id: admin_role_ids }, users: { active: true }).distinct().count
User.joins(:roles).where(roles: { id: admin_role_ids }, users: { active: true }).distinct.count
end
def validate_agent_limit_by_attributes
@ -202,8 +202,8 @@ returns
return true if !with_permission?('ticket.agent')
ticket_agent_role_ids = Role.joins(:permissions).where(permissions: { name: 'ticket.agent', active: true }, roles: { active: true }).pluck(:id)
currents = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct().pluck(:id)
news = User.joins(:roles).where(roles: { id: id }, users: { active: true }).distinct().pluck(:id)
currents = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct.pluck(:id)
news = User.joins(:roles).where(roles: { id: id }, users: { active: true }).distinct.pluck(:id)
count = currents.concat(news).uniq.count
raise Exceptions::UnprocessableEntity, 'Agent limit exceeded, please check your account settings.' if count > Setting.get('system_agent_limit').to_i
@ -218,7 +218,7 @@ returns
ticket_agent_role_ids = Role.joins(:permissions).where(permissions: { name: 'ticket.agent' }, roles: { active: true }).pluck(:id)
ticket_agent_role_ids.push(id)
count = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct().count
count = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct.count
raise Exceptions::UnprocessableEntity, 'Agent limit exceeded, please check your account settings.' if count > Setting.get('system_agent_limit').to_i
true

View file

@ -288,7 +288,7 @@ class Scheduler < ApplicationModel
)
logger.info "execute #{job.method} (try_count #{try_count})..."
eval job.method() # rubocop:disable Security/Eval
eval job.method # rubocop:disable Security/Eval
took = Time.zone.now - started_at
logger.info "ended #{job.method} took: #{took} seconds."
rescue => e

View file

@ -459,7 +459,7 @@ returns
end
next if permission_ids.blank?
Role.joins(:permissions_roles).joins(:permissions).where('permissions_roles.permission_id IN (?) AND roles.active = ? AND permissions.active = ?', permission_ids, true, true).distinct().pluck(:id).each do |role_id|
Role.joins(:permissions_roles).joins(:permissions).where('permissions_roles.permission_id IN (?) AND roles.active = ? AND permissions.active = ?', permission_ids, true, true).distinct.pluck(:id).each do |role_id|
role_ids.push role_id
end
total_role_ids.push role_ids
@ -1058,7 +1058,7 @@ raise 'Minimum one user need to have admin permissions'
def last_admin_check_admin_count
admin_role_ids = Role.joins(:permissions).where(permissions: { name: ['admin', 'admin.user'], active: true }, roles: { active: true }).pluck(:id)
User.joins(:roles).where(roles: { id: admin_role_ids }, users: { active: true }).distinct().count - 1
User.joins(:roles).where(roles: { id: admin_role_ids }, users: { active: true }).distinct.count - 1
end
def validate_agent_limit_by_attributes
@ -1068,7 +1068,7 @@ raise 'Minimum one user need to have admin permissions'
return true if !permissions?('ticket.agent')
ticket_agent_role_ids = Role.joins(:permissions).where(permissions: { name: 'ticket.agent', active: true }, roles: { active: true }).pluck(:id)
count = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct().count + 1
count = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct.count + 1
raise Exceptions::UnprocessableEntity, 'Agent limit exceeded, please check your account settings.' if count > Setting.get('system_agent_limit').to_i
true
@ -1081,7 +1081,7 @@ raise 'Minimum one user need to have admin permissions'
return true if !role.with_permission?('ticket.agent')
ticket_agent_role_ids = Role.joins(:permissions).where(permissions: { name: 'ticket.agent', active: true }, roles: { active: true }).pluck(:id)
count = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct().count
count = User.joins(:roles).where(roles: { id: ticket_agent_role_ids }, users: { active: true }).distinct.count
# if new added role is a ticket.agent role
if ticket_agent_role_ids.include?(role.id)

View file

@ -6,7 +6,7 @@ class Auth
def valid?(user, password)
return false if !Setting.get('ldap_integration')
ldap_user = ::Ldap::User.new()
ldap_user = ::Ldap::User.new
# get from config or fallback to login
# for a list of user attributes which should

View file

@ -64,7 +64,7 @@ class Ldap
# @return [true] Returns always true
def search(filter, base: nil, scope: nil, attributes: nil, &block)
base ||= base_dn()
base ||= base_dn
scope ||= Net::LDAP::SearchScope_WholeSubtree
connection.search(

View file

@ -15,7 +15,7 @@ check token and return bot attributes of token
def self.check_token(token)
api = TelegramAPI.new(token)
begin
bot = api.getMe()
bot = api.getMe
rescue
raise Exceptions::UnprocessableEntity, 'invalid api token'
end

View file

@ -22,7 +22,7 @@ RSpec.describe MigrateLdapSamaccountnameToUidJob, type: :job do
}
allow(Import::Ldap).to receive(:config).and_return(ldap_config)
ldap_user = double()
ldap_user = double
allow(ldap_user).to receive(:uid_attribute).and_return('samaccountname')
allow(::Ldap::User).to receive(:new).and_return(ldap_user)
@ -49,7 +49,7 @@ RSpec.describe MigrateLdapSamaccountnameToUidJob, type: :job do
allow(Import::Ldap).to receive(:config).and_return(ldap_config_obsolete)
ldap_user = double()
ldap_user = double
allow(ldap_user).to receive(:uid_attribute).and_return('objectguid')
allow(::Ldap::User).to receive(:new).and_return(ldap_user)

View file

@ -14,7 +14,7 @@ RSpec.describe TriggerWebhookJob::RecordPayload do
let(:backend) { TriggerWebhookJob::RecordPayload::Ticket }
it 'initializes backend instance and sends generate' do
instance = double()
instance = double
allow(instance).to receive(:generate)
allow(backend).to receive(:new).and_return(instance)

View file

@ -24,7 +24,7 @@ end
RSpec.shared_examples 'Import::BaseFactory extender' do
it 'calls new on determined backend object' do
record = double()
record = double
allow(described_class).to receive(:backend_class).and_return(Class)
allow(Class).to receive(:new)

View file

@ -38,7 +38,7 @@ RSpec.describe Import::Base do
it 'returns false by default' do
import_job = create(:import_job)
instance = described_class.new(import_job)
delayed_job = double()
delayed_job = double
expect(instance.reschedule?(delayed_job)).to be false
end

View file

@ -95,7 +95,7 @@ RSpec.describe Import::Ldap, sequencer: :caller do
it 'initiates always a rescheduling' do
import_job = create(:import_job)
instance = described_class.new(import_job)
delayed_job = double()
delayed_job = double
expect(instance.reschedule?(delayed_job)).to be true
end
@ -103,7 +103,7 @@ RSpec.describe Import::Ldap, sequencer: :caller do
it 'updates the result with an info text' do
import_job = create(:import_job)
instance = described_class.new(import_job)
delayed_job = double()
delayed_job = double
expect do
instance.reschedule?(delayed_job)

View file

@ -45,7 +45,7 @@ RSpec.describe Import::OTRS::Article::AttachmentFactory do
end
it 'deletes old and reimports' do
dummy_attachment = double()
dummy_attachment = double
expect(dummy_attachment).to receive(:delete)
article_attachment_expectations([dummy_attachment])
import_expectations

View file

@ -19,8 +19,8 @@ RSpec.describe Import::OTRS::Requester do
context 'caching request results' do
let(:response) do
response = double()
response_body = double()
response = double
response_body = double
allow(response_body).to receive(:to_s).at_least(:once).and_return('{"Result": {}}')
allow(response).to receive('success?').at_least(:once).and_return(true)
allow(response).to receive('body').at_least(:once).and_return(response_body)

View file

@ -10,7 +10,7 @@ RSpec.describe Ldap::Group do
# required as 'let' to perform test based
# expectations and reuse it in 'let' instance
# as additional parameter
let(:mocked_ldap) { double() }
let(:mocked_ldap) { double }
describe '.uid_attribute' do

View file

@ -30,7 +30,7 @@ RSpec.describe Ldap::Guid do
end
it 'tunnels to instance method' do
instance = double()
instance = double
allow(instance).to receive(:hex)
allow(described_class).to receive(:new).with(string).and_return(instance)
@ -48,7 +48,7 @@ RSpec.describe Ldap::Guid do
it 'tunnels to instance method' do
instance = double()
instance = double
allow(instance).to receive(:string)
allow(described_class).to receive(:new).with(hex).and_return(instance)

View file

@ -8,7 +8,7 @@ require 'tcr/net/ldap'
RSpec.describe Ldap::User do
let(:mocked_ldap) { double() }
let(:mocked_ldap) { double }
describe '.uid_attribute' do
@ -71,7 +71,7 @@ RSpec.describe Ldap::User do
it 'creates own Ldap instance if none given' do
expect(Ldap).to receive(:new)
described_class.new()
described_class.new
end
end
@ -95,7 +95,7 @@ RSpec.describe Ldap::User do
end
it 'validates username and password' do
connection = double()
connection = double
allow(mocked_ldap).to receive(:connection).and_return(connection)
build(:ldap_entry)
@ -107,7 +107,7 @@ RSpec.describe Ldap::User do
end
it 'fails for invalid credentials' do
connection = double()
connection = double
allow(mocked_ldap).to receive(:connection).and_return(connection)
build(:ldap_entry)

View file

@ -14,7 +14,7 @@ RSpec.describe Sequencer::Unit::Import::Zendesk::Ticket::Comment::Attachment::Re
}
end
let(:response) { double() }
let(:response) { double }
it 'open timeout should be 20s and read timeout should be 240s' do
allow(response).to receive(:success?).and_return(true)

View file

@ -248,7 +248,7 @@ RSpec.describe ImportJob do
it 'returns false for already finished jobs' do
instance = create(:import_job)
delayed_job = double()
delayed_job = double
instance.update!(finished_at: Time.zone.now)
@ -257,14 +257,14 @@ RSpec.describe ImportJob do
it 'returns false for backends not responding to reschedule?' do
instance = create(:import_job)
delayed_job = double()
delayed_job = double
expect(instance.reschedule?(delayed_job)).to be false
end
it 'returns the backend reschedule? value' do
instance = create(:import_job, name: 'Import::NoRescheduleMethod')
delayed_job = double()
delayed_job = double
expect(instance.reschedule?(delayed_job)).to eq 'invalid_but_checkable_result'
end

View file

@ -9,7 +9,7 @@ RSpec.describe Session, type: :model do
subject(:session) { described_class.create( session_id: SecureRandom.urlsafe_base64(64), data: {} ) }
it 'does not set the persistent attribute' do
expect(session.persistent).to be_nil()
expect(session.persistent).to be_nil
end
end
@ -26,7 +26,7 @@ RSpec.describe Session, type: :model do
subject(:session) { described_class.create( session_id: SecureRandom.urlsafe_base64(64), data: { 'persistent' => false }) }
it 'does not set the persistent attribute' do
expect(session.persistent).to be_nil()
expect(session.persistent).to be_nil
end
end
end

View file

@ -36,7 +36,7 @@ RSpec.describe Tag, type: :request do
it "found 0 tags using search term '#{search_term}'" do
get '/api/v1/tag_search', params: { term: search_term }
expect(response).to have_http_status(:ok)
expect(json_response).to contain_exactly()
expect(json_response).to contain_exactly
end
end

View file

@ -13,7 +13,7 @@ class AgentTicketActionLevel0Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create new ticket
ticket_create(
@ -35,7 +35,7 @@ class AgentTicketActionLevel0Test < TestCase
},
)
tasks_close_all()
tasks_close_all
# invite agent (with one group)
click(css: '#navigation a[href="#dashboard"]')
@ -45,7 +45,7 @@ class AgentTicketActionLevel0Test < TestCase
value: 'Configuration',
)
click(css: '.active.content .js-inviteAgent')
modal_ready()
modal_ready
set(
css: '.modal [name="firstname"]',
value: 'Bob',
@ -85,7 +85,7 @@ class AgentTicketActionLevel0Test < TestCase
value: 'Configuration',
)
click(css: '.active.content .js-inviteAgent')
modal_ready()
modal_ready
set(
css: '.modal [name="firstname"]',
value: 'Bob2',
@ -138,7 +138,7 @@ class AgentTicketActionLevel0Test < TestCase
value: 'Sending',
)
tasks_close_all()
tasks_close_all
end
@ -198,7 +198,7 @@ class AgentTicketActionLevel0Test < TestCase
value: 'one group - some body 1234 äöüß',
)
tasks_close_all()
tasks_close_all
end
@ -210,7 +210,7 @@ class AgentTicketActionLevel0Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
group_create(
data: {
@ -250,7 +250,7 @@ class AgentTicketActionLevel0Test < TestCase
},
)
tasks_close_all()
tasks_close_all
end

View file

@ -10,7 +10,7 @@ class AdminCalendarSlaTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
calendar_name = "ZZZ some calendar #{rand(99_999_999)}"
sla_name = "ZZZ some sla #{rand(99_999_999)}"
@ -41,7 +41,7 @@ class AdminCalendarSlaTest < TestCase
timeout: 4,
)
logout()
logout
login(
username: 'master@example.com',
@ -71,7 +71,7 @@ class AdminCalendarSlaTest < TestCase
value: timezone_verify,
timeout: 4,
)
modal_close()
modal_close
sla_create(
data: {

View file

@ -19,7 +19,7 @@ class AdminChannelEmailTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#manage"]')
click(css: '.content.active a[href="#channels/email"]')
@ -41,7 +41,7 @@ class AdminChannelEmailTest < TestCase
click(css: '.content.active a[href="#c-account"]')
click(css: '.content.active .js-channelNew')
modal_ready()
modal_ready
set(
css: '.modal input[name="realname"]',
value: 'My System',
@ -82,7 +82,7 @@ class AdminChannelEmailTest < TestCase
# re-create
click(css: '.content.active .js-channelNew')
modal_ready()
modal_ready
set(
css: '.modal input[name="realname"]',
@ -111,7 +111,7 @@ class AdminChannelEmailTest < TestCase
# set invalid folder
click(css: '.content.active .js-editInbound')
modal_ready()
modal_ready
set(
css: '.modal input[name="options::folder"]',
@ -136,7 +136,7 @@ class AdminChannelEmailTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#manage"]')
click(css: '.content.active a[href="#channels/email"]')
@ -146,7 +146,7 @@ class AdminChannelEmailTest < TestCase
# create a new email filter
click(css: '.content.active a[data-type="new"]')
modal_ready()
modal_ready
set(
css: '.modal input[name="name"]',
value: filter_name,
@ -156,7 +156,7 @@ class AdminChannelEmailTest < TestCase
value: 'target',
)
click(css: '.modal .js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .table',
@ -167,9 +167,9 @@ class AdminChannelEmailTest < TestCase
click(css: '.content.active .table .dropdown .btn--table')
click(css: '.content.active .table .dropdown .js-clone')
modal_ready()
modal_ready
click(css: '.modal .js-submit')
modal_disappear()
modal_disappear
# confirm the clone exists in the table
watch_for(

View file

@ -12,7 +12,7 @@ class AdminObjectManagerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# already existing
object_manager_attribute_create(
@ -165,7 +165,7 @@ class AdminObjectManagerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
object_manager_attribute_create(
data: {
@ -389,7 +389,7 @@ class AdminObjectManagerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# valid name
object_manager_attribute_create(
@ -499,7 +499,7 @@ class AdminObjectManagerTest < TestCase
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create two new attributes
object_manager_attribute_create(
@ -595,7 +595,7 @@ class AdminObjectManagerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# lexicographically ordered list of option strings
options = %w[0 000.000 1 100.100 100.200 2 200.100 200.200 3 ä b n ö p sr ß st t ü v]
@ -684,7 +684,7 @@ class AdminObjectManagerTest < TestCase
options_no_dog = options.except('dog')
options_no_dog_no_delete = options_no_dog.except('delete')
tasks_close_all()
tasks_close_all
object_manager_attribute_create(
data: {
@ -788,7 +788,7 @@ class AdminObjectManagerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
object_manager_attribute_create(
data: {
@ -864,7 +864,7 @@ class AdminObjectManagerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
object_manager_attribute_create(
data: {

View file

@ -12,7 +12,7 @@ class AdminObjectManagerTreeSelectTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
object_manager_attribute_create(
data: {
@ -126,7 +126,7 @@ class AdminObjectManagerTreeSelectTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
object_manager_attribute_create(
data: {

View file

@ -12,7 +12,7 @@ class AdminOverviewTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# add new overview
overview_create(
@ -49,7 +49,7 @@ class AdminOverviewTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_create(
data: {
@ -135,7 +135,7 @@ class AdminOverviewTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
out_of_office_css = '.content.active .modal select[name="out_of_office"]'
first_overview_css = '.content.active tr[data-id="1"] td'

View file

@ -11,7 +11,7 @@ class AdminPermissionsGranularVsFullTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#manage"]')
click(css: '.content.active a[href="#manage/groups"]')

View file

@ -10,7 +10,7 @@ class AdminRoleTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
rand = rand(99_999_999).to_s
login = "agent-role-#{rand}"
@ -42,14 +42,14 @@ class AdminRoleTest < TestCase
}
)
logout()
logout
# flanky
login(
username: email,
password: password,
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
match(
@ -77,7 +77,7 @@ class AdminRoleTest < TestCase
value: 'Devices',
)
logout()
logout
login(
username: 'master@example.com',
password: 'test',
@ -90,13 +90,13 @@ class AdminRoleTest < TestCase
}
)
logout()
logout
login(
username: email,
password: password,
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
match(
@ -137,7 +137,7 @@ class AdminRoleTest < TestCase
# check if admin exists
exists_not(css: '[href="#manage"]')
logout()
logout
# add admin.user to agent role
login(
@ -145,7 +145,7 @@ class AdminRoleTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
role_edit(
data: {
@ -160,7 +160,7 @@ class AdminRoleTest < TestCase
},
}
)
logout()
logout
# check if admin exists
login(
@ -168,7 +168,7 @@ class AdminRoleTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create user
random = rand(999_999_999)
@ -194,13 +194,13 @@ class AdminRoleTest < TestCase
)
# revoke admin.user
logout()
logout
login(
username: 'master@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
role_edit(
data: {
@ -215,7 +215,7 @@ class AdminRoleTest < TestCase
},
}
)
logout()
logout
login(
username: 'agent1@example.com',
@ -238,7 +238,7 @@ class AdminRoleTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
role_create(
data: {

View file

@ -10,7 +10,7 @@ class AgentNavigationAndTitleTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# since we run the basic functionality tests via Capybara now the clues are shown
# and closed after the login. This unfortunately removes the 'is-active' class from the
@ -18,7 +18,7 @@ class AgentNavigationAndTitleTest < TestCase
# Because the browser tests are deprecated and there is no easy fix to change the
# behavior we refresh the page and wait for it to finish loading the app as a workaround.
# This will cause the 'is-active' class to be set on the menu item again
reload()
reload
sleep 4
# dashboard after login
@ -32,7 +32,7 @@ class AgentNavigationAndTitleTest < TestCase
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
exists_not(css: '#navigation .tasks .js-item.is-active')
reload()
reload
sleep 2
verify_title(value: 'dashboard')
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
@ -67,7 +67,7 @@ class AgentNavigationAndTitleTest < TestCase
)
exists_not(css: '#navigation .js-menu .is-active')
reload()
reload
sleep 2
verify_title(value: 'Call Inbound')
verify_task(
@ -105,7 +105,7 @@ class AgentNavigationAndTitleTest < TestCase
)
exists_not(css: '#navigation .js-menu .is-active')
reload()
reload
sleep 2
verify_title(value: 'ticket create #2')
verify_task(
@ -127,7 +127,7 @@ class AgentNavigationAndTitleTest < TestCase
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
exists_not(css: '#navigation .tasks .js-item.is-active')
reload()
reload
sleep 2
verify_title(value: 'dashboard')
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
@ -151,7 +151,7 @@ class AgentNavigationAndTitleTest < TestCase
exists_not(css: '#navigation .js-menu .is-active')
exists_not(css: '#navigation .tasks .js-item.is-active')
reload()
reload
sleep 2
verify_title(value: 'Users')
exists_not(css: '#navigation .js-menu .is-active')

View file

@ -14,7 +14,7 @@ class AgentOrganizationProfileTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# search and open org
organization_open_by_search(
@ -41,14 +41,14 @@ class AgentOrganizationProfileTest < TestCase
css: '.active .profile [data-name="note"]',
value: note,
)
empty_search()
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()
modal_ready
watch_for(
css: '.active .modal',
value: note,
@ -63,7 +63,7 @@ class AgentOrganizationProfileTest < TestCase
value: 'some note abc',
)
click(css: '.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.active .profile-window',
@ -80,13 +80,13 @@ class AgentOrganizationProfileTest < TestCase
click(css: '.active .js-action .icon-arrow-down', fast: true)
click(css: '.active .js-action [data-type="edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="name"]',
value: 'Zammad Foundation',
)
click(css: '.active .modal button.js-submit')
modal_disappear()
modal_disappear
verify_task(
data: {
@ -112,7 +112,7 @@ class AgentOrganizationProfileTest < TestCase
css: '.active .profile-window',
value: "org profile check #{message}",
)
tasks_close_all()
tasks_close_all
# work with two browser windows
message = "comment 1 #{rand(99_999_999_999_999_999)}"
@ -166,7 +166,7 @@ class AgentOrganizationProfileTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# search and open org
organization_open_by_search(
@ -192,7 +192,7 @@ class AgentOrganizationProfileTest < TestCase
click(
css: '.active .profile-window .dropdown li[data-type="edit"]',
)
modal_ready()
modal_ready
select(
css: '.active .modal select[name="active"]',
@ -203,7 +203,7 @@ class AgentOrganizationProfileTest < TestCase
css: '.modal .js-submit',
)
modal_disappear()
modal_disappear
# go back to the org and check for inactive status update
click(
@ -224,7 +224,7 @@ class AgentOrganizationProfileTest < TestCase
click(
css: '.active .profile-window .dropdown li[data-type="edit"]',
)
modal_ready()
modal_ready
select(
css: '.active .modal select[name="active"]',
@ -235,7 +235,7 @@ class AgentOrganizationProfileTest < TestCase
css: '.modal .js-submit',
)
modal_disappear()
modal_disappear
# go back to the org and check for active status update
click(

View file

@ -11,7 +11,7 @@ class AgentTicketAttachmentTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
#
# attachment checks - new ticket
@ -147,13 +147,13 @@ class AgentTicketAttachmentTest < TestCase
click(css: '.content.active .js-submit')
# check warning
modal_ready()
modal_ready
match(
css: '.content.active .modal',
value: 'missing',
)
click(css: '.content.active .modal .js-cancel')
modal_disappear()
modal_disappear
ticket_update(
data: {
@ -298,7 +298,7 @@ class AgentTicketAttachmentTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_create(
data: {

View file

@ -13,7 +13,7 @@ class AgentticketCreateAttachmentMissingAfterReloadTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
#
# attachment checks - new ticket

View file

@ -13,7 +13,7 @@ class AgentTicketCreateAvailableTypesTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(
css: 'a[href="#ticket/create"]'
@ -31,7 +31,7 @@ class AgentTicketCreateAvailableTypesTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
@browser.execute_script("App.Config.set('ui_ticket_create_default_type', 'email-out')")

View file

@ -16,7 +16,7 @@ class AgentTicketCreateCcTokenizerTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(
css: 'a[href="#ticket/create"]'

View file

@ -13,7 +13,7 @@ class AgentTicketCreateDefaultTypeTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(
css: 'a[href="#ticket/create"]'
@ -39,7 +39,7 @@ class AgentTicketCreateDefaultTypeTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
@browser.execute_script("App.Config.set('ui_ticket_create_available_types', ['email-out', 'phone-out'])")
@ -67,7 +67,7 @@ class AgentTicketCreateDefaultTypeTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
@browser.execute_script("App.Config.set('ui_ticket_create_available_types', ['email-out'])")

View file

@ -10,7 +10,7 @@ class AgentTicketCreateResetCustomerSelectionTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#new"]', only_if_exists: true)
click(css: 'a[href="#ticket/create"]')
@ -84,7 +84,7 @@ class AgentTicketCreateResetCustomerSelectionTest < TestCase
)
# cleanup
tasks_close_all()
tasks_close_all
end
def test_clear_customer_use_email
@ -94,7 +94,7 @@ class AgentTicketCreateResetCustomerSelectionTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#new"]', only_if_exists: true)
click(css: 'a[href="#ticket/create"]')
@ -178,7 +178,7 @@ class AgentTicketCreateResetCustomerSelectionTest < TestCase
click(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"] .js-actions')
click(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"] .js-actions li[data-type="customer-change"]')
modal_ready()
modal_ready
exists_not(
css: '.content.active .modal .user_autocompletion.form-group.has-error',
@ -246,6 +246,6 @@ class AgentTicketCreateResetCustomerSelectionTest < TestCase
)
# cleanup
tasks_close_all()
tasks_close_all
end
end

View file

@ -15,7 +15,7 @@ class AgentTicketCreateTemplateTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(
css: 'a[href="#ticket/create"]'
@ -74,7 +74,7 @@ class AgentTicketCreateTemplateTest < TestCase
)
# apply new tempalte
tasks_close_all()
tasks_close_all
click(
css: 'a[href="#ticket/create"]'
)

View file

@ -12,7 +12,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create new ticket
ticket_create(
@ -87,7 +87,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
css: '.content.active .js-settingContainer .js-setting',
)
click(css: '.content.active .js-settingContainer .js-setting')
modal_ready()
modal_ready
select(
css: params[:css],
value: params[:value]
@ -95,8 +95,8 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
click(
css: params[:submit_css],
)
modal_close()
modal_disappear()
modal_close
modal_disappear
end
def test_full_quote
@ -106,7 +106,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_open_by_title(
title: 'Welcome to Zammad',
@ -141,7 +141,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
assert Time.zone.parse(match[1])
# try again, but with the full quote header disabled
tasks_close_all()
tasks_close_all
ticket_open_by_title(
title: 'Welcome to Zammad',
)
@ -163,7 +163,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
assert_nil match
# after test, turn full quote header back on again
tasks_close_all()
tasks_close_all
ticket_open_by_title(
title: 'Welcome to Zammad',
)
@ -182,7 +182,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_open_by_title(
title: 'Welcome to Zammad',

View file

@ -20,7 +20,7 @@ class AgentTicketEmailSignatureTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
#
# create groups and signatures
@ -83,7 +83,7 @@ class AgentTicketEmailSignatureTest < TestCase
#
# reload instances to get new group permissions
reload()
reload
# create ticket
ticket_create(

View file

@ -11,7 +11,7 @@ class AgentTicketLinkTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket1 = ticket_create(
data: {
@ -48,7 +48,7 @@ class AgentTicketLinkTest < TestCase
css: '.content.active .js-links .js-add',
)
modal_ready()
modal_ready
set(
css: '.content.active .modal-body [name="ticket_number"]',
@ -73,7 +73,7 @@ class AgentTicketLinkTest < TestCase
value: ticket2[:title],
)
reload()
reload
watch_for(
css: '.content.active .ticketLinks',
@ -92,7 +92,7 @@ class AgentTicketLinkTest < TestCase
value: ticket2[:title],
)
reload()
reload
watch_for_disappear(
css: '.content.active .ticketLinks',
@ -118,7 +118,7 @@ class AgentTicketLinkTest < TestCase
}
)
tasks_close_all()
tasks_close_all
ticket_open_by_search(
browser: browser2,

View file

@ -11,7 +11,7 @@ class AgentTicketMacroTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket = ticket_create(
data: {
@ -49,7 +49,7 @@ class AgentTicketMacroTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ux_flow_next_up = 'Stay on tab'
macro_name = "Test #{ux_flow_next_up}"
@ -94,7 +94,7 @@ class AgentTicketMacroTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ux_flow_next_up = 'Close tab'
macro_name = "Test #{ux_flow_next_up}"
@ -127,7 +127,7 @@ class AgentTicketMacroTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ux_flow_next_up = 'Advance to next ticket from overview'
macro_name = "Test #{ux_flow_next_up}"
@ -158,7 +158,7 @@ class AgentTicketMacroTest < TestCase
# we need to close all open ticket tasks because
# otherwise the Zoom view won't change in "Overview"-mode
# when we re-enter the Zoom view for a ticket via the overview
tasks_close_all()
tasks_close_all
overview_open(
link: '#ticket/view/all_unassigned',

View file

@ -12,7 +12,7 @@ class AgentTicketMergeTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create new ticket
ticket1 = ticket_create(
@ -32,7 +32,7 @@ class AgentTicketMergeTest < TestCase
},
)
tasks_close_all()
tasks_close_all
# create second ticket to merge
ticket_create(
@ -60,7 +60,7 @@ class AgentTicketMergeTest < TestCase
click( css: '.active div[data-tab="ticket"] .js-actions .icon-arrow-down' )
click( css: '.active div[data-tab="ticket"] .js-actions [data-type="ticket-merge"]' )
modal_ready()
modal_ready
set(
css: '.modal input[name="target_ticket_number"]',
value: ticket1[:number],
@ -89,7 +89,7 @@ class AgentTicketMergeTest < TestCase
)
# close task/cleanup
tasks_close_all()
tasks_close_all
# merge ticket with open tabs
ticket3 = ticket_create(
@ -114,7 +114,7 @@ class AgentTicketMergeTest < TestCase
click( css: '.active div[data-tab="ticket"] .js-actions .icon-arrow-down' )
click( css: '.active div[data-tab="ticket"] .js-actions [data-type="ticket-merge"]' )
modal_ready()
modal_ready
set(
css: '.modal input[name="target_ticket_number"]',
value: ticket3[:number],

View file

@ -12,7 +12,7 @@ class AgentTicketOnlineNotificationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create new ticket
ticket_create(
@ -246,7 +246,7 @@ class AgentTicketOnlineNotificationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
browser2 = browser_instance
login(

View file

@ -20,7 +20,7 @@ class AgentTicketOverviewGroupByOrganizationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# 1. Create a new test organization with special characters in its name
organization_create(

View file

@ -10,7 +10,7 @@ class AgentTicketOverviewLevel0Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# test bulk action
@ -68,7 +68,7 @@ class AgentTicketOverviewLevel0Test < TestCase
)
# remember current overview count
overview_counter_before = overview_counter()
overview_counter_before = overview_counter
# select close state & submit
select(
@ -96,12 +96,12 @@ class AgentTicketOverviewLevel0Test < TestCase
# remember current overview count
await_overview_counter(view: '#ticket/view/all_unassigned', count: overview_counter_before['#ticket/view/all_unassigned'] - 2)
overview_counter_before = overview_counter()
overview_counter_before = overview_counter
# click options and enable number and article count
click(css: '.content.active [data-type="settings"]')
modal_ready()
modal_ready
check(
css: '.modal input[value="number"]',
@ -139,7 +139,7 @@ class AgentTicketOverviewLevel0Test < TestCase
)
# reload browser
reload()
reload
sleep 4
# check if number and article count is shown
@ -159,7 +159,7 @@ class AgentTicketOverviewLevel0Test < TestCase
# disable number and article count
click(css: '.content.active [data-type="settings"]')
modal_ready()
modal_ready
uncheck(
css: '.modal input[value="number"]',
@ -213,7 +213,7 @@ class AgentTicketOverviewLevel0Test < TestCase
await_overview_counter(view: '#ticket/view/all_unassigned', count: overview_counter_before['#ticket/view/all_unassigned'])
# cleanup
tasks_close_all()
tasks_close_all
end
def test_bulk_pending
@ -223,7 +223,7 @@ class AgentTicketOverviewLevel0Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# test bulk action
@ -259,7 +259,7 @@ class AgentTicketOverviewLevel0Test < TestCase
)
# remember current overview count
overview_counter_before = overview_counter()
overview_counter_before = overview_counter
# select both via bulk action
click(
@ -363,7 +363,7 @@ class AgentTicketOverviewLevel0Test < TestCase
)
# cleanup
tasks_close_all()
tasks_close_all
end
# verify correct behaviour for issue #1864 - Bulk-Action: Not possible to change owner
@ -374,7 +374,7 @@ class AgentTicketOverviewLevel0Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# test bulk action
@ -407,7 +407,7 @@ class AgentTicketOverviewLevel0Test < TestCase
)
# remember current overview count
overview_counter_before = overview_counter()
overview_counter_before = overview_counter
# select both via bulk action
click(
@ -465,7 +465,7 @@ class AgentTicketOverviewLevel0Test < TestCase
await_overview_counter(view: '#ticket/view/all_unassigned', count: overview_counter_before['#ticket/view/all_unassigned'] - 2)
# cleanup
tasks_close_all()
tasks_close_all
end
# verify fix for issue #2026 - Bulk action should not be shown if user has no change permissions
@ -476,7 +476,7 @@ class AgentTicketOverviewLevel0Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create new group
group_create(
@ -531,13 +531,13 @@ class AgentTicketOverviewLevel0Test < TestCase
}
)
logout() # logout as master@example.com then login as agent2@example.com
logout # logout as master@example.com then login as agent2@example.com
login(
username: 'agent2@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# open Overview menu tab
click(
@ -611,14 +611,14 @@ class AgentTicketOverviewLevel0Test < TestCase
)
# cleanup
tasks_close_all()
logout() # logout as agent2@example.com and then login as master@example.com to clean up tickets
tasks_close_all
logout # logout as agent2@example.com and then login as master@example.com to clean up tickets
login(
username: 'master@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# open ticket by search
ticket_open_by_search(

View file

@ -14,7 +14,7 @@ class AgentTicketOverviewPendingTil < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create 4 tickets, 2 with pending til data and 2 without
tickets = []

View file

@ -24,7 +24,7 @@ class AgentTicketOverviewTabTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
title = "test #{rand(9_999_999)}"
@ -53,7 +53,7 @@ class AgentTicketOverviewTabTest < TestCase
body: "overview tab test #3 - #{title}",
}
)
tasks_close_all()
tasks_close_all
#click(text: 'Overviews')
# enable full overviews
@ -97,6 +97,6 @@ class AgentTicketOverviewTabTest < TestCase
task_count_equals(0)
# cleanup
tasks_close_all()
tasks_close_all
end
end

View file

@ -10,7 +10,7 @@ class AgentTicketTagTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# set tag (by tab)
ticket_create(
@ -31,7 +31,7 @@ class AgentTicketTagTest < TestCase
# reload browser
sleep 6
reload()
reload
sleep 2
click(
@ -188,7 +188,7 @@ class AgentTicketTagTest < TestCase
)
# reload browser
reload()
reload
sleep 2
# verify tags
@ -369,7 +369,7 @@ class AgentTicketTagTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#manage"]')
click(css: '.content.active a[href="#manage/tags"]')
@ -510,7 +510,7 @@ class AgentTicketTagTest < TestCase
'NOT EXISTING' => false,
}
)
reload()
reload
sleep 2
# verify tags

View file

@ -12,7 +12,7 @@ class AgentTicketTaskChangedTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_create(
data: {
@ -37,7 +37,7 @@ class AgentTicketTaskChangedTest < TestCase
# verify the 'Discard your changes' message does not appear (since there are no changes)
assert_nil execute(js: "return $('.content.active .js-attributeBar .js-reset:not(\".hide\")').get(0)")
tasks_close_all()
tasks_close_all
sleep 0.5
exists_not( css: '.modal')

View file

@ -13,7 +13,7 @@ class AgentTicketTextModuleTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create new text modules
text_module_create(
@ -54,7 +54,7 @@ class AgentTicketTextModuleTest < TestCase
css: '.active div[data-name=body]',
value: "some content#{random}",
)
tasks_close_all()
tasks_close_all
# test with two browser windows
random = "text_II_module_test_#{rand(99_999_999)}"

View file

@ -10,7 +10,7 @@ class AgentTicketTimeAccountingTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# enable time accounting
click(
@ -42,7 +42,7 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.active .js-submit',
)
modal_ready()
modal_ready
set(
css: '.content.active .modal [name=time_unit]',
value: '4',
@ -50,7 +50,7 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.content.active .modal .js-submit',
)
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .js-timeUnit',
@ -75,7 +75,7 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.active .js-submit',
)
modal_ready()
modal_ready
set(
css: '.content.active .modal [name=time_unit]',
value: '4,6',
@ -83,7 +83,7 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.content.active .modal .js-submit',
)
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .js-timeUnit',
@ -100,7 +100,7 @@ class AgentTicketTimeAccountingTest < TestCase
css: '.active .js-submit',
)
modal_ready()
modal_ready
set(
css: '.content.active .modal [name=time_unit]',
value: '4abc',
@ -118,7 +118,7 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.content.active .modal .js-submit',
)
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .js-timeUnit',
value: '8.6',
@ -139,7 +139,7 @@ class AgentTicketTimeAccountingTest < TestCase
# make sure "off" AJAX request gets completed
# otherwise following tests might fail because
# off still active timeaccounting
logout()
logout
end
def test_closing_time_accounting_modal_by_clicking_background
@ -149,7 +149,7 @@ class AgentTicketTimeAccountingTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# enable time accounting
click(
@ -181,18 +181,18 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.active .js-submit',
)
modal_ready()
modal_ready
# Click outside the modal to make it disappear
execute(
js: 'document.elementFromPoint(300, 100).click();',
)
modal_disappear()
modal_disappear
click(
css: '.active .js-submit',
)
modal_ready()
modal_ready
set(
css: '.content.active .modal [name=time_unit]',
value: '4',
@ -200,7 +200,7 @@ class AgentTicketTimeAccountingTest < TestCase
click(
css: '.content.active .modal .js-submit',
)
modal_disappear()
modal_disappear
# disable time accounting
click(
@ -217,6 +217,6 @@ class AgentTicketTimeAccountingTest < TestCase
# make sure "off" AJAX request gets completed
# otherwise following tests might fail because
# off still active timeaccounting
logout()
logout
end
end

View file

@ -10,7 +10,7 @@ class AgentTicketUpdate1Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# confirm on create
ticket_create(

View file

@ -12,7 +12,7 @@ class AgentTicketUpdate4Test < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# date object
object_manager_attribute_create(

View file

@ -11,7 +11,7 @@ class AgentTicketUpdateAndReloadTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create ticket
ticket_create(
@ -45,7 +45,7 @@ class AgentTicketUpdateAndReloadTest < TestCase
)
# reload instances, verify autosave
reload()
reload
# check if customer is still shown in sidebar
click(css: '.active .tabsSidebar-tab[data-tab="customer"]')
@ -95,7 +95,7 @@ class AgentTicketUpdateAndReloadTest < TestCase
)
# reload
reload()
reload
sleep 4
# check task title
@ -122,7 +122,7 @@ class AgentTicketUpdateAndReloadTest < TestCase
)
# reload
reload()
reload
sleep 5
# check page title
@ -131,6 +131,6 @@ class AgentTicketUpdateAndReloadTest < TestCase
)
# cleanup
tasks_close_all()
tasks_close_all
end
end

View file

@ -54,14 +54,14 @@ class AgentTicketZoomHideTest < TestCase
css: '.attachment-icon img',
)
modal_ready()
modal_ready
# Now go to a previous ticket and confirm that the modal disappears
location(
url: "#{browser_url}/#ticket/zoom/1",
)
sleep 2
modal_disappear()
modal_disappear
end
def teardown

View file

@ -16,7 +16,7 @@ class AgentUserManageTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# create customer
click(css: 'a[href="#new"]', only_if_exists: true)
@ -37,7 +37,7 @@ class AgentUserManageTest < TestCase
sleep 0.5
click(css: '.content.active .newTicket .recipientList-entry.js-objectNew')
modal_ready()
modal_ready
set(
css: '.content.active .modal input[name="firstname"]',
value: firstname,
@ -52,7 +52,7 @@ class AgentUserManageTest < TestCase
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
sleep 4
@ -80,7 +80,7 @@ class AgentUserManageTest < TestCase
)
# call new ticket screen again
tasks_close_all()
tasks_close_all
# wait for user get indexed in elastic search
await_global_search(query: random_number)
@ -146,7 +146,7 @@ class AgentUserManageTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_create(
data: {
@ -172,7 +172,7 @@ class AgentUserManageTest < TestCase
click(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"] .js-actions')
click(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"] .js-actions li[data-type="customer-change"]')
modal_ready()
modal_ready
click(css: '.content.active .modal [name="customer_id_completion"]')
# check if pulldown is open, it's not working stable via selenium
@ -229,7 +229,7 @@ class AgentUserManageTest < TestCase
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]',

View file

@ -12,7 +12,7 @@ class AgentUserProfileTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# search and open user
user_open_by_search(value: 'Braun')
@ -37,14 +37,14 @@ class AgentUserProfileTest < TestCase
css: '.active [data-name="note"]',
value: 'some note 123',
)
empty_search()
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()
modal_ready
watch_for(
css: '.active .modal',
value: 'some note 123',
@ -59,7 +59,7 @@ class AgentUserProfileTest < TestCase
value: 'some note abc',
)
click(css: '.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.active .profile-window',
@ -76,13 +76,13 @@ class AgentUserProfileTest < TestCase
click(css: '.active .js-action .icon-arrow-down', fast: true)
click(css: '.active .js-action [data-type="edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="lastname"]',
value: 'Braun',
)
click(css: '.active .modal button.js-submit')
modal_disappear()
modal_disappear
verify_task(
data: {
@ -106,7 +106,7 @@ class AgentUserProfileTest < TestCase
css: '.active .profile-window',
value: "user profile check #{message}",
)
tasks_close_all()
tasks_close_all
# work with two browser windows
message = "comment 1 #{rand(99_999_999_999_999_999)}"

View file

@ -23,10 +23,10 @@ class AuthTest < TestCase
username: 'nicole.braun@zammad.org',
password: 'test',
)
tasks_close_all()
tasks_close_all
# reload page
reload()
reload
# check if cookie is temporarily
watch_for(
@ -75,7 +75,7 @@ class AuthTest < TestCase
expires: '\d{4}-\d{1,2}-\d{1,2}.+?',
)
logout()
logout
# verify session cookie
sleep 2

View file

@ -13,7 +13,7 @@ class CustomerTicketCreateFieldsTest < TestCase
url: browser_url,
)
# remove local object attributes bound to the session
logout()
logout
# re-create agent session and fetch object attributes
login(
@ -24,7 +24,7 @@ class CustomerTicketCreateFieldsTest < TestCase
# re-remove local object attributes bound to the session
# there was an issue (#1856) where the old attribute values
# persisted and were stored as the original attributes
logout()
logout
# create customer session and fetch object attributes
login(

View file

@ -205,7 +205,7 @@ class CustomerTicketCreateTest < TestCase
no_quote: true,
)
logout()
logout
# verify if we still can create new tickets as agent
login(
@ -213,7 +213,7 @@ class CustomerTicketCreateTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_create(
data: {
@ -244,7 +244,7 @@ class CustomerTicketCreateTest < TestCase
sleep(1)
logout()
logout
# check if new ticket button is not visible
@ -256,7 +256,7 @@ class CustomerTicketCreateTest < TestCase
assert(exists_not(css: 'a[href="#customer_ticket_new"]'))
logout()
logout
# enable ticket creation
@ -274,7 +274,7 @@ class CustomerTicketCreateTest < TestCase
sleep(1)
logout()
logout
# check if new ticket button is visible

View file

@ -14,7 +14,7 @@ class FirstStepsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: '.active.content .tab[data-area="first-steps-widgets"]')
watch_for(
@ -25,7 +25,7 @@ class FirstStepsTest < TestCase
# invite agent (with more then one group)
click(css: '.active.content .js-inviteAgent')
modal_ready()
modal_ready
set(
css: '.modal [name="firstname"]',
@ -52,11 +52,11 @@ class FirstStepsTest < TestCase
css: 'body div.modal',
value: 'Sending',
)
modal_disappear()
modal_disappear
# invite customer
click(css: '.active.content .js-inviteCustomer')
modal_ready()
modal_ready
set(
css: '.modal [name="firstname"]',
value: 'Client',
@ -85,14 +85,14 @@ class FirstStepsTest < TestCase
css: 'body div.modal',
value: 'Sending',
)
modal_disappear()
modal_disappear
# test ticket
click(
css: '.active.content .js-testTicket',
fast: true,
)
modal_ready()
modal_ready
watch_for(
css: 'body div.modal',
value: 'A Test Ticket has been created',
@ -105,7 +105,7 @@ class FirstStepsTest < TestCase
css: 'body div.modal',
value: 'Test Ticket',
)
modal_disappear()
modal_disappear
execute(
js: '$(".active.content .sidebar").show()',

View file

@ -11,7 +11,7 @@ class IntegrationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# change settings
click(css: 'a[href="#manage"]')
@ -52,7 +52,7 @@ class IntegrationTest < TestCase
css: '.content.active .main .js-inboundBlockCallerId [value="block spam caller id"]',
)
reload()
reload
exists(
css: '.content.active .main .js-inboundBlockCallerId [value="0411234567"]',
)
@ -67,7 +67,7 @@ class IntegrationTest < TestCase
type: 'off',
)
reload()
reload
exists_not(
css: '.content.active .main .js-inboundBlockCallerId [value="0411234567"]',
)
@ -83,7 +83,7 @@ class IntegrationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# change settings
click(css: 'a[href="#manage"]')
@ -141,7 +141,7 @@ class IntegrationTest < TestCase
value: 'someuser',
)
reload()
reload
match(
css: '.content.active .main select[name="group_ids"]',
@ -169,7 +169,7 @@ class IntegrationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# change settings
click(css: 'a[href="#manage"]')
@ -211,7 +211,7 @@ class IntegrationTest < TestCase
css: '.content.active .main .js-userSync [value="destination1"]',
)
reload()
reload
match(
css: '.content.active .main input[name="api_key"]',
@ -235,7 +235,7 @@ class IntegrationTest < TestCase
)
click(css: '.content.active .main .js-submit')
reload()
reload
match_not(
css: '.content.active .main input[name="api_key"]',
value: 'some_api_key',
@ -259,7 +259,7 @@ class IntegrationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# change settings
click(css: 'a[href="#manage"]')
@ -303,7 +303,7 @@ class IntegrationTest < TestCase
value: 'no',
)
reload()
reload
match(
css: '.content.active .main input[name="icinga_sender"]',

View file

@ -10,7 +10,7 @@ class KeyboardShortcutsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
sleep 2
# show shortkeys
@ -41,14 +41,14 @@ class KeyboardShortcutsTest < TestCase
end
end
modal_ready()
modal_ready
# hide shortkeys
shortcut(key: 'h')
modal_disappear()
modal_disappear
# show shortkeys
shortcut(key: 'h')
modal_ready()
modal_ready
# show notifications
shortcut(key: 'a')

View file

@ -30,13 +30,13 @@ class ManageTest < TestCase
click(css: '.table-overview tr:last-child td')
modal_ready()
modal_ready
set(
css: '.modal input[name="lastname"]',
value: "2Manage Lastname#{random}",
)
click(css: '.modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: 'body',
@ -58,7 +58,7 @@ class ManageTest < TestCase
click(css: '.content:not(.hide) .action:last-child .js-edit')
modal_ready()
modal_ready
set(
css: '.modal input[name=name]',
value: "some sla update #{random}",
@ -68,7 +68,7 @@ class ManageTest < TestCase
value: '2:01',
)
click(css: '.modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: 'body',
@ -94,7 +94,7 @@ class ManageTest < TestCase
value: "some sla update #{random}",
)
reload()
reload
sleep 2
click(css: 'a[href="#manage"]')

View file

@ -11,7 +11,7 @@ class PreferencesLanguageTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# start ticket create
ticket_create(
@ -289,7 +289,7 @@ class PreferencesLanguageTest < TestCase
sleep 6
# check if language is still used after reload
reload()
reload
sleep 2
watch_for(

View file

@ -11,14 +11,14 @@ class PreferencesTokenAccessTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/token_access"]')
click(css: '.content.active .js-create')
modal_ready()
modal_ready
set(
css: '.content.active .modal .js-input',
value: 'Some App#1',
@ -35,7 +35,7 @@ class PreferencesTokenAccessTest < TestCase
value: 'Your New Personal Access Token'
)
click(css: '.modal .js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .js-tokenList',
@ -48,7 +48,7 @@ class PreferencesTokenAccessTest < TestCase
click(css: '.content.active .js-create')
modal_ready()
modal_ready
set(
css: '.content.active .modal .js-input',
value: 'Some App#2',
@ -61,7 +61,7 @@ class PreferencesTokenAccessTest < TestCase
value: 'Your New Personal Access Token'
)
click(css: '.modal .js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .js-tokenList',
@ -70,7 +70,7 @@ class PreferencesTokenAccessTest < TestCase
click(css: '.content.active .js-tokenList .js-delete')
modal_ready()
modal_ready
watch_for(
css: '.content.active .modal .modal-header',
value: 'confirm',
@ -78,7 +78,7 @@ class PreferencesTokenAccessTest < TestCase
click(
css: '.content.active .modal .js-submit',
)
modal_disappear()
modal_disappear
watch_for_disappear(
css: '.content.active .js-tokenList',
value: 'Some App#2'

View file

@ -11,7 +11,7 @@ class ReportingTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
report_profile_create(
data: {

View file

@ -10,7 +10,7 @@ class SettingTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# make sure, that we have english frontend
click(css: 'a[href="#current_user"]')
@ -111,7 +111,7 @@ class SettingTest < TestCase
value: '---',
)
reload()
reload
click(css: 'a[href="#settings/security"]')
click(css: 'a[href="#third_party_auth"]')
@ -149,7 +149,7 @@ class SettingTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
verify_title(value: 'Zammad Test System')

View file

@ -10,7 +10,7 @@ class SwitchToUserTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#manage"]')
click(css: '.content.active a[href="#manage/users"]')

View file

@ -10,7 +10,7 @@ class TaskbarTaskTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
# persistant task
click(css: 'a[href="#new"]', only_if_exists: true)
@ -39,7 +39,7 @@ class TaskbarTaskTest < TestCase
value: 'some test AAA',
)
tasks_close_all()
tasks_close_all
exists_not(css: '.active .newTicket input[name="title"]')
end
@ -51,7 +51,7 @@ class TaskbarTaskTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#new"]', only_if_exists: true)
click(css: 'a[href="#ticket/create"]', wait: 0.8)
@ -77,7 +77,7 @@ class TaskbarTaskTest < TestCase
)
sleep 3
logout()
logout
sleep 4
# relogin with master - task are not viewable
@ -96,7 +96,7 @@ class TaskbarTaskTest < TestCase
css: 'body',
value: 'OUTBOUND TEST#1',
)
logout()
logout
sleep 2
match_not(

View file

@ -11,7 +11,7 @@ class TranslationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
@ -144,7 +144,7 @@ class TranslationTest < TestCase
value: 'Übersichten123',
)
reload()
reload
exists_not(
css: 'span.translation[title="Overviews"]',
)
@ -260,7 +260,7 @@ class TranslationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
@ -285,7 +285,7 @@ class TranslationTest < TestCase
click(css: '.content.active .js-syncChanges')
modal_ready()
modal_ready
watch_for(
css: '.content.active .modal',
value: 'Letzte Übersetzung laden',
@ -327,7 +327,7 @@ class TranslationTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')

View file

@ -10,7 +10,7 @@ class AgentProfilePermissionsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
user_open_by_search(value: 'Braun')
@ -34,13 +34,13 @@ class AgentProfilePermissionsTest < TestCase
css: '.content.active [data-name="note"]',
value: 'some note 123',
)
empty_search()
empty_search
# check and change note again in edit screen
click(css: '.content.active .js-action .icon-arrow-down', fast: true)
click(css: '.content.active .js-action [data-type="edit"]')
modal_ready()
modal_ready
watch_for(
css: '.content.active .modal',
value: 'some note 123',
@ -55,7 +55,7 @@ class AgentProfilePermissionsTest < TestCase
value: 'some note abc',
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .profile-window',
@ -72,13 +72,13 @@ class AgentProfilePermissionsTest < TestCase
click(css: '.content.active .js-action .icon-arrow-down', fast: true)
click(css: '.content.active .js-action [data-type="edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="lastname"]',
value: 'Braun',
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
verify_task(
data: {
@ -94,7 +94,7 @@ class AgentProfilePermissionsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
user_open_by_search(value: 'Test Master')
@ -113,7 +113,7 @@ class AgentProfilePermissionsTest < TestCase
value: 'email',
)
empty_search()
empty_search
sleep 2
click(css: '.content.active .js-action .icon-arrow-down', fast: true)
@ -127,7 +127,7 @@ class AgentProfilePermissionsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket1 = ticket_create(
data: {
@ -138,16 +138,16 @@ class AgentProfilePermissionsTest < TestCase
},
)
tasks_close_all()
tasks_close_all
logout()
logout
login(
username: 'agent1@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_open_by_search(
number: ticket1[:number],
@ -171,7 +171,7 @@ class AgentProfilePermissionsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket1 = ticket_create(
data: {
@ -189,7 +189,7 @@ class AgentProfilePermissionsTest < TestCase
click(css: '.content.active .sidebar[data-tab="customer"] .js-actions .dropdown-toggle')
click(css: '.content.active .sidebar[data-tab="customer"] .js-actions [data-type="customer-edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="lastname"]',
value: 'B2',
@ -199,7 +199,7 @@ class AgentProfilePermissionsTest < TestCase
value: 'some note abc',
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .sidebar[data-tab="customer"] .sidebar-block [data-name="note"]',
@ -215,7 +215,7 @@ class AgentProfilePermissionsTest < TestCase
click(css: '.content.active .sidebar[data-tab="customer"] .js-actions')
click(css: 'li[data-type="customer-edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="lastname"]',
value: 'Braun',
@ -225,7 +225,7 @@ class AgentProfilePermissionsTest < TestCase
value: 'some note abc',
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .sidebar[data-tab="customer"] .sidebar-block [data-name="note"]',
@ -246,7 +246,7 @@ class AgentProfilePermissionsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket1 = ticket_create(
data: {
@ -278,7 +278,7 @@ class AgentProfilePermissionsTest < TestCase
click(css: '.content.active .js-action .dropdown-toggle')
click(css: '.content.active .js-action [data-type="edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="lastname"]',
value: 'B2',
@ -288,7 +288,7 @@ class AgentProfilePermissionsTest < TestCase
value: 'some note abc',
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
watch_for(
css: '.content.active .profile-window',
@ -305,7 +305,7 @@ class AgentProfilePermissionsTest < TestCase
click(css: '.content.active .js-action .dropdown-toggle')
click(css: '.content.active .js-action [data-type="edit"]')
modal_ready()
modal_ready
set(
css: '.modal [name="lastname"]',
value: 'Braun',
@ -315,7 +315,7 @@ class AgentProfilePermissionsTest < TestCase
value: 'note',
)
click(css: '.content.active .modal button.js-submit')
modal_disappear()
modal_disappear
verify_task(
data: {
@ -332,7 +332,7 @@ class AgentProfilePermissionsTest < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket1 = ticket_create(
data: {

View file

@ -12,7 +12,7 @@ class UserSwitchCache < TestCase
password: 'test',
url: browser_url,
)
tasks_close_all()
tasks_close_all
ticket_create(
data: {
customer: 'nico',
@ -22,7 +22,7 @@ class UserSwitchCache < TestCase
},
)
logout()
logout
# login as customer and verify ticket create screen
login(
@ -51,7 +51,7 @@ class UserSwitchCache < TestCase
value: 'State',
)
logout()
logout
# login again as customer and verify ticket create screen
login(

View file

@ -3095,7 +3095,7 @@ wait untill text in selector disabppears
end
raise "Can't find organization #{data[:organization]}" if target.blank?
target.click()
target.click
rescue Selenium::WebDriver::Error::StaleElementReferenceError
sleep retries
retries += 1
@ -3263,7 +3263,7 @@ wait untill text in selector disabppears
sleep 0.5
target = instance.find_elements(css: ".modal li[title='#{data[:organization]}']")[0]
end
target.click()
target.click
rescue Selenium::WebDriver::Error::StaleElementReferenceError
sleep retries
retries += 1
@ -4860,7 +4860,7 @@ wait untill text in selector disabppears
tries = 5
begin
alert = instance.switch_to.alert
alert.dismiss()
alert.dismiss
rescue e
tries -= 1
sleep 0.5

View file

@ -134,7 +134,7 @@ Oversized Email Message Body #{'#' * 120_000}
msg = imap.fetch(imap_message_id, 'RFC822')[0].attr['RFC822']
assert(msg.present?, 'Must have received a reply from the postmaster')
imap.store(imap_message_id, '+FLAGS', [:Deleted])
imap.expunge()
imap.expunge
# parse the reply mail and verify the various headers
parser = Channel::EmailParser.new
@ -209,7 +209,7 @@ Oversized Email Message Body #{'#' * 120_000}
imap_message_id = message_ids.last
msg = imap.fetch(imap_message_id, 'RFC822')[0].attr['RFC822']
imap.store(imap_message_id, '+FLAGS', [:Deleted])
imap.expunge()
imap.expunge
assert(msg.present?, 'Oversized Email Message')
assert_equal(message_ids.count, 1, 'Original customer mail must be deleted.')

View file

@ -82,7 +82,7 @@ class IntegrationIdoitTest < TestCase
# click the check box from the first row and note its entry ID
checkbox = @browser.find_elements(css: '.content.active .modal form.js-result tbody :first-child input')[0]
entry_id = checkbox.attribute('value')
checkbox.click()
checkbox.click
# submit the i-doit object selections
click(css: '.content.active .modal form button.js-submit')
@ -113,7 +113,7 @@ class IntegrationIdoitTest < TestCase
css: ".content.active .sidebar[data-tab='idoit'] a[href='#{api_endpoint}/?objID=#{entry_id}']",
)
tasks_close_all()
tasks_close_all
# new create a new ticket with an i-doit object
ticket_create(
@ -142,7 +142,7 @@ class IntegrationIdoitTest < TestCase
# click the check box from the first row and note its entry ID
checkbox = @browser.find_elements(css: '.content.active .modal form.js-result tbody :first-child input')[0]
entry_id = checkbox.attribute('value')
checkbox.click()
checkbox.click
# submit the i-doit object selections
click(css: '.content.active .modal form button.js-submit')
@ -173,7 +173,7 @@ class IntegrationIdoitTest < TestCase
# reload browser and check if it's still removed
sleep 3
reload()
reload
watch_for(
css: '.content.active .ticketZoom-header .ticket-number',
)
@ -192,7 +192,7 @@ class IntegrationIdoitTest < TestCase
# add item again
click(css: '.content.active .sidebar[data-tab="idoit"] .js-actions .dropdown-toggle')
click(css: '.content.active .sidebar[data-tab="idoit"] .js-actions [data-type="objects-change"]')
modal_ready()
modal_ready
# wait for the API call to populate the dropdown menu
watch_for(css: '.content.active .modal form input.js-input')
@ -205,7 +205,7 @@ class IntegrationIdoitTest < TestCase
# click the check box from the first row and note its entry ID
checkbox = @browser.find_elements(css: '.content.active .modal form.js-result tbody :first-child input')[0]
entry_id = checkbox.attribute('value')
checkbox.click()
checkbox.click
# submit the i-doit object selections
click(css: '.content.active .modal form button.js-submit')
@ -217,7 +217,7 @@ class IntegrationIdoitTest < TestCase
# reload browser and check if it's still removed
sleep 3
reload()
reload
watch_for(
css: '.content.active .ticketZoom-header .ticket-number',
)

View file

@ -361,7 +361,7 @@ class PackageTest < ActiveSupport::TestCase
file.close
end
begin
Package.auto_install()
Package.auto_install
rescue
false
end