Class: Bucky::TestEquipment::TestCase::E2eTestCase

Inherits:
AbstTestCase
  • Object
show all
Includes:
SeleniumHandler::WebdriverHandler
Defined in:
lib/bucky/test_equipment/test_case/e2e_test_case.rb

Constant Summary collapse

TEST_CATEGORY =
'e2e'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SeleniumHandler::WebdriverHandler

create_webdriver

Methods inherited from AbstTestCase

#cleanup, #run

Class Method Details

.shutdownObject



21
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 21

def shutdown; end

.startupObject



19
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 19

def startup; end

Instance Method Details

#operate(**op_args) ⇒ Object

Call method of user operation

Parameters:

  • op_args (Hash)

    e.g.) :page=>“top_page”, :part=>“fizz_button”, :step_number=> 1, :proc_name=> “test proc”}



47
48
49
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 47

def operate(**op_args)
  @user_operator.send(op_args[:exec][:operate], method_name, op_args)
end

#setupObject



51
52
53
54
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 51

def setup
  super
  t_equip_setup
end

#t_equip_setupObject

Initialize the following class

- webdriver
- page object
- user oparation
- verification

Parameters:



30
31
32
33
34
35
36
37
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 30

def t_equip_setup
  @driver = create_webdriver(suite_data[:device])
  @pages = Bucky::TestEquipment::PageObject::Pages.new(suite_data[:service], suite_data[:device], @driver)
  service_verifications_args = { service: suite_data[:service], device: suite_data[:device], driver: @driver, pages: @pages, method_name: method_name }
  @service_verifications = Bucky::TestEquipment::Verifications::ServiceVerifications.new(service_verifications_args)
  user_operator_args = { app: suite_data[:service], device: suite_data[:device], driver: @driver, pages: @pages }
  @user_operator = Bucky::TestEquipment::UserOperation::UserOperator.new(user_operator_args)
end

#teardownObject



56
57
58
59
60
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 56

def teardown
  @driver.quit
ensure
  super
end

#verify(**verify_args) ⇒ Object

Call mothod of verification

Parameters:

  • verify_args (Hash)

    e.g.) “assert_title”, expect: “page title”, :step_number=> 1, :proc_name=> “test proc”}



41
42
43
# File 'lib/bucky/test_equipment/test_case/e2e_test_case.rb', line 41

def verify(**verify_args)
  @service_verifications.send(verify_args[:exec][:verify], verify_args)
end