Applied required changes to install and use PHP 5.6 for testing the Zammad PHP API client - until @jepf adds PHP 7 support (for tests).
This commit is contained in:
parent
29f96527a7
commit
83c77a4a35
26 changed files with 264 additions and 265 deletions
|
@ -11,7 +11,7 @@ jobs:
|
||||||
|
|
||||||
install-mysql:
|
install-mysql:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/ruby:2.4.4
|
- image: circleci/ruby:2.5.5
|
||||||
- image: circleci/mysql:5.7-ram
|
- image: circleci/mysql:5.7-ram
|
||||||
command: --max_allowed_packet=64MB
|
command: --max_allowed_packet=64MB
|
||||||
environment:
|
environment:
|
||||||
|
@ -28,7 +28,7 @@ jobs:
|
||||||
|
|
||||||
install-postgresql:
|
install-postgresql:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/ruby:2.4.4
|
- image: circleci/ruby:2.5.5
|
||||||
- image: circleci/postgres:11-ram
|
- image: circleci/postgres:11-ram
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: zammad_test
|
POSTGRES_DB: zammad_test
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
image: registry.znuny.com/docker/zammad-ruby:2.4.4
|
image: registry.znuny.com/docker/zammad-ruby:2.5.5
|
||||||
|
|
||||||
# Global variables added to the ENV of each job
|
# Global variables added to the ENV of each job
|
||||||
variables:
|
variables:
|
||||||
|
@ -61,7 +61,7 @@ variables:
|
||||||
|
|
||||||
# Cache gems in between jobs and pipelines
|
# Cache gems in between jobs and pipelines
|
||||||
cache:
|
cache:
|
||||||
key: "ruby24"
|
key: "ruby25"
|
||||||
paths:
|
paths:
|
||||||
- vendor/ruby
|
- vendor/ruby
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.4.4
|
2.5.5
|
||||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,7 +1,7 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# core - base
|
# core - base
|
||||||
ruby '2.4.4'
|
ruby '2.5.5'
|
||||||
gem 'rails', '5.1.7'
|
gem 'rails', '5.1.7'
|
||||||
|
|
||||||
# core - rails additions
|
# core - rails additions
|
||||||
|
|
|
@ -641,7 +641,7 @@ DEPENDENCIES
|
||||||
zendesk_api
|
zendesk_api
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 2.4.4p296
|
ruby 2.5.5p157
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.17.3
|
1.17.3
|
||||||
|
|
|
@ -10,7 +10,7 @@ class Integration::LdapController < ApplicationController
|
||||||
|
|
||||||
def discover
|
def discover
|
||||||
answer_with do
|
answer_with do
|
||||||
begin
|
|
||||||
ldap = ::Ldap.new(params)
|
ldap = ::Ldap.new(params)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ class Integration::LdapController < ApplicationController
|
||||||
|
|
||||||
# return empty result
|
# return empty result
|
||||||
{}
|
{}
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ class ReportsController < ApplicationController
|
||||||
|
|
||||||
row = 2
|
row = 2
|
||||||
result[:ticket_ids].each do |ticket_id|
|
result[:ticket_ids].each do |ticket_id|
|
||||||
begin
|
|
||||||
ticket = Ticket.lookup(id: ticket_id)
|
ticket = Ticket.lookup(id: ticket_id)
|
||||||
row += 1
|
row += 1
|
||||||
worksheet.write_string(row, 0, ticket.number)
|
worksheet.write_string(row, 0, ticket.number)
|
||||||
|
@ -295,7 +295,7 @@ class ReportsController < ApplicationController
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "SKIP: #{e.message}"
|
Rails.logger.error "SKIP: #{e.message}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
row += 2
|
row += 2
|
||||||
|
|
|
@ -188,7 +188,7 @@ stream all accounts
|
||||||
|
|
||||||
# start threads for each channel
|
# start threads for each channel
|
||||||
@@channel_stream[channel_id][:thread] = Thread.new do
|
@@channel_stream[channel_id][:thread] = Thread.new do
|
||||||
begin
|
|
||||||
logger.info "Started stream channel for '#{channel.id}' (#{channel.area})..."
|
logger.info "Started stream channel for '#{channel.id}' (#{channel.area})..."
|
||||||
channel.status_in = 'ok'
|
channel.status_in = 'ok'
|
||||||
channel.last_log_in = ''
|
channel.last_log_in = ''
|
||||||
|
@ -210,7 +210,7 @@ stream all accounts
|
||||||
channel.save!
|
channel.save!
|
||||||
@@channel_stream.delete(channel_id)
|
@@channel_stream.delete(channel_id)
|
||||||
@@channel_stream_started_till_at[channel_id] = Time.zone.now
|
@@channel_stream_started_till_at[channel_id] = Time.zone.now
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -127,11 +127,11 @@ example
|
||||||
|
|
||||||
message_ids = nil
|
message_ids = nil
|
||||||
timeout(6.minutes) do
|
timeout(6.minutes) do
|
||||||
begin
|
|
||||||
message_ids = @imap.sort(['DATE'], filter, 'US-ASCII')
|
message_ids = @imap.sort(['DATE'], filter, 'US-ASCII')
|
||||||
rescue
|
rescue
|
||||||
message_ids = @imap.search(filter)
|
message_ids = @imap.search(filter)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# check mode only
|
# check mode only
|
||||||
|
|
|
@ -586,14 +586,14 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
|
||||||
end
|
end
|
||||||
|
|
||||||
mail.parts.each do |part|
|
mail.parts.each do |part|
|
||||||
begin
|
|
||||||
new_attachments = get_attachments(part, attachments, mail).flatten.compact
|
new_attachments = get_attachments(part, attachments, mail).flatten.compact
|
||||||
attachments.push(*new_attachments)
|
attachments.push(*new_attachments)
|
||||||
rescue => e # Protect process to work with spam emails (see test/fixtures/mail15.box)
|
rescue => e # Protect process to work with spam emails (see test/fixtures/mail15.box)
|
||||||
raise e if (fail_count ||= 0).positive?
|
raise e if (fail_count ||= 0).positive?
|
||||||
|
|
||||||
(fail_count += 1) && retry
|
(fail_count += 1) && retry
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
attachments
|
attachments
|
||||||
|
@ -608,7 +608,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
|
||||||
file.header.fields.each do |field|
|
file.header.fields.each do |field|
|
||||||
|
|
||||||
# full line, encode, ready for storage
|
# full line, encode, ready for storage
|
||||||
begin
|
|
||||||
value = field.to_utf8
|
value = field.to_utf8
|
||||||
if value.blank?
|
if value.blank?
|
||||||
value = field.raw_value
|
value = field.raw_value
|
||||||
|
@ -616,7 +616,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
|
||||||
headers_store[field.name.to_s] = value
|
headers_store[field.name.to_s] = value
|
||||||
rescue => e
|
rescue => e
|
||||||
headers_store[field.name.to_s] = field.raw_value
|
headers_store[field.name.to_s] = field.raw_value
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# cleanup content id, <> will be added automatically later
|
# cleanup content id, <> will be added automatically later
|
||||||
|
|
|
@ -12,7 +12,7 @@ module Channel::Filter::Database
|
||||||
all_matches_ok = true
|
all_matches_ok = true
|
||||||
min_one_rule_exists = false
|
min_one_rule_exists = false
|
||||||
filter[:match].each do |key, meta|
|
filter[:match].each do |key, meta|
|
||||||
begin
|
|
||||||
next if meta.blank? || meta['value'].blank?
|
next if meta.blank? || meta['value'].blank?
|
||||||
|
|
||||||
value = mail[ key.downcase.to_sym ]
|
value = mail[ key.downcase.to_sym ]
|
||||||
|
@ -37,7 +37,7 @@ module Channel::Filter::Database
|
||||||
all_matches_ok = false
|
all_matches_ok = false
|
||||||
Rails.logger.error "can't use match rule #{match_rule} on #{value}"
|
Rails.logger.error "can't use match rule #{match_rule} on #{value}"
|
||||||
Rails.logger.error e.inspect
|
Rails.logger.error e.inspect
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
next if !min_one_rule_exists
|
next if !min_one_rule_exists
|
||||||
|
|
|
@ -69,6 +69,7 @@ class Store::Provider::File
|
||||||
local_location = locations[0, count].join('/')
|
local_location = locations[0, count].join('/')
|
||||||
break if local_location.match?(%r{storage/fs/{0,4}$})
|
break if local_location.match?(%r{storage/fs/{0,4}$})
|
||||||
break if Dir["#{local_location}/*"].present?
|
break if Dir["#{local_location}/*"].present?
|
||||||
|
next if !Dir.exist?(local_location)
|
||||||
|
|
||||||
FileUtils.rmdir(local_location)
|
FileUtils.rmdir(local_location)
|
||||||
end
|
end
|
||||||
|
|
|
@ -444,7 +444,7 @@ get count of tickets and tickets which match on selector
|
||||||
return [] if !query
|
return [] if !query
|
||||||
|
|
||||||
ActiveRecord::Base.transaction(requires_new: true) do
|
ActiveRecord::Base.transaction(requires_new: true) do
|
||||||
begin
|
|
||||||
if !current_user
|
if !current_user
|
||||||
ticket_count = Ticket.distinct.where(query, *bind_params).joins(tables).count
|
ticket_count = Ticket.distinct.where(query, *bind_params).joins(tables).count
|
||||||
tickets = Ticket.distinct.where(query, *bind_params).joins(tables).limit(limit)
|
tickets = Ticket.distinct.where(query, *bind_params).joins(tables).limit(limit)
|
||||||
|
@ -459,7 +459,7 @@ get count of tickets and tickets which match on selector
|
||||||
rescue ActiveRecord::StatementInvalid => e
|
rescue ActiveRecord::StatementInvalid => e
|
||||||
Rails.logger.error e
|
Rails.logger.error e
|
||||||
raise ActiveRecord::Rollback
|
raise ActiveRecord::Rollback
|
||||||
end
|
|
||||||
end
|
end
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ class TriggerRecipientUpdate < ActiveRecord::Migration[4.2]
|
||||||
return if !Setting.find_by(name: 'system_init_done')
|
return if !Setting.find_by(name: 'system_init_done')
|
||||||
|
|
||||||
['auto reply (on new tickets)', 'auto reply (on follow up of tickets)'].each do |name|
|
['auto reply (on new tickets)', 'auto reply (on follow up of tickets)'].each do |name|
|
||||||
begin
|
|
||||||
trigger = Trigger.find_by(name: name)
|
trigger = Trigger.find_by(name: name)
|
||||||
next if trigger.blank?
|
next if trigger.blank?
|
||||||
next if trigger.perform.blank?
|
next if trigger.perform.blank?
|
||||||
|
@ -17,7 +17,7 @@ class TriggerRecipientUpdate < ActiveRecord::Migration[4.2]
|
||||||
trigger.save!
|
trigger.save!
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "Unable to update Trigger.find(#{trigger.id}) '#{trigger.inspect}': #{e.message}"
|
Rails.logger.error "Unable to update Trigger.find(#{trigger.id}) '#{trigger.inspect}': #{e.message}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -220,11 +220,11 @@ class ForeignKeys < ActiveRecord::Migration[4.2]
|
||||||
|
|
||||||
foreign_keys.each do |foreign_key|
|
foreign_keys.each do |foreign_key|
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
begin
|
|
||||||
add_foreign_key(*foreign_key)
|
add_foreign_key(*foreign_key)
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "Inconsistent data status detected while adding foreign key '#{foreign_key.inspect}': #{e.message}"
|
Rails.logger.error "Inconsistent data status detected while adding foreign key '#{foreign_key.inspect}': #{e.message}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,11 +5,11 @@ class AgendBasedSenderIssue1351 < ActiveRecord::Migration[4.2]
|
||||||
return if !Setting.find_by(name: 'system_init_done')
|
return if !Setting.find_by(name: 'system_init_done')
|
||||||
|
|
||||||
EmailAddress.all.each do |email_address|
|
EmailAddress.all.each do |email_address|
|
||||||
begin
|
|
||||||
email_address.save!
|
email_address.save!
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "Unable to update EmailAddress.find(#{email_address.id}) '#{email_address.inspect}': #{e.message}"
|
Rails.logger.error "Unable to update EmailAddress.find(#{email_address.id}) '#{email_address.inspect}': #{e.message}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,11 +7,11 @@ class FixedStoreUpgradeRor45 < ActiveRecord::Migration[5.0]
|
||||||
Cache.clear
|
Cache.clear
|
||||||
[Macro, Taskbar, Calendar, Trigger, Channel, Job, PostmasterFilter, Report::Profile, Setting, Sla, Template].each do |class_name|
|
[Macro, Taskbar, Calendar, Trigger, Channel, Job, PostmasterFilter, Report::Profile, Setting, Sla, Template].each do |class_name|
|
||||||
class_name.all.each do |record|
|
class_name.all.each do |record|
|
||||||
begin
|
|
||||||
record.save!
|
record.save!
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "Unable to save/update #{class_name}.find(#{record.id}): #{e.message}"
|
Rails.logger.error "Unable to save/update #{class_name}.find(#{record.id}): #{e.message}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,13 @@ class Issue1977RemoveInvalidUserForeignKeys < ActiveRecord::Migration[5.1]
|
||||||
]
|
]
|
||||||
|
|
||||||
foreign_keys.each do |args|
|
foreign_keys.each do |args|
|
||||||
begin
|
|
||||||
add_foreign_key(*args)
|
add_foreign_key(*args)
|
||||||
rescue ActiveRecord::StatementInvalid => e
|
rescue ActiveRecord::StatementInvalid => e
|
||||||
Rails.logger.info "Can't add foreign_keys '#{args.inspect}'"
|
Rails.logger.info "Can't add foreign_keys '#{args.inspect}'"
|
||||||
Rails.logger.info e
|
Rails.logger.info e
|
||||||
ActiveRecord::Base.connection.reconnect!
|
ActiveRecord::Base.connection.reconnect!
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -444,14 +444,14 @@ class String
|
||||||
#map['word-en-de'] = "[^#{marker}].{1,250}\s(wrote|schrieb):"
|
#map['word-en-de'] = "[^#{marker}].{1,250}\s(wrote|schrieb):"
|
||||||
|
|
||||||
map.each_value do |regexp|
|
map.each_value do |regexp|
|
||||||
begin
|
|
||||||
string.sub!(/#{regexp}/) do |placeholder|
|
string.sub!(/#{regexp}/) do |placeholder|
|
||||||
placeholder = "#{marker}#{placeholder}"
|
placeholder = "#{marker}#{placeholder}"
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
# regexp was not possible because of some string encoding issue, use next
|
# regexp was not possible because of some string encoding issue, use next
|
||||||
Rails.logger.debug { "Invalid string/charset combination with regexp #{regexp} in string" }
|
Rails.logger.debug { "Invalid string/charset combination with regexp #{regexp} in string" }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
string
|
string
|
||||||
|
@ -494,11 +494,11 @@ class String
|
||||||
|
|
||||||
# try to find valid encodings of string
|
# try to find valid encodings of string
|
||||||
viable_encodings.each do |enc|
|
viable_encodings.each do |enc|
|
||||||
begin
|
|
||||||
return encode!('utf-8', enc)
|
return encode!('utf-8', enc)
|
||||||
rescue EncodingError => e
|
rescue EncodingError => e
|
||||||
Rails.logger.error { e.inspect }
|
Rails.logger.error { e.inspect }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
case options[:fallback]
|
case options[:fallback]
|
||||||
|
|
|
@ -14,7 +14,6 @@ class Sequencer
|
||||||
|
|
||||||
ews_folder_ids.collect do |folder_id|
|
ews_folder_ids.collect do |folder_id|
|
||||||
|
|
||||||
begin
|
|
||||||
ews_folder.find(folder_id).items.each do |resource|
|
ews_folder.find(folder_id).items.each do |resource|
|
||||||
attributes = ::Import::Exchange::ItemAttributes.extract(resource)
|
attributes = ::Import::Exchange::ItemAttributes.extract(resource)
|
||||||
extractor.extract(attributes)
|
extractor.extract(attributes)
|
||||||
|
@ -25,7 +24,7 @@ class Sequencer
|
||||||
|
|
||||||
logger.error e
|
logger.error e
|
||||||
logger.error "Skipping folder_id '#{folder_id}' due to unsupported entries."
|
logger.error "Skipping folder_id '#{folder_id}' due to unsupported entries."
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end.examples
|
end.examples
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,14 +10,13 @@ namespace :zammad do
|
||||||
# there is no way in rake to achive that
|
# there is no way in rake to achive that
|
||||||
%w[db:drop:_unsafe db:create db:schema:load db:seed].each do |task|
|
%w[db:drop:_unsafe db:create db:schema:load db:seed].each do |task|
|
||||||
|
|
||||||
begin
|
|
||||||
$stdout = StringIO.new if task == 'db:schema:load'.freeze
|
$stdout = StringIO.new if task == 'db:schema:load'.freeze
|
||||||
|
|
||||||
Rake::Task[task].reenable
|
Rake::Task[task].reenable
|
||||||
Rake::Task[task].invoke
|
Rake::Task[task].invoke
|
||||||
ensure
|
ensure
|
||||||
$stdout = STDOUT
|
$stdout = STDOUT
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
ActiveRecord::Base.connection.reconnect!
|
ActiveRecord::Base.connection.reconnect!
|
||||||
|
|
|
@ -294,7 +294,7 @@ returns
|
||||||
end
|
end
|
||||||
if title == '-'
|
if title == '-'
|
||||||
%i[sticker photo document voice].each do |area|
|
%i[sticker photo document voice].each do |area|
|
||||||
begin
|
|
||||||
next if !params[:message]
|
next if !params[:message]
|
||||||
next if !params[:message][area]
|
next if !params[:message][area]
|
||||||
next if !params[:message][area][:emoji]
|
next if !params[:message][area][:emoji]
|
||||||
|
@ -304,7 +304,7 @@ returns
|
||||||
rescue
|
rescue
|
||||||
# just go ahead
|
# just go ahead
|
||||||
title
|
title
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if title.length > 60
|
if title.length > 60
|
||||||
|
|
|
@ -25,14 +25,14 @@ RSpec.describe NotificationFactory do
|
||||||
let(:template_path) { Rails.root.to_s + "/app/views/mailer/signup/#{rendered_locale}.html.erb.custom" }
|
let(:template_path) { Rails.root.to_s + "/app/views/mailer/signup/#{rendered_locale}.html.erb.custom" }
|
||||||
|
|
||||||
it 'uses that file' do
|
it 'uses that file' do
|
||||||
begin
|
|
||||||
File.write(template_path, "Subject\nBody\nbody\n")
|
File.write(template_path, "Subject\nBody\nbody\n")
|
||||||
|
|
||||||
expect(described_class.template_read(read_params))
|
expect(described_class.template_read(read_params))
|
||||||
.to eq({ subject: "Subject\n", body: "Body\nbody\n" })
|
.to eq({ subject: "Subject\n", body: "Body\nbody\n" })
|
||||||
ensure
|
ensure
|
||||||
File.delete(template_path)
|
File.delete(template_path)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe 'websocket-server', type: :script do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'starts up successfully' do
|
it 'starts up successfully' do
|
||||||
begin
|
|
||||||
system("RAILS_ENV=test #{ws_server} start -db #{ipv6_addr} -p #{port} >/dev/null 2>&1")
|
system("RAILS_ENV=test #{ws_server} start -db #{ipv6_addr} -p #{port} >/dev/null 2>&1")
|
||||||
|
|
||||||
# Wait for daemon to start
|
# Wait for daemon to start
|
||||||
|
@ -38,7 +38,7 @@ describe 'websocket-server', type: :script do
|
||||||
expect(File.read(error_log)).not_to include(error_msg)
|
expect(File.read(error_log)).not_to include(error_msg)
|
||||||
ensure
|
ensure
|
||||||
system("#{ws_server} stop >/dev/null 2>&1") if File.exist?(pidfile)
|
system("#{ws_server} stop >/dev/null 2>&1") if File.exist?(pidfile)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,10 +38,10 @@ module BrowserTestHelper
|
||||||
#
|
#
|
||||||
def until_exists
|
def until_exists
|
||||||
self.until do
|
self.until do
|
||||||
begin
|
|
||||||
yield
|
yield
|
||||||
rescue Capybara::ElementNotFound # rubocop:disable Lint/HandleExceptions
|
rescue Capybara::ElementNotFound # rubocop:disable Lint/HandleExceptions
|
||||||
end
|
|
||||||
end
|
end
|
||||||
rescue Selenium::WebDriver::Error::TimeOutError => e
|
rescue Selenium::WebDriver::Error::TimeOutError => e
|
||||||
# cleanup backtrace
|
# cleanup backtrace
|
||||||
|
|
|
@ -105,14 +105,14 @@ class TestCase < ActiveSupport::TestCase
|
||||||
|
|
||||||
# avoid "Cannot read property 'get_Current' of undefined" issues
|
# avoid "Cannot read property 'get_Current' of undefined" issues
|
||||||
(1..5).each do |count|
|
(1..5).each do |count|
|
||||||
begin
|
|
||||||
local_browser = browser_instance_remote
|
local_browser = browser_instance_remote
|
||||||
break
|
break
|
||||||
rescue => e
|
rescue => e
|
||||||
wait_until_ready = rand(5..13)
|
wait_until_ready = rand(5..13)
|
||||||
log('browser_instance', { rescure: true, count: count, sleep: wait_until_ready, exception: e })
|
log('browser_instance', { rescure: true, count: count, sleep: wait_until_ready, exception: e })
|
||||||
sleep wait_until_ready
|
sleep wait_until_ready
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local_browser
|
local_browser
|
||||||
|
@ -1579,7 +1579,7 @@ wait untill text in selector disabppears
|
||||||
|
|
||||||
99.times do
|
99.times do
|
||||||
#sleep 0.5
|
#sleep 0.5
|
||||||
begin
|
|
||||||
if instance.find_elements(css: '#navigation .tasks .task:first-child')[0]
|
if instance.find_elements(css: '#navigation .tasks .task:first-child')[0]
|
||||||
instance.action.move_to(instance.find_elements(css: '#navigation .tasks .task:first-child')[0]).release.perform
|
instance.action.move_to(instance.find_elements(css: '#navigation .tasks .task:first-child')[0]).release.perform
|
||||||
click_element = instance.find_elements(css: '#navigation .tasks .task:first-child .js-close')[0]
|
click_element = instance.find_elements(css: '#navigation .tasks .task:first-child .js-close')[0]
|
||||||
|
@ -1597,7 +1597,7 @@ wait untill text in selector disabppears
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
# try again
|
# try again
|
||||||
end
|
|
||||||
end
|
end
|
||||||
assert(true, 'all tasks closed')
|
assert(true, 'all tasks closed')
|
||||||
end
|
end
|
||||||
|
@ -1790,13 +1790,13 @@ wait untill text in selector disabppears
|
||||||
|
|
||||||
if data[:roles]
|
if data[:roles]
|
||||||
99.times do
|
99.times do
|
||||||
begin
|
|
||||||
element = instance.find_elements(css: '.modal .js-selected[data-name=role_ids] .js-option:not(.is-hidden)')[0]
|
element = instance.find_elements(css: '.modal .js-selected[data-name=role_ids] .js-option:not(.is-hidden)')[0]
|
||||||
break if !element
|
break if !element
|
||||||
|
|
||||||
element.click
|
element.click
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
end
|
|
||||||
end
|
end
|
||||||
data[:roles].each do |role|
|
data[:roles].each do |role|
|
||||||
instance.execute_script("$(\".modal [data-name=role_ids] .js-pool .js-option:not(.is-hidden):contains('#{role}')\").first().click()")
|
instance.execute_script("$(\".modal [data-name=role_ids] .js-pool .js-option:not(.is-hidden):contains('#{role}')\").first().click()")
|
||||||
|
@ -1945,13 +1945,13 @@ wait untill text in selector disabppears
|
||||||
end
|
end
|
||||||
if data[:roles]
|
if data[:roles]
|
||||||
99.times do
|
99.times do
|
||||||
begin
|
|
||||||
element = instance.find_elements(css: '.modal .js-selected[data-name=role_ids] .js-option:not(.is-hidden)')[0]
|
element = instance.find_elements(css: '.modal .js-selected[data-name=role_ids] .js-option:not(.is-hidden)')[0]
|
||||||
break if !element
|
break if !element
|
||||||
|
|
||||||
element.click
|
element.click
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
end
|
|
||||||
end
|
end
|
||||||
data[:roles].each do |role|
|
data[:roles].each do |role|
|
||||||
instance.execute_script("$(\".modal [data-name=role_ids] .js-pool .js-option:not(.is-hidden):contains('#{role}')\").first().click()")
|
instance.execute_script("$(\".modal [data-name=role_ids] .js-pool .js-option:not(.is-hidden):contains('#{role}')\").first().click()")
|
||||||
|
|
Loading…
Reference in a new issue