Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/core/device_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@ def create_single_device(case_role, role_app, case_caps)
url, udid, options = setup_path_to_device(config_device)

# Get capabilities from config and case, and replace existing udid if it is provided
@server_port = convert_value(config_device["serverPort"]).to_i if config_device.key?("serverPort")
config_caps = {}
if config_device.key?("capabilities") && !config_device["capabilities"].nil?
config_caps = convert_yaml(config_device["capabilities"])
log_info("Role '#{case_role}': Adding capabilities from config: #{config_caps}")
udid = config_caps["udid"] if config_caps.key?("udid")
@driver_port = config_caps["systemPort"].to_i if config_caps.key?("systemPort")
@driver_port = config_caps["wdaLocalPort"].to_i if config_caps.key?("wdaLocalPort")
end
if !case_caps.empty?
log_info("Role '#{case_role}': Adding capabilities from case: #{case_caps}")
udid = case_caps["udid"] if case_caps.key?("udid")
@driver_port = case_caps["systemPort"].to_i if case_caps.key?("systemPort")
@driver_port = case_caps["wdaLocalPort"].to_i if case_caps.key?("wdaLocalPort")
end

# Create virtual device for the role
Expand Down
6 changes: 3 additions & 3 deletions lib/core/types_control_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
module ControlFlowTypes
# execute a case
def case_handler(action, _case)
run(action["Value"], get_parent_params(action))
log_info("Finished case #{action["Value"]}, resuming parent case #{_case}")
run(convert_value(action["Value"]), get_parent_params(action))
log_info("Finished case #{convert_value(action["Value"])}, resuming parent case #{_case}")
end

# execute a case that can be run in parallel with another case
def parallel_case_handler(action, case_threads, max_parallel_cases)
case_name = action["Value"]
case_name = convert_value(action["Value"])
unless case_threads.empty?
alive_threads = case_threads.keys.each.map {|t| t.alive?}.length
if max_parallel_cases <= alive_threads
Expand Down