automation_object 0.0.4 → 0.5.0
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 +14 -72
- data/lib/automation_object/blue_print.rb +37 -100
- data/lib/automation_object/blue_print/composite/automatic_onload_modal.rb +28 -0
- data/lib/automation_object/blue_print/composite/base.rb +18 -0
- data/lib/automation_object/blue_print/composite/custom_method.rb +23 -0
- data/lib/automation_object/blue_print/composite/element.rb +20 -0
- data/lib/automation_object/blue_print/composite/element_array.rb +21 -0
- data/lib/automation_object/blue_print/composite/element_hash.rb +26 -0
- data/lib/automation_object/blue_print/composite/helpers/element_helper.rb +33 -0
- data/lib/automation_object/blue_print/composite/helpers/multiple_elements_helper.rb +18 -0
- data/lib/automation_object/blue_print/composite/hook.rb +31 -0
- data/lib/automation_object/blue_print/composite/hook_action.rb +84 -0
- data/lib/automation_object/blue_print/composite/hook_element_requirements.rb +39 -0
- data/lib/automation_object/blue_print/composite/modal.rb +56 -0
- data/lib/automation_object/blue_print/composite/screen.rb +61 -0
- data/lib/automation_object/blue_print/composite/top.rb +51 -0
- data/lib/automation_object/blue_print/composite/view.rb +48 -0
- data/lib/automation_object/blue_print/hash_adapter.rb +17 -0
- data/lib/automation_object/blue_print/hash_adapter/automatic_onload_modal.rb +35 -0
- data/lib/automation_object/blue_print/hash_adapter/composite.rb +93 -0
- data/lib/automation_object/blue_print/hash_adapter/custom_method.rb +30 -0
- data/lib/automation_object/blue_print/hash_adapter/element.rb +34 -0
- data/lib/automation_object/blue_print/hash_adapter/element_array.rb +36 -0
- data/lib/automation_object/blue_print/hash_adapter/element_hash.rb +43 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/element_helper.rb +59 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/multiple_elements_helper.rb +35 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb +26 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validation_helper.rb +99 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate.rb +23 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_allowed_keys.rb +31 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_element_presence_of.rb +55 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_instance_of.rb +39 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_modal_presence_of.rb +54 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_presence_of.rb +36 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_screen_presence_of.rb +55 -0
- data/lib/automation_object/blue_print/hash_adapter/helpers/validators/validate_view_presence_of.rb +52 -0
- data/lib/automation_object/blue_print/hash_adapter/hook.rb +35 -0
- data/lib/automation_object/blue_print/hash_adapter/hook_action.rb +134 -0
- data/lib/automation_object/blue_print/hash_adapter/hook_element_requirements.rb +64 -0
- data/lib/automation_object/blue_print/hash_adapter/modal.rb +52 -0
- data/lib/automation_object/blue_print/hash_adapter/screen.rb +91 -0
- data/lib/automation_object/blue_print/hash_adapter/top.rb +63 -0
- data/lib/automation_object/blue_print/hash_adapter/view.rb +29 -0
- data/lib/automation_object/blue_print/helpers/file_helper.rb +38 -0
- data/lib/automation_object/blue_print/yaml_adapter.rb +50 -0
- data/lib/automation_object/driver.rb +44 -0
- data/lib/automation_object/driver/appium_adapter/driver.rb +150 -0
- data/lib/automation_object/driver/appium_adapter/element.rb +118 -0
- data/lib/automation_object/driver/base.rb +11 -0
- data/lib/automation_object/driver/driver.rb +69 -245
- data/lib/automation_object/driver/element.rb +51 -210
- data/lib/automation_object/driver/helpers/selenium_driver_helper.rb +41 -0
- data/lib/automation_object/driver/helpers/selenium_element_helper.rb +138 -0
- data/lib/automation_object/driver/nokogiri_adapter/backup/driver.rb +83 -0
- data/lib/automation_object/driver/nokogiri_adapter/backup/element.rb +66 -0
- data/lib/automation_object/driver/nokogiri_adapter/backup/form.rb +29 -0
- data/lib/automation_object/driver/nokogiri_adapter/backup/helpers/driver_element_helper.rb +52 -0
- data/lib/automation_object/driver/nokogiri_adapter/backup/session.rb +115 -0
- data/lib/automation_object/driver/nokogiri_adapter/driver.rb +104 -0
- data/lib/automation_object/driver/nokogiri_adapter/element.rb +85 -0
- data/lib/automation_object/driver/nokogiri_adapter/error.rb +17 -0
- data/lib/automation_object/driver/selenium_adapter/driver.rb +143 -0
- data/lib/automation_object/driver/selenium_adapter/element.rb +116 -0
- data/lib/automation_object/dsl.rb +33 -0
- data/lib/automation_object/dsl/blue_print_adapter.rb +16 -0
- data/lib/automation_object/dsl/blue_print_adapter/composite.rb +54 -0
- data/lib/automation_object/dsl/blue_print_adapter/element.rb +14 -0
- data/lib/automation_object/dsl/blue_print_adapter/element_array.rb +14 -0
- data/lib/automation_object/dsl/blue_print_adapter/element_hash.rb +14 -0
- data/lib/automation_object/dsl/blue_print_adapter/modal.rb +23 -0
- data/lib/automation_object/dsl/blue_print_adapter/screen.rb +26 -0
- data/lib/automation_object/dsl/blue_print_adapter/top.rb +19 -0
- data/lib/automation_object/dsl/models.rb +18 -0
- data/lib/automation_object/dsl/proxies/element.rb +16 -0
- data/lib/automation_object/dsl/proxies/element_array.rb +16 -0
- data/lib/automation_object/dsl/proxies/element_hash.rb +16 -0
- data/lib/automation_object/dsl/proxies/helpers/composite_helper.rb +74 -0
- data/lib/automation_object/dsl/proxies/modal.rb +17 -0
- data/lib/automation_object/dsl/proxies/screen.rb +17 -0
- data/lib/automation_object/dsl/proxies/top.rb +17 -0
- data/lib/automation_object/framework.rb +79 -386
- data/lib/automation_object/helpers/composite.rb +95 -0
- data/lib/automation_object/helpers/composite_hook.rb +46 -0
- data/lib/automation_object/helpers/hash.rb +15 -0
- data/lib/automation_object/helpers/reflection_helper.rb +28 -0
- data/lib/automation_object/helpers/string.rb +27 -0
- data/lib/automation_object/proxies/mutex_proxy.rb +63 -0
- data/lib/automation_object/proxies/proxy.rb +20 -0
- data/lib/automation_object/proxies/throttle_proxy.rb +57 -0
- data/lib/automation_object/state.rb +37 -0
- data/lib/automation_object/state/blue_print_adapter.rb +16 -0
- data/lib/automation_object/state/blue_print_adapter/composite.rb +65 -0
- data/lib/automation_object/state/blue_print_adapter/element.rb +20 -0
- data/lib/automation_object/state/blue_print_adapter/element_array.rb +25 -0
- data/lib/automation_object/state/blue_print_adapter/element_hash.rb +31 -0
- data/lib/automation_object/state/blue_print_adapter/element_proxy.rb +28 -0
- data/lib/automation_object/state/blue_print_adapter/helpers/element_helper.rb +31 -0
- data/lib/automation_object/state/blue_print_adapter/helpers/screen_manager.rb +137 -0
- data/lib/automation_object/state/blue_print_adapter/helpers/window.rb +39 -0
- data/lib/automation_object/state/blue_print_adapter/hook.rb +56 -0
- data/lib/automation_object/state/blue_print_adapter/hook_action.rb +33 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/action_loop.rb +35 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/change_screen.rb +26 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/change_to_previous_screen.rb +21 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/close_modal.rb +31 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/close_screen.rb +19 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/element_requirement.rb +34 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/new_screen.rb +37 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/possible_screen_changes.rb +21 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/reset_screen.rb +18 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/show_modal.rb +26 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/sleep.rb +18 -0
- data/lib/automation_object/state/blue_print_adapter/hook_actions/wait_for_elements.rb +20 -0
- data/lib/automation_object/state/blue_print_adapter/modal.rb +26 -0
- data/lib/automation_object/state/blue_print_adapter/screen.rb +32 -0
- data/lib/automation_object/state/blue_print_adapter/top.rb +45 -0
- data/lib/automation_object/state/error.rb +24 -0
- data/lib/automation_object/state/session.rb +38 -0
- data/lib/automation_object/step_definitions.rb +14 -0
- data/lib/automation_object/step_definitions/action.rb +21 -0
- data/lib/automation_object/step_definitions/cache.rb +23 -0
- data/lib/automation_object/step_definitions/element/actions.rb +87 -0
- data/lib/automation_object/step_definitions/element/regex.rb +24 -0
- data/lib/automation_object/step_definitions/element/steps.rb +67 -0
- data/lib/automation_object/step_definitions/parse.rb +39 -0
- data/lib/automation_object/version.rb +1 -1
- metadata +194 -110
- data/lib/automation_object/blue_print_validation/base_validation.rb +0 -44
- data/lib/automation_object/blue_print_validation/common_methods.rb +0 -106
- data/lib/automation_object/blue_print_validation/element_validation.rb +0 -198
- data/lib/automation_object/blue_print_validation/formatted_errors.rb +0 -41
- data/lib/automation_object/blue_print_validation/hook_validation.rb +0 -393
- data/lib/automation_object/blue_print_validation/key_value_constants.rb +0 -75
- data/lib/automation_object/blue_print_validation/modal_validation.rb +0 -37
- data/lib/automation_object/blue_print_validation/screen_modal_common_methods.rb +0 -119
- data/lib/automation_object/blue_print_validation/screen_validation.rb +0 -21
- data/lib/automation_object/blue_print_validation/validation_object.rb +0 -32
- data/lib/automation_object/driver/anonymous.rb +0 -27
- data/lib/automation_object/element/element.rb +0 -145
- data/lib/automation_object/element/element_array.rb +0 -12
- data/lib/automation_object/element/element_cell.rb +0 -126
- data/lib/automation_object/element/element_group.rb +0 -33
- data/lib/automation_object/element/element_hash.rb +0 -25
- data/lib/automation_object/element/element_helpers.rb +0 -29
- data/lib/automation_object/element/element_methods.rb +0 -134
- data/lib/automation_object/element/elements_helpers.rb +0 -204
- data/lib/automation_object/framework/events.rb +0 -8
- data/lib/automation_object/framework/helpers.rb +0 -101
- data/lib/automation_object/framework/print_objects.rb +0 -67
- data/lib/automation_object/framework/screen_monitor.rb +0 -55
- data/lib/automation_object/framework/screen_routing.rb +0 -310
- data/lib/automation_object/framework/window_helpers.rb +0 -181
- data/lib/automation_object/hash.rb +0 -6
- data/lib/automation_object/hook_helpers.rb +0 -27
- data/lib/automation_object/logger.rb +0 -179
- data/lib/automation_object/object.rb +0 -22
- data/lib/automation_object/screen/modal.rb +0 -8
- data/lib/automation_object/screen/screen.rb +0 -209
- data/lib/automation_object/screen/screen_hook_helpers.rb +0 -319
- data/lib/automation_object/screen/screen_modal_helpers.rb +0 -101
- data/lib/automation_object/screen/screen_prompt_helpers.rb +0 -21
- data/lib/automation_object/screen/screen_window_helpers.rb +0 -149
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bac9e2b6a0367c100fc66c0541dbea6800308e28
|
|
4
|
+
data.tar.gz: 3b16e66a40739ac2cb865664daf3aaf7aebe97ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7aeb3799b980a4d0f68b649c0441ddda946ee3a1cdb8049b711259cdb35cb025db681fa662b47f3e2908afa86015ceeecda8105fc4433975211a14f2a5714b35
|
|
7
|
+
data.tar.gz: 6d93962d0df0434dd34fb238bb7fa5c8ab10610df17aea9abeb128c3b221e5fce7611b38ee2f97e30ceb20f756abd5b796530e8e757fd2d46ae6a28463dabcb4
|
data/lib/automation_object.rb
CHANGED
|
@@ -1,80 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
#Third-Party
|
|
4
|
-
require 'event_emitter'
|
|
5
|
-
require 'thread'
|
|
6
|
-
require 'colorize'
|
|
1
|
+
#Gems
|
|
7
2
|
require 'awesome_print'
|
|
8
|
-
require '
|
|
9
|
-
require '
|
|
10
|
-
require '
|
|
11
|
-
require '
|
|
12
|
-
|
|
13
|
-
#Convience methods
|
|
14
|
-
require_relative 'automation_object/hash'
|
|
15
|
-
require_relative 'automation_object/object'
|
|
16
|
-
require_relative 'automation_object/logger'
|
|
17
|
-
|
|
18
|
-
#Driver Object that has Mutex for keeping Thread Safe!
|
|
19
|
-
require_relative 'automation_object/driver/anonymous'
|
|
20
|
-
require_relative 'automation_object/driver/element'
|
|
21
|
-
require_relative 'automation_object/driver/driver'
|
|
22
|
-
|
|
23
|
-
#HookHelper Module
|
|
24
|
-
require_relative 'automation_object/hook_helpers'
|
|
3
|
+
require 'ostruct'
|
|
4
|
+
require 'event_emitter'
|
|
5
|
+
require 'appium_lib'
|
|
6
|
+
require 'selenium-webdriver'
|
|
25
7
|
|
|
26
|
-
#
|
|
27
|
-
require_relative 'automation_object/
|
|
28
|
-
require_relative 'automation_object/blue_print_validation/formatted_errors'
|
|
29
|
-
require_relative 'automation_object/blue_print_validation/common_methods'
|
|
30
|
-
require_relative 'automation_object/blue_print_validation/base_validation'
|
|
31
|
-
require_relative 'automation_object/blue_print_validation/screen_modal_common_methods'
|
|
32
|
-
require_relative 'automation_object/blue_print_validation/screen_validation'
|
|
33
|
-
require_relative 'automation_object/blue_print_validation/modal_validation'
|
|
34
|
-
require_relative 'automation_object/blue_print_validation/element_validation'
|
|
35
|
-
require_relative 'automation_object/blue_print_validation/hook_validation'
|
|
36
|
-
require_relative 'automation_object/blue_print_validation/validation_object'
|
|
8
|
+
#Local Files
|
|
9
|
+
require_relative 'automation_object/version'
|
|
37
10
|
|
|
38
|
-
#
|
|
39
|
-
require_relative 'automation_object/
|
|
11
|
+
#Class method additions
|
|
12
|
+
require_relative 'automation_object/helpers/string'
|
|
13
|
+
require_relative 'automation_object/helpers/hash'
|
|
40
14
|
|
|
41
|
-
#Framework
|
|
42
|
-
require_relative 'automation_object/framework/helpers'
|
|
43
|
-
require_relative 'automation_object/framework/window_helpers'
|
|
44
|
-
require_relative 'automation_object/framework/print_objects'
|
|
45
|
-
require_relative 'automation_object/framework/screen_routing'
|
|
46
|
-
require_relative 'automation_object/framework/screen_monitor'
|
|
47
|
-
require_relative 'automation_object/framework/events'
|
|
15
|
+
#Core Framework
|
|
48
16
|
require_relative 'automation_object/framework'
|
|
49
17
|
|
|
50
|
-
#
|
|
51
|
-
require_relative 'automation_object/
|
|
52
|
-
require_relative 'automation_object/screen/screen_hook_helpers'
|
|
53
|
-
require_relative 'automation_object/screen/screen_prompt_helpers'
|
|
54
|
-
require_relative 'automation_object/screen/screen_modal_helpers'
|
|
55
|
-
require_relative 'automation_object/screen/screen'
|
|
56
|
-
require_relative 'automation_object/screen/modal'
|
|
57
|
-
|
|
58
|
-
#Element/ElementHash/ElementArray Objects
|
|
59
|
-
require_relative 'automation_object/element/element_helpers'
|
|
60
|
-
require_relative 'automation_object/element/elements_helpers'
|
|
61
|
-
require_relative 'automation_object/element/element_methods'
|
|
62
|
-
require_relative 'automation_object/element/element'
|
|
63
|
-
require_relative 'automation_object/element/element_array'
|
|
64
|
-
require_relative 'automation_object/element/element_hash'
|
|
65
|
-
|
|
66
|
-
#ElementGroup
|
|
67
|
-
require_relative 'automation_object/element/element_group'
|
|
68
|
-
require_relative 'automation_object/element/element_cell'
|
|
18
|
+
#Cucumber Step Definitions
|
|
19
|
+
require_relative 'automation_object/step_definitions'
|
|
69
20
|
|
|
70
21
|
module AutomationObject
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def self.debug_mode
|
|
74
|
-
@@debug_mode
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def self.debug_mode=(value)
|
|
78
|
-
@@debug_mode = value
|
|
79
|
-
end
|
|
80
|
-
end
|
|
22
|
+
end
|
|
@@ -1,106 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
#Static
|
|
4
|
-
@@max_folder_depth = 10
|
|
5
|
-
@@base_directory = nil
|
|
6
|
-
@@validate_blueprint = false
|
|
7
|
-
|
|
8
|
-
def self.max_folder_depth
|
|
9
|
-
@@max_folder_depth
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def self.max_folder_depth=(value)
|
|
13
|
-
@@max_folder_depth = value
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def self.base_directory
|
|
17
|
-
@@base_directory
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def self.base_directory=(value)
|
|
21
|
-
@@base_directory = value
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def self.validate_blueprint
|
|
25
|
-
@@validate_blueprint
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def self.validate_blueprint=(value)
|
|
29
|
-
@@validate_blueprint = value
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
#Instance
|
|
33
|
-
def initialize(path)
|
|
34
|
-
full_path = path
|
|
35
|
-
full_path = File.join(@@base_directory, path) if @@base_directory
|
|
36
|
-
|
|
37
|
-
unless File.directory?(full_path)
|
|
38
|
-
raise ArgumentError, "Blue prints directory doesn't exist: #{full_path}"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
@configuration = Hash.new
|
|
42
|
-
self.merge_directory(full_path)
|
|
43
|
-
|
|
44
|
-
if @@validate_blueprint
|
|
45
|
-
BluePrintValidation::ValidationObject.new(self)
|
|
46
|
-
end
|
|
1
|
+
require_relative 'blue_print/hash_adapter'
|
|
2
|
+
require_relative 'blue_print/yaml_adapter'
|
|
47
3
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
4
|
+
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.
|
|
8
|
+
module BluePrint
|
|
9
|
+
extend self
|
|
10
|
+
|
|
11
|
+
# Get method for BluePrint adapter const for composite BluePrint build
|
|
12
|
+
# Each adapter will implement common BluePrint interface
|
|
13
|
+
# @return [AutomationObject::BluePrint::YamlAdapter, AutomationObject::BluePrint::HashAdapter]
|
|
14
|
+
def adapter
|
|
15
|
+
return @adapter if @adapter
|
|
16
|
+
self.adapter = :hash
|
|
17
|
+
@adapter
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Sets adapter const will append _adapter if needed
|
|
21
|
+
# @param adapter_name [String] name of adapter wanted for composite creation
|
|
22
|
+
def adapter=(adapter_name)
|
|
23
|
+
adapter_name = adapter_name.to_s
|
|
24
|
+
adapter_name << '_adapter' unless adapter_name.match(/_adapter$/)
|
|
25
|
+
adapter_const = adapter_name.pascalize
|
|
26
|
+
|
|
27
|
+
@adapter = AutomationObject::BluePrint.const_get("#{adapter_const}")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Adapters use the composite AutomationObject::BluePrint::Composite interfaces
|
|
31
|
+
# @return [AutomationObject::BluePrint::Composite::Top]
|
|
32
|
+
def new(blueprint_arg)
|
|
33
|
+
case blueprint_arg
|
|
34
|
+
when String
|
|
35
|
+
self.adapter = :yaml
|
|
36
|
+
when Hash
|
|
37
|
+
self.adapter = :hash
|
|
73
38
|
end
|
|
74
39
|
|
|
75
|
-
|
|
76
|
-
self[key] = value
|
|
77
|
-
}
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
def is_yaml_file?(file_path)
|
|
81
|
-
return (file_path.match(/\.ya?ml$/)) ? true : false
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def merge_views
|
|
85
|
-
return unless self['screens'].is_a?(Hash)
|
|
86
|
-
return unless self['views'].is_a?(Hash)
|
|
87
|
-
|
|
88
|
-
self['screens'].each { |screen_name, screen_configuration|
|
|
89
|
-
next unless screen_configuration.is_a?(Hash)
|
|
90
|
-
next unless screen_configuration['included_views'].is_a?(Array)
|
|
91
|
-
|
|
92
|
-
screen_configuration['elements'] = Hash.new unless screen_configuration['elements'].class == Hash
|
|
93
|
-
|
|
94
|
-
screen_configuration['included_views'].each { |view|
|
|
95
|
-
next unless self['views'][view].is_a?(Hash)
|
|
96
|
-
self['views'][view]['elements'] = Hash.new unless self['views'][view]['elements'].is_a?(Hash)
|
|
97
|
-
screen_configuration = screen_configuration.deep_merge(self['views'][view])
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
self['screens'][screen_name] = screen_configuration
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
self.delete('views')
|
|
40
|
+
adapter.build(blueprint_arg)
|
|
104
41
|
end
|
|
105
42
|
end
|
|
106
43
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#Require parent class
|
|
2
|
+
require_relative 'base'
|
|
3
|
+
|
|
4
|
+
module AutomationObject
|
|
5
|
+
module BluePrint
|
|
6
|
+
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
|
|
10
|
+
class AutomaticOnloadModal < Base
|
|
11
|
+
# @return [Symbol, nil]
|
|
12
|
+
def modal_name
|
|
13
|
+
self.adapter.modal_name
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
def number_of_checks
|
|
18
|
+
self.adapter.number_of_checks
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [Boolean]
|
|
22
|
+
def close
|
|
23
|
+
self.adapter.close
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require_relative '../../../../lib/automation_object/helpers/composite'
|
|
2
|
+
|
|
3
|
+
module AutomationObject
|
|
4
|
+
module BluePrint
|
|
5
|
+
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
|
|
9
|
+
class Base
|
|
10
|
+
attr_accessor :adapter
|
|
11
|
+
|
|
12
|
+
def initialize(adapter_object)
|
|
13
|
+
self.adapter = adapter_object
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#Require parent class
|
|
2
|
+
require_relative 'base'
|
|
3
|
+
|
|
4
|
+
module AutomationObject
|
|
5
|
+
module BluePrint
|
|
6
|
+
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
|
|
10
|
+
class CustomMethod < Base
|
|
11
|
+
# @return [Symbol, nil]
|
|
12
|
+
def element_method
|
|
13
|
+
self.adapter.element_method
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
def evaluate
|
|
18
|
+
self.adapter.evaluate
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#Require parent class
|
|
2
|
+
require_relative 'base'
|
|
3
|
+
|
|
4
|
+
require_relative 'hook'
|
|
5
|
+
require_relative 'custom_method'
|
|
6
|
+
|
|
7
|
+
require_relative 'helpers/element_helper'
|
|
8
|
+
|
|
9
|
+
module AutomationObject
|
|
10
|
+
module BluePrint
|
|
11
|
+
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
|
|
15
|
+
class Element < Base
|
|
16
|
+
include ElementHelper
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#Require parent class
|
|
2
|
+
require_relative 'base'
|
|
3
|
+
|
|
4
|
+
require_relative 'hook'
|
|
5
|
+
|
|
6
|
+
require_relative 'helpers/element_helper'
|
|
7
|
+
require_relative 'helpers/multiple_elements_helper'
|
|
8
|
+
|
|
9
|
+
module AutomationObject
|
|
10
|
+
module BluePrint
|
|
11
|
+
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
|
|
15
|
+
class ElementArray < Base
|
|
16
|
+
include ElementHelper
|
|
17
|
+
include MultipleElementsHelper
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#Require parent class
|
|
2
|
+
require_relative 'base'
|
|
3
|
+
|
|
4
|
+
require_relative 'hook'
|
|
5
|
+
|
|
6
|
+
require_relative 'helpers/element_helper'
|
|
7
|
+
require_relative 'helpers/multiple_elements_helper'
|
|
8
|
+
|
|
9
|
+
module AutomationObject
|
|
10
|
+
module BluePrint
|
|
11
|
+
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
|
|
15
|
+
class ElementHash < Base
|
|
16
|
+
include ElementHelper
|
|
17
|
+
include MultipleElementsHelper
|
|
18
|
+
|
|
19
|
+
# @return [Symbol] element method to define element keys by
|
|
20
|
+
def define_elements_by
|
|
21
|
+
return self.adapter.define_elements_by
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module AutomationObject
|
|
2
|
+
module BluePrint
|
|
3
|
+
module Composite
|
|
4
|
+
#Helper module for Element composite classes
|
|
5
|
+
module ElementHelper
|
|
6
|
+
# @return [Array<Symbol, String>, nil] params as an array for driver find_element args
|
|
7
|
+
def selector_params
|
|
8
|
+
self.adapter.selector_params
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# @return [Symbol, nil] element name of iframe element is in or nil if not
|
|
12
|
+
def in_iframe
|
|
13
|
+
self.adapter.in_iframe
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# @return [Boolean] whether or not element is in iframe
|
|
17
|
+
def in_iframe?
|
|
18
|
+
self.adapter.in_iframe?
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def method_hook?(name)
|
|
22
|
+
self.adapter.method_hook?(name)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @return [Hash<Hook>] array of Hook that are defined under the element
|
|
26
|
+
def method_hooks
|
|
27
|
+
self.adapter.method_hooks
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module AutomationObject
|
|
2
|
+
module BluePrint
|
|
3
|
+
module Composite
|
|
4
|
+
#Helper module for multiple element composite classes
|
|
5
|
+
module MultipleElementsHelper
|
|
6
|
+
# @return [Range, nil] gives range for limiting multiple elements or nil
|
|
7
|
+
def custom_range
|
|
8
|
+
self.adapter.custom_range
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# @return [Symbol, nil] gives element method to remove duplicates on or nil
|
|
12
|
+
def remove_duplicates
|
|
13
|
+
self.adapter.remove_duplicates
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|