automation_object 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/automation_object.rb +22 -11
- data/lib/automation_object/blue_print.rb +13 -12
- data/lib/automation_object/blue_print/composite/automatic_onload_modal.rb +9 -8
- data/lib/automation_object/blue_print/composite/base.rb +5 -4
- data/lib/automation_object/blue_print/composite/custom_method.rb +8 -7
- data/lib/automation_object/blue_print/composite/element.rb +6 -5
- data/lib/automation_object/blue_print/composite/element_array.rb +6 -5
- data/lib/automation_object/blue_print/composite/element_hash.rb +7 -6
- data/lib/automation_object/blue_print/composite/helpers/element_helper.rb +7 -7
- data/lib/automation_object/blue_print/composite/helpers/multiple_elements_helper.rb +5 -4
- data/lib/automation_object/blue_print/composite/hook.rb +9 -11
- data/lib/automation_object/blue_print/composite/hook_action.rb +25 -24
- data/lib/automation_object/blue_print/composite/hook_element_requirements.rb +14 -13
- data/lib/automation_object/blue_print/composite/modal.rb +11 -21
- data/lib/automation_object/blue_print/composite/screen.rb +22 -16
- data/lib/automation_object/blue_print/composite/top.rb +13 -12
- data/lib/automation_object/blue_print/composite/view.rb +27 -16
- data/lib/automation_object/blue_print/hash_adapter.rb +15 -11
- data/lib/automation_object/blue_print/hash_adapter/automatic_onload_modal.rb +12 -11
- data/lib/automation_object/blue_print/hash_adapter/composite.rb +28 -25
- data/lib/automation_object/blue_print/hash_adapter/custom_method.rb +11 -10
- data/lib/automation_object/blue_print/hash_adapter/element.rb +10 -9
- data/lib/automation_object/blue_print/hash_adapter/element_array.rb +10 -9
- data/lib/automation_object/blue_print/hash_adapter/element_hash.rb +11 -10
- data/lib/automation_object/blue_print/hash_adapter/helpers/element_helper.rb +20 -25
- data/lib/automation_object/blue_print/hash_adapter/helpers/multiple_elements_helper.rb +15 -14
- data/lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb +9 -8
- data/lib/automation_object/blue_print/hash_adapter/helpers/validation_helper.rb +19 -24
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate.rb +8 -5
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_allowed_keys.rb +7 -8
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_element_presence_of.rb +28 -23
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_instance_of.rb +12 -13
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_modal_presence_of.rb +27 -23
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_presence_of.rb +9 -8
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_screen_presence_of.rb +27 -23
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_view_presence_of.rb +25 -21
- data/lib/automation_object/blue_print/hash_adapter/hook.rb +14 -11
- data/lib/automation_object/blue_print/hash_adapter/hook_action.rb +45 -47
- data/lib/automation_object/blue_print/hash_adapter/hook_element_requirements.rb +24 -28
- data/lib/automation_object/blue_print/hash_adapter/modal.rb +14 -13
- data/lib/automation_object/blue_print/hash_adapter/screen.rb +23 -22
- data/lib/automation_object/blue_print/hash_adapter/top.rb +16 -15
- data/lib/automation_object/blue_print/hash_adapter/view.rb +58 -4
- data/lib/automation_object/blue_print/yaml_adapter.rb +33 -34
- data/lib/automation_object/driver.rb +15 -13
- data/lib/automation_object/driver/appium_adapter/driver.rb +47 -46
- data/lib/automation_object/driver/appium_adapter/element.rb +29 -96
- data/lib/automation_object/driver/base.rb +4 -2
- data/lib/automation_object/driver/common_selenium/driver.rb +60 -0
- data/lib/automation_object/driver/common_selenium/element.rb +107 -0
- data/lib/automation_object/driver/common_selenium/element_geometry.rb +86 -0
- data/lib/automation_object/driver/driver.rb +60 -30
- data/lib/automation_object/driver/element.rb +70 -15
- data/lib/automation_object/driver/nokogiri_adapter/driver.rb +88 -34
- data/lib/automation_object/driver/nokogiri_adapter/element.rb +94 -16
- data/lib/automation_object/driver/nokogiri_adapter/error.rb +29 -8
- data/lib/automation_object/driver/nokogiri_adapter/{backup/form.rb → form.rb} +19 -6
- data/lib/automation_object/driver/nokogiri_adapter/request.rb +17 -0
- data/lib/automation_object/driver/nokogiri_adapter/session.rb +94 -0
- data/lib/automation_object/driver/nokogiri_adapter/window.rb +86 -0
- data/lib/automation_object/driver/selenium_adapter/driver.rb +36 -45
- data/lib/automation_object/driver/selenium_adapter/element.rb +15 -85
- data/lib/automation_object/dsl.rb +11 -28
- data/lib/automation_object/dsl/_base.rb +70 -0
- data/lib/automation_object/dsl/_proxy.rb +24 -0
- data/lib/automation_object/dsl/element.rb +34 -0
- data/lib/automation_object/dsl/element_array.rb +34 -0
- data/lib/automation_object/dsl/element_hash.rb +34 -0
- data/lib/automation_object/dsl/modal.rb +43 -0
- data/lib/automation_object/dsl/screen.rb +45 -0
- data/lib/automation_object/dsl/top.rb +25 -0
- data/lib/automation_object/framework.rb +28 -38
- data/lib/automation_object/helpers/composite.rb +30 -27
- data/lib/automation_object/helpers/composite_hook.rb +16 -15
- data/lib/automation_object/{blue_print/helpers/file_helper.rb → helpers/file.rb} +12 -12
- data/lib/automation_object/helpers/hash.rb +6 -5
- data/lib/automation_object/helpers/kernel.rb +11 -0
- data/lib/automation_object/helpers/{reflection_helper.rb → reflection.rb} +9 -8
- data/lib/automation_object/helpers/string.rb +25 -15
- data/lib/automation_object/{proxies → proxy}/mutex_proxy.rb +18 -21
- data/lib/automation_object/proxy/proxy.rb +23 -0
- data/lib/automation_object/proxy/throttle_proxy.rb +52 -0
- data/lib/automation_object/state.rb +11 -29
- data/lib/automation_object/state/{blue_print_adapter/composite.rb → composite/_base.rb} +35 -25
- data/lib/automation_object/state/{blue_print_adapter/helpers/element_helper.rb → composite/_common_element.rb} +11 -11
- data/lib/automation_object/state/composite/element.rb +22 -0
- data/lib/automation_object/state/composite/element_array.rb +27 -0
- data/lib/automation_object/state/composite/element_hash.rb +33 -0
- data/lib/automation_object/state/composite/element_proxy.rb +33 -0
- data/lib/automation_object/state/composite/helpers/window.rb +61 -0
- data/lib/automation_object/state/composite/helpers/window_manager.rb +60 -0
- data/lib/automation_object/state/composite/hook.rb +56 -0
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_action.rb +10 -8
- data/lib/automation_object/state/composite/hook_actions/action_loop.rb +36 -0
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_actions/change_screen.rb +7 -5
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_actions/change_to_previous_screen.rb +7 -5
- data/lib/automation_object/state/composite/hook_actions/close_modal.rb +29 -0
- data/lib/automation_object/state/composite/hook_actions/close_screen.rb +19 -0
- data/lib/automation_object/state/composite/hook_actions/element_requirement.rb +32 -0
- data/lib/automation_object/state/composite/hook_actions/new_screen.rb +35 -0
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_actions/possible_screen_changes.rb +8 -7
- data/lib/automation_object/state/composite/hook_actions/reset_screen.rb +14 -0
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_actions/show_modal.rb +7 -5
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_actions/sleep.rb +4 -2
- data/lib/automation_object/state/{blue_print_adapter → composite}/hook_actions/wait_for_elements.rb +7 -5
- data/lib/automation_object/state/composite/modal.rb +45 -0
- data/lib/automation_object/state/composite/screen.rb +58 -0
- data/lib/automation_object/state/composite/top.rb +51 -0
- data/lib/automation_object/state/error.rb +45 -6
- data/lib/automation_object/state/session.rb +25 -23
- data/lib/automation_object/step_definitions.rb +5 -3
- data/lib/automation_object/step_definitions/element.rb +77 -0
- data/lib/automation_object/step_definitions/element_array.rb +135 -0
- data/lib/automation_object/step_definitions/element_hash.rb +126 -0
- data/lib/automation_object/step_definitions/screen.rb +62 -0
- data/lib/automation_object/step_definitions/{cache.rb → support/cache.rb} +8 -6
- data/lib/automation_object/step_definitions/support/element_array.rb +40 -0
- data/lib/automation_object/step_definitions/support/element_hash.rb +41 -0
- data/lib/automation_object/step_definitions/{parse.rb → support/parse.rb} +8 -6
- data/lib/automation_object/version.rb +2 -1
- metadata +203 -103
- data/lib/automation_object/driver/helpers/selenium_driver_helper.rb +0 -41
- data/lib/automation_object/driver/helpers/selenium_element_helper.rb +0 -138
- data/lib/automation_object/driver/nokogiri_adapter/backup/driver.rb +0 -83
- data/lib/automation_object/driver/nokogiri_adapter/backup/element.rb +0 -66
- data/lib/automation_object/driver/nokogiri_adapter/backup/helpers/driver_element_helper.rb +0 -52
- data/lib/automation_object/driver/nokogiri_adapter/backup/session.rb +0 -115
- data/lib/automation_object/dsl/blue_print_adapter.rb +0 -16
- data/lib/automation_object/dsl/blue_print_adapter/composite.rb +0 -54
- data/lib/automation_object/dsl/blue_print_adapter/element.rb +0 -14
- data/lib/automation_object/dsl/blue_print_adapter/element_array.rb +0 -14
- data/lib/automation_object/dsl/blue_print_adapter/element_hash.rb +0 -14
- data/lib/automation_object/dsl/blue_print_adapter/modal.rb +0 -23
- data/lib/automation_object/dsl/blue_print_adapter/screen.rb +0 -26
- data/lib/automation_object/dsl/blue_print_adapter/top.rb +0 -19
- data/lib/automation_object/dsl/models.rb +0 -18
- data/lib/automation_object/dsl/proxies/element.rb +0 -16
- data/lib/automation_object/dsl/proxies/element_array.rb +0 -16
- data/lib/automation_object/dsl/proxies/element_hash.rb +0 -16
- data/lib/automation_object/dsl/proxies/helpers/composite_helper.rb +0 -74
- data/lib/automation_object/dsl/proxies/modal.rb +0 -17
- data/lib/automation_object/dsl/proxies/screen.rb +0 -17
- data/lib/automation_object/dsl/proxies/top.rb +0 -17
- data/lib/automation_object/proxies/proxy.rb +0 -20
- data/lib/automation_object/proxies/throttle_proxy.rb +0 -57
- data/lib/automation_object/state/blue_print_adapter.rb +0 -16
- data/lib/automation_object/state/blue_print_adapter/element.rb +0 -20
- data/lib/automation_object/state/blue_print_adapter/element_array.rb +0 -25
- data/lib/automation_object/state/blue_print_adapter/element_hash.rb +0 -31
- data/lib/automation_object/state/blue_print_adapter/element_proxy.rb +0 -28
- data/lib/automation_object/state/blue_print_adapter/helpers/screen_manager.rb +0 -137
- data/lib/automation_object/state/blue_print_adapter/helpers/window.rb +0 -39
- data/lib/automation_object/state/blue_print_adapter/hook.rb +0 -56
- data/lib/automation_object/state/blue_print_adapter/hook_actions/action_loop.rb +0 -35
- data/lib/automation_object/state/blue_print_adapter/hook_actions/close_modal.rb +0 -31
- data/lib/automation_object/state/blue_print_adapter/hook_actions/close_screen.rb +0 -19
- data/lib/automation_object/state/blue_print_adapter/hook_actions/element_requirement.rb +0 -34
- data/lib/automation_object/state/blue_print_adapter/hook_actions/new_screen.rb +0 -37
- data/lib/automation_object/state/blue_print_adapter/hook_actions/reset_screen.rb +0 -18
- data/lib/automation_object/state/blue_print_adapter/modal.rb +0 -26
- data/lib/automation_object/state/blue_print_adapter/screen.rb +0 -32
- data/lib/automation_object/state/blue_print_adapter/top.rb +0 -45
- data/lib/automation_object/step_definitions/action.rb +0 -21
- data/lib/automation_object/step_definitions/element/actions.rb +0 -87
- data/lib/automation_object/step_definitions/element/regex.rb +0 -24
- data/lib/automation_object/step_definitions/element/steps.rb +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 752355905e1e3e9177ad9e481b27abd8d0979076
|
4
|
+
data.tar.gz: e58e752b120609eb53030fc41c3ab5ccaee717b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a59cd4c3e1b7843e825752e6e8921c45620733a2092305ec6746e04720c2f6bf8bcbf2e8a694769a6ba2e19fcbb341a88fa662eb62068dab4cbd0998fa25e6e1
|
7
|
+
data.tar.gz: 8adbce64b6b3ac96cde758814d2a643d5c04b2af2d302edd0aff46ebe9a780891721bc320b5865c63a59547fbb846395eccb77a81dfb97b3c7359379c93b3c5c
|
data/lib/automation_object.rb
CHANGED
@@ -1,22 +1,33 @@
|
|
1
|
-
#
|
2
|
-
require 'awesome_print'
|
3
|
-
require 'ostruct'
|
4
|
-
require 'event_emitter'
|
5
|
-
require 'appium_lib'
|
6
|
-
require 'selenium-webdriver'
|
1
|
+
# frozen_string_literal: true
|
7
2
|
|
8
|
-
|
3
|
+
require_relative 'automation_object/helpers/kernel'
|
4
|
+
|
5
|
+
# Require Gems
|
6
|
+
# Ignore warning coming from third-party libraries
|
7
|
+
Kernel.suppress_warnings do
|
8
|
+
require 'awesome_print'
|
9
|
+
require 'ostruct'
|
10
|
+
require 'event_emitter'
|
11
|
+
require 'appium_lib'
|
12
|
+
require 'selenium-webdriver'
|
13
|
+
require 'colorize'
|
14
|
+
end
|
15
|
+
|
16
|
+
# Local Files
|
9
17
|
require_relative 'automation_object/version'
|
10
18
|
|
11
|
-
#Class method additions
|
19
|
+
# Class method additions
|
12
20
|
require_relative 'automation_object/helpers/string'
|
13
21
|
require_relative 'automation_object/helpers/hash'
|
14
22
|
|
15
|
-
#Core Framework
|
23
|
+
# Core Framework
|
16
24
|
require_relative 'automation_object/framework'
|
17
25
|
|
18
|
-
#Cucumber Step Definitions
|
26
|
+
# Cucumber Step Definitions
|
19
27
|
require_relative 'automation_object/step_definitions'
|
20
28
|
|
29
|
+
# Top level namespace
|
30
|
+
# AutomationObject is a dynamic DSL framework created by configurations that
|
31
|
+
# allow for UI automation using business logic
|
21
32
|
module AutomationObject
|
22
|
-
end
|
33
|
+
end
|
@@ -1,12 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_relative 'blue_print/hash_adapter'
|
2
3
|
require_relative 'blue_print/yaml_adapter'
|
3
4
|
|
4
5
|
module AutomationObject
|
5
|
-
#BluePrint Port, encapsulation of code required to parse and build composite data structure representing UI
|
6
|
-
#Provides for loading Hash/YAML, validates the resulting structure (throws errors), and a common
|
7
|
-
#interface for the rest of the code base to use.
|
6
|
+
# BluePrint Port, encapsulation of code required to parse and build composite data structure representing UI
|
7
|
+
# Provides for loading Hash/YAML, validates the resulting structure (throws errors), and a common
|
8
|
+
# interface for the rest of the code base to use.
|
8
9
|
module BluePrint
|
9
|
-
|
10
|
+
module_function
|
10
11
|
|
11
12
|
# Get method for BluePrint adapter const for composite BluePrint build
|
12
13
|
# Each adapter will implement common BluePrint interface
|
@@ -21,23 +22,23 @@ module AutomationObject
|
|
21
22
|
# @param adapter_name [String] name of adapter wanted for composite creation
|
22
23
|
def adapter=(adapter_name)
|
23
24
|
adapter_name = adapter_name.to_s
|
24
|
-
adapter_name << '_adapter' unless adapter_name
|
25
|
+
adapter_name << '_adapter' unless adapter_name =~ /_adapter$/
|
25
26
|
adapter_const = adapter_name.pascalize
|
26
27
|
|
27
|
-
@adapter = AutomationObject::BluePrint.const_get(
|
28
|
+
@adapter = AutomationObject::BluePrint.const_get(adapter_const.to_s)
|
28
29
|
end
|
29
30
|
|
30
31
|
# Adapters use the composite AutomationObject::BluePrint::Composite interfaces
|
31
32
|
# @return [AutomationObject::BluePrint::Composite::Top]
|
32
|
-
def
|
33
|
+
def create(blueprint_arg)
|
33
34
|
case blueprint_arg
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
when String
|
36
|
+
self.adapter = :yaml
|
37
|
+
when Hash
|
38
|
+
self.adapter = :hash
|
38
39
|
end
|
39
40
|
|
40
41
|
adapter.build(blueprint_arg)
|
41
42
|
end
|
42
43
|
end
|
43
|
-
end
|
44
|
+
end
|
@@ -1,28 +1,29 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
5
|
module AutomationObject
|
5
6
|
module BluePrint
|
6
7
|
module Composite
|
7
|
-
#AutomaticOnloadModal composite class, passing method to adapter only
|
8
|
-
#Hoping to improve code completion and standard interface where
|
9
|
-
#classes use this as a template to add additional adapters
|
8
|
+
# AutomaticOnloadModal composite class, passing method to adapter only
|
9
|
+
# Hoping to improve code completion and standard interface where
|
10
|
+
# classes use this as a template to add additional adapters
|
10
11
|
class AutomaticOnloadModal < Base
|
11
12
|
# @return [Symbol, nil]
|
12
13
|
def modal_name
|
13
|
-
|
14
|
+
adapter.modal_name
|
14
15
|
end
|
15
16
|
|
16
17
|
# @return [Integer]
|
17
18
|
def number_of_checks
|
18
|
-
|
19
|
+
adapter.number_of_checks
|
19
20
|
end
|
20
21
|
|
21
22
|
# @return [Boolean]
|
22
23
|
def close
|
23
|
-
|
24
|
+
adapter.close
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
28
|
-
end
|
29
|
+
end
|
@@ -1,11 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_relative '../../../../lib/automation_object/helpers/composite'
|
2
3
|
|
3
4
|
module AutomationObject
|
4
5
|
module BluePrint
|
5
6
|
module Composite
|
6
|
-
#This composite namespace is the interface contract for the rest of the application to rely on
|
7
|
-
#Adapters should implement the same classes and methods as the composite to achieve reliability
|
8
|
-
#with the rest of the application
|
7
|
+
# This composite namespace is the interface contract for the rest of the application to rely on
|
8
|
+
# Adapters should implement the same classes and methods as the composite to achieve reliability
|
9
|
+
# with the rest of the application
|
9
10
|
class Base
|
10
11
|
attr_accessor :adapter
|
11
12
|
|
@@ -15,4 +16,4 @@ module AutomationObject
|
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
|
-
end
|
19
|
+
end
|
@@ -1,23 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
5
|
module AutomationObject
|
5
6
|
module BluePrint
|
6
7
|
module Composite
|
7
|
-
#CustomMethod composite class, passing method to adapter only
|
8
|
-
#Hoping to improve code completion and standard interface where
|
9
|
-
#classes use this as a template to add additional adapters
|
8
|
+
# CustomMethod composite class, passing method to adapter only
|
9
|
+
# Hoping to improve code completion and standard interface where
|
10
|
+
# classes use this as a template to add additional adapters
|
10
11
|
class CustomMethod < Base
|
11
12
|
# @return [Symbol, nil]
|
12
13
|
def element_method
|
13
|
-
|
14
|
+
adapter.element_method
|
14
15
|
end
|
15
16
|
|
16
17
|
# @return [String, nil]
|
17
18
|
def evaluate
|
18
|
-
|
19
|
+
adapter.evaluate
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
23
|
-
end
|
24
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
5
|
require_relative 'hook'
|
@@ -9,12 +10,12 @@ require_relative 'helpers/element_helper'
|
|
9
10
|
module AutomationObject
|
10
11
|
module BluePrint
|
11
12
|
module Composite
|
12
|
-
#Element composite class, passing method to adapter only
|
13
|
-
#Hoping to improve code completion and standard interface where
|
14
|
-
#classes use this as a template to add additional adapters
|
13
|
+
# Element composite class, passing method to adapter only
|
14
|
+
# Hoping to improve code completion and standard interface where
|
15
|
+
# classes use this as a template to add additional adapters
|
15
16
|
class Element < Base
|
16
17
|
include ElementHelper
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
20
|
-
end
|
21
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
5
|
require_relative 'hook'
|
@@ -9,13 +10,13 @@ require_relative 'helpers/multiple_elements_helper'
|
|
9
10
|
module AutomationObject
|
10
11
|
module BluePrint
|
11
12
|
module Composite
|
12
|
-
#ElementArray composite class, passing method to adapter only
|
13
|
-
#Hoping to improve code completion and standard interface where
|
14
|
-
#classes use this as a template to add additional adapters
|
13
|
+
# ElementArray composite class, passing method to adapter only
|
14
|
+
# Hoping to improve code completion and standard interface where
|
15
|
+
# classes use this as a template to add additional adapters
|
15
16
|
class ElementArray < Base
|
16
17
|
include ElementHelper
|
17
18
|
include MultipleElementsHelper
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
21
|
-
end
|
22
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
5
|
require_relative 'hook'
|
@@ -9,18 +10,18 @@ require_relative 'helpers/multiple_elements_helper'
|
|
9
10
|
module AutomationObject
|
10
11
|
module BluePrint
|
11
12
|
module Composite
|
12
|
-
#ElementHash composite class, passing method to adapter only
|
13
|
-
#Hoping to improve code completion and standard interface where
|
14
|
-
#classes use this as a template to add additional adapters
|
13
|
+
# ElementHash composite class, passing method to adapter only
|
14
|
+
# Hoping to improve code completion and standard interface where
|
15
|
+
# classes use this as a template to add additional adapters
|
15
16
|
class ElementHash < Base
|
16
17
|
include ElementHelper
|
17
18
|
include MultipleElementsHelper
|
18
19
|
|
19
20
|
# @return [Symbol] element method to define element keys by
|
20
21
|
def define_elements_by
|
21
|
-
|
22
|
+
adapter.define_elements_by
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
26
|
-
end
|
27
|
+
end
|
@@ -1,33 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module AutomationObject
|
2
3
|
module BluePrint
|
3
4
|
module Composite
|
4
|
-
#Helper module for Element composite classes
|
5
|
+
# Helper module for Element composite classes
|
5
6
|
module ElementHelper
|
6
7
|
# @return [Array<Symbol, String>, nil] params as an array for driver find_element args
|
7
8
|
def selector_params
|
8
|
-
|
9
|
+
adapter.selector_params
|
9
10
|
end
|
10
11
|
|
11
12
|
# @return [Symbol, nil] element name of iframe element is in or nil if not
|
12
13
|
def in_iframe
|
13
|
-
|
14
|
+
adapter.in_iframe
|
14
15
|
end
|
15
16
|
|
16
17
|
# @return [Boolean] whether or not element is in iframe
|
17
18
|
def in_iframe?
|
18
|
-
|
19
|
+
adapter.in_iframe?
|
19
20
|
end
|
20
21
|
|
21
22
|
def method_hook?(name)
|
22
|
-
|
23
|
+
adapter.method_hook?(name)
|
23
24
|
end
|
24
25
|
|
25
26
|
# @return [Hash<Hook>] array of Hook that are defined under the element
|
26
27
|
def method_hooks
|
27
|
-
|
28
|
+
adapter.method_hooks
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
32
33
|
end
|
33
|
-
|
@@ -1,18 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module AutomationObject
|
2
3
|
module BluePrint
|
3
4
|
module Composite
|
4
|
-
#Helper module for multiple element composite classes
|
5
|
+
# Helper module for multiple element composite classes
|
5
6
|
module MultipleElementsHelper
|
6
7
|
# @return [Range, nil] gives range for limiting multiple elements or nil
|
7
8
|
def custom_range
|
8
|
-
|
9
|
+
adapter.custom_range
|
9
10
|
end
|
10
11
|
|
11
12
|
# @return [Symbol, nil] gives element method to remove duplicates on or nil
|
12
13
|
def remove_duplicates
|
13
|
-
|
14
|
+
adapter.remove_duplicates
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
|
-
end
|
19
|
+
end
|
@@ -1,31 +1,29 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
|
-
require_relative 'hook_action'
|
5
|
-
require_relative 'hook_element_requirements'
|
6
|
-
|
7
5
|
module AutomationObject
|
8
6
|
module BluePrint
|
9
7
|
module Composite
|
10
|
-
#Hook composite class, passing method to adapter only
|
11
|
-
#Hoping to improve code completion and standard interface where
|
12
|
-
#classes use this as a template to add additional adapters
|
8
|
+
# Hook composite class, passing method to adapter only
|
9
|
+
# Hoping to improve code completion and standard interface where
|
10
|
+
# classes use this as a template to add additional adapters
|
13
11
|
class Hook < Base
|
14
12
|
# @return [HookAction]
|
15
13
|
def before
|
16
|
-
|
14
|
+
adapter.before
|
17
15
|
end
|
18
16
|
|
19
17
|
# @return [HookAction]
|
20
18
|
def after
|
21
|
-
|
19
|
+
adapter.after
|
22
20
|
end
|
23
21
|
|
24
22
|
# @return [Array<HookElementRequirements>] array of element requirements
|
25
23
|
def live?
|
26
|
-
|
24
|
+
adapter.live?
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
31
|
-
end
|
29
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Require parent class
|
2
3
|
require_relative 'base'
|
3
4
|
|
4
5
|
require_relative 'hook_element_requirements'
|
@@ -6,79 +7,79 @@ require_relative 'hook_element_requirements'
|
|
6
7
|
module AutomationObject
|
7
8
|
module BluePrint
|
8
9
|
module Composite
|
9
|
-
#HookAction composite class, passing method to adapter only
|
10
|
-
#Hoping to improve code completion and standard interface where
|
11
|
-
#classes use this as a template to add additional adapters
|
10
|
+
# HookAction composite class, passing method to adapter only
|
11
|
+
# Hoping to improve code completion and standard interface where
|
12
|
+
# classes use this as a template to add additional adapters
|
12
13
|
class HookAction < Base
|
13
|
-
#Get the order to run the hook in
|
14
|
+
# Get the order to run the hook in
|
14
15
|
# @return [Array<Symbol>] list of hook methods to run in given order
|
15
16
|
def hook_order
|
16
|
-
|
17
|
+
adapter.hook_order
|
17
18
|
end
|
18
19
|
|
19
|
-
#Get length of hook actions
|
20
|
+
# Get length of hook actions
|
20
21
|
# @return [Integer] length of hook actions
|
21
22
|
def length
|
22
|
-
|
23
|
+
adapter.length
|
23
24
|
end
|
24
25
|
|
25
|
-
#See if hook actions are empty
|
26
|
+
# See if hook actions are empty
|
26
27
|
# @return [Boolean] if hook actions are empty
|
27
28
|
def empty?
|
28
|
-
|
29
|
+
adapter.empty?
|
29
30
|
end
|
30
31
|
|
31
32
|
# @return [Symbol, nil] screen to change to
|
32
33
|
def change_screen
|
33
|
-
|
34
|
+
adapter.change_screen
|
34
35
|
end
|
35
36
|
|
36
37
|
# @return [Symbol, nil] new screen
|
37
38
|
def new_screen
|
38
|
-
|
39
|
+
adapter.new_screen
|
39
40
|
end
|
40
41
|
|
41
42
|
# @return [Boolean]
|
42
43
|
def close_screen
|
43
|
-
|
44
|
+
adapter.close_screen
|
44
45
|
end
|
45
46
|
|
46
47
|
# @return [Boolean]
|
47
48
|
def close_modal
|
48
|
-
|
49
|
+
adapter.close_modal
|
49
50
|
end
|
50
51
|
|
51
52
|
# @return [Boolean]
|
52
53
|
def change_to_previous_screen
|
53
|
-
|
54
|
+
adapter.change_to_previous_screen
|
54
55
|
end
|
55
56
|
|
56
57
|
# @return [Symbol, nil]
|
57
58
|
def show_modal
|
58
|
-
|
59
|
+
adapter.show_modal
|
59
60
|
end
|
60
61
|
|
61
62
|
# @return [Array]
|
62
63
|
def possible_screen_changes
|
63
|
-
|
64
|
+
adapter.possible_screen_changes
|
64
65
|
end
|
65
66
|
|
66
|
-
|
67
|
+
# @return [Boolean] reset the screen?
|
67
68
|
def reset_screen
|
68
|
-
|
69
|
+
adapter.reset_screen
|
69
70
|
end
|
70
71
|
|
71
|
-
|
72
|
+
# @return [Numeric] amount of time to sleep
|
72
73
|
def sleep
|
73
|
-
|
74
|
+
adapter.sleep
|
74
75
|
end
|
75
76
|
|
76
|
-
#Custom method for array of children instead of Hash
|
77
|
+
# Custom method for array of children instead of Hash
|
77
78
|
# @return [Array<HookElementRequirements>] array of wait for element children
|
78
79
|
def wait_for_elements
|
79
|
-
|
80
|
+
adapter.wait_for_elements
|
80
81
|
end
|
81
82
|
end
|
82
83
|
end
|
83
84
|
end
|
84
|
-
end
|
85
|
+
end
|