Skip to content

Commit

Permalink
Merge pull request #21 from rueyjye/feature/remove_js_error_check
Browse files Browse the repository at this point in the history
remove js error check
  • Loading branch information
nk-ty authored May 15, 2019
2 parents b213baf + 0257072 commit c0c583a
Show file tree
Hide file tree
Showing 15 changed files with 2 additions and 99 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When working with [Bucky-management](https://github.com/lifull-dev/bucky-managem
* Support test code in YAML
* Multiple browser supported (currently only Chrome is supported)
* Customizable test categories
* [Default] E2E: E2E (End to End) tests including JavaScript error check
* [Default] E2E: E2E (End to End) tests
* [Default] Linkstatus: http status code check in web page
* Making test report with [Bucky-management](https://github.com/lifull-dev/bucky-management)

Expand Down
2 changes: 0 additions & 2 deletions example/bucky-management/config/e2e_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
:android: 'Galaxy S5'
:ipad: 'iPad'
:user_agent: 'E2ETest (X11; Linux x86_64)'
:js_error_check: true
:js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
:driver_read_timeout: 60 # sec
:driver_open_timeout: 60 # sec
:find_element_timeout: 10 # sec
2 changes: 0 additions & 2 deletions example/hands-on/config/e2e_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
:android: 'Galaxy S5'
:ipad: 'iPad'
:user_agent: 'E2ETest (X11; Linux x86_64)'
:js_error_check: true
:js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
:driver_read_timeout: 60 # sec
:driver_open_timeout: 60 # sec
:find_element_timeout: 10 # sec
1 change: 0 additions & 1 deletion lib/bucky/core/test_core/test_class_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def add_test_procedure(procedures)
puts " #{index}:#{procedure[:proc]}" if procedure.key?(:proc)
method = procedure[:exec].key?(:operate) ? :operate : :verify
send(method, procedure[:exec])
check_js_error
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def set_chrome_option(device_type)
mobile_emulation = { 'deviceName' => @@config[:device_name_on_chrome][@@config[device_type]] }
chrome_options['chromeOptions']['mobileEmulation'] = mobile_emulation
end
chrome_options['chromeOptions'][:args] << "--load-extension=#{@@config[:js_error_collector_path]}" if @@config[:js_error_check]
chrome_options['chromeOptions'][:args] << "--user-agent=#{@@config[:user_agent]}" if @@config[:user_agent]
chrome_options['chromeOptions'][:args] << '--headless' if @@config[:headless]

Expand Down
7 changes: 0 additions & 7 deletions lib/bucky/test_equipment/test_case/e2e_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
require_relative '../user_operation/user_operator'
require_relative '../pageobject/pages'
require_relative '../selenium_handler/webdriver_handler'
require_relative '../verifications/js_error_checker'
require_relative '../verifications/service_verifications'

module Bucky
module TestEquipment
module TestCase
class E2eTestCase < Bucky::TestEquipment::TestCase::AbstTestCase
include Bucky::TestEquipment::SeleniumHandler::WebdriverHandler
include Bucky::TestEquipment::Verifications::JsErrorChecker

TEST_CATEGORY = 'e2e'

Expand Down Expand Up @@ -50,11 +48,6 @@ def operate(**op_args)
@user_operator.send(op_args[:operate], method_name, op_args)
end

# Check javascript error
def check_js_error
assert_no_js_error(@driver) if @@config[:js_error_check]
end

def setup
super
t_equip_setup
Expand Down
23 changes: 0 additions & 23 deletions lib/bucky/test_equipment/verifications/js_error_checker.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
allow(config_double).to receive('[]').with(:browser).and_return(browser)
allow(config_double).to receive('[]').with(:selenium_ip).and_return(selenium_ip)
allow(config_double).to receive('[]').with(:selenium_port).and_return(selenium_port)
allow(config_double).to receive('[]').with(:js_error_check).and_return(js_error_check)
allow(config_double).to receive('[]').with(:js_error_collector_path).and_return(js_error_collector_path)
allow(config_double).to receive('[]').with(:device_name_on_chrome).and_return(device_name_on_chrome)
allow(config_double).to receive('[]').with(:sp_device_name).and_return(sp_device_name)
allow(config_double).to receive('[]').with(:tablet_device_name).and_return(sp_device_name)
Expand All @@ -38,8 +36,6 @@
describe '#create_webdriver' do
let(:selenium_ip) { '11.22.33.44' }
let(:selenium_port) { '4444' }
let(:js_error_check) { true }
let(:js_error_collector_path) { './' }
let(:device_name_on_chrome) { { iphone6: 'Apple iPhone 6' } }
let(:sp_device_name) { :iphone6 }
let(:sp_device_name) { :ipad }
Expand Down
19 changes: 0 additions & 19 deletions spec/test_equipment/test_case/e2e_test_case_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,6 @@
end
end

describe '#check_js_error' do
before do
this_class.class_variable_set :@@config, js_error_check: js_error_check?
end
context 'when use js error check' do
let(:js_error_check?) { true }
it 'call assert_no_js_error' do
expect(subject).to receive(:assert_no_js_error)
subject.check_js_error
end
end
context 'when not use js error check' do
let(:js_error_check?) { false }
it 'not call assert_no_js_error' do
expect(subject).not_to receive(:assert_no_js_error)
subject.check_js_error
end
end
end
describe '#setup' do
it 'call t_equip_setup' do
expect(subject).to receive(:t_equip_setup)
Expand Down
28 changes: 0 additions & 28 deletions spec/test_equipment/verifications/js_error_checker_spec.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/tools/config_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
:android: 'Galaxy S5'
# :ipad: 'iPad'
:user_agent: 'QA-E2E (X11; Linux x86_64)'
:js_error_check: false
:js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
:driver_read_timeout: 120
:driver_open_timeout: 90
:find_element_timeout: 60
2 changes: 0 additions & 2 deletions spec/tools/rule_config_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
:android: 'Galaxy S5'
:ipad: 'iPad'
:user_agent: 'QA-E2E (X11; Linux x86_64)'
:js_error_check: false
:js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
:driver_read_timeout: 120
:driver_open_timeout: 90
:find_element_timeout: 60
4 changes: 1 addition & 3 deletions spec/utils/e2e_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
:sp_device_name: :iphone6 # Other selection: nexus5
:device_chrome_name:
:iphone6: 'Apple iPhone 6'
:nexus5: 'Google Nexus 5'
:js_error_check: true
:js_error_collector_path: '/ChromeJSErrorCollector-master/extension/' # https://github.com/dharrya/ChromeJSErrorCollector
:nexus5: 'Google Nexus 5'
2 changes: 0 additions & 2 deletions system_testing/test_bucky_project/config/e2e_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
:android: 'Galaxy S5'
:ipad: 'iPad'
:user_agent: 'E2ETest (X11; Linux x86_64)'
:js_error_check: false
:js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
:driver_read_timeout: 60 # sec
:driver_open_timeout: 60 # sec
:find_element_timeout: 10 # sec
2 changes: 0 additions & 2 deletions template/new/config/e2e_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
:android: 'Galaxy S5'
:ipad: 'iPad'
:user_agent: 'E2ETest (X11; Linux x86_64)'
:js_error_check: true
:js_error_collector_path: '/var/lib/selenium/ChromeJSErrorCollector-master/extension' # https://github.com/dharrya/ChromeJSErrorCollector
:driver_read_timeout: 60 # sec
:driver_open_timeout: 60 # sec
:find_element_timeout: 10 # sec

0 comments on commit c0c583a

Please sign in to comment.