Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.2.3 #573

Merged
merged 47 commits into from
Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6c589b5
Merge branch 'release/2.2.2' into develop
jmoody Oct 13, 2016
3e2aa42
Spec: increase timeout to avoid flickering tests
jmoody Oct 13, 2016
a95fa15
Doc: fix typo in CHANGELOG for DeviceAgent version
jmoody Oct 13, 2016
7d700be
Gem: patch awesome_print for BasicObject
jmoody Oct 24, 2016
ce2915e
Merge pull request #559 from calabash/feature/patch-awesome-print-Ker…
jmoody Oct 25, 2016
28c32ea
Turns enter text input parameter to string for numeric keyboards
jescriba Oct 26, 2016
43a842c
Merge pull request #560 from calabash/fix/keyboard-enter-text-numeric
jmoody Oct 27, 2016
e1c72e5
Gem: remove rb-readline developer dependency
jmoody Oct 27, 2016
2da3f6f
Xcode: support Xcode 8.2
jmoody Nov 15, 2016
6ee3bfa
Testing some portuguese translations
Nov 16, 2016
792647a
Removed logging
Nov 17, 2016
1e1c69f
Translated alert titles to portuguese
Nov 17, 2016
77d0f25
Removed iOS 10 translation
Nov 18, 2016
9ee0e7d
Uncomment line that don't work in debug mode
Nov 21, 2016
7dae582
Removed wrong added char
Nov 21, 2016
ca15508
Merge pull request #563 from oscartanner/develop
jmoody Nov 22, 2016
247cf10
Spec: remove flicking UIAutomation example
jmoody Nov 22, 2016
870c3a1
Merge pull request #561 from calabash/feature/xcode-8.2-support
jmoody Nov 22, 2016
06de907
App: fix TrueType font extension to avoid otool failures
jmoody Nov 25, 2016
c81b89e
Merge pull request #565 from calabash/feature/fix-font-file-extension
jmoody Nov 25, 2016
c325b65
Rake: device_agent:build ensures valid CoreSimulatorService
jmoody Nov 25, 2016
59b5402
CLI: simctl tail shows all simulator logs
jmoody Nov 29, 2016
dc86eba
Merge pull request #566 from calabash/feature/simctl-tail-shows-all-s…
jmoody Nov 29, 2016
5a5bb84
DA:Client: add code comment about wait_for_view_with_text
jmoody Nov 30, 2016
90d2321
Jenkins: ensure the correct CoreSimulatorService is loaded
jmoody Nov 30, 2016
12c9afc
Spec: remove SimControl/Simctl comparison example
jmoody Nov 30, 2016
c0df9be
Spec: use default simulator for CoreSim integration tests
jmoody Nov 30, 2016
907d7b2
Spec: use default simulator for simctl integration examples
jmoody Nov 30, 2016
105e216
Merge pull request #568 from calabash/feature/load-CoreSimulatorServi…
jmoody Nov 30, 2016
25d3c99
DA:Client: remove legacy API
jmoody Nov 30, 2016
d42fb65
DA:Client: increase install timeout to 90 seconds
jmoody Nov 30, 2016
602e321
DA:Client: increase HTTP timeout to 20 seconds
jmoody Nov 30, 2016
c083f59
Merge pull request #569 from calabash/feature/increase-DeviceAgent-ti…
jmoody Nov 30, 2016
191e82c
DA:Client: launch AUT with args and environment
jmoody Nov 30, 2016
a5ad39b
DA:IDM: CODE_SIGN_IDENTITY is not longer required
jmoody Nov 30, 2016
bcba8da
Merge pull request #570 from calabash/feature/iOSDeviceManager-can-ch…
jmoody Nov 30, 2016
607abea
Merge pull request #567 from calabash/feature/DeviceAgent-can-launch-…
jmoody Nov 30, 2016
8d247a1
Spec: increase Simctl#wait_for_shutdown timeout
jmoody Nov 30, 2016
092dea7
DA:Client: guard against nil launch args and environment
jmoody Dec 1, 2016
1450dc0
Merge pull request #571 from calabash/feature/stabilize-simulator-exa…
jmoody Dec 1, 2016
c8ced1b
DA:Client: ensure strings are passed to enter_text
jmoody Dec 1, 2016
1606e36
DA:IDM: location of the device manager logs has changed
jmoody Dec 1, 2016
7a6c130
DeviceAgent: update to 1.0.3 stack
jmoody Dec 2, 2016
ab2ed98
Doc: add changelog entry for DeviceAgent 1.0.3
jmoody Dec 2, 2016
b43052a
Merge pull request #572 from calabash/feature/update-to-DeviceAgent-1…
jmoody Dec 2, 2016
6748347
Gem: bump version to 2.2.3
jmoody Dec 6, 2016
8d7016d
Doc: update changelog for 2.2.3
jmoody Dec 6, 2016
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
56 changes: 55 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
## Change Log

### 2.2.3

* Update to DeviceAgent stack to 1.0.3 #572
* CODE\_SIGN\_IDENTITY is not longer required #570
* Increase DeviceAgent timeouts #569
* DA:Client: launch AUT with args and environment #567
* run-loop simctl tail shows all simulator logs #566
* App: fix TrueType font extension to avoid otool failures #565
* Added pt-BR translations for permissions alerts #563 @oscartanner
* Support Xcode 8.2 #561
* Turns enter text input parameter to string for numeric keyboards #560
* Gem: patch awesome\_print for BasicObject #559

#### DeviceAgent 1.0.3

Built from tag [1.0.3](https://github.com/calabash/DeviceAgent.iOS/releases/tag/1.0.3)

* Add iTunes and Apple Music SpringBoard alerts #183
* Add UITextView to TestApp #181
* Use Testmanagerd `XCT_sendString` to enter text except on i386/armv7 devices #178
* Fixes if statement in querying delete key for clear text #177
* Add GET environment and arguments #176
* Update SpringBoard alert definitions for iOS 10 #175
* clear\_text should tap keyboard delete key #170

DeviceAgent now dismisses the following US English SpringBoard alerts:

* Sign In to iTunes
* Access Apple Music And Your Media
* Health Access
* Enable Dictation
* pt\_BR localizations - thanks @oscartanner

#### iOSDeviceManager 1.0.3

Built from tag [1.0.3](https://github.com/calabash/iOSDeviceManager/releases/tag/1.0.3)

Includes [facebook/FBSimulatorControl 0.2.2 @
f0cc887](https://github.com/calabash/FBSimulatorControl/commit/f0cc8874a9fc1474e278db7571f8c35b9f88a354).

The corresponding calabash/FBSimulatorControl tag is
[fb-0.2.2-at-f0cc887](https://github.com/calabash/FBSimulatorControl/releases/tag/fb-0.2.2-at-f0cc887-iOSDeviceManager-1.0.3)

* Match array-based entitlements with * and <TEAM ID>. #95
* FB Frameworks 0.2.2 with Sierra + Xcode >= 8.1 support #94
* Fix timeout by using mach\_absolute\_time() #93
* Fix ShasumProvider generating strings with missing characters. #92
* Upload files to application's data container #91
* Update to Facebook frameworks to 0.2.2 #89
* Use CocoaLumberjack provided by FBSimulatorControl #85
* Fix cannot find XCTBootstrap.framework compile time errors #83
* Simplify how we get the common name for a certificate #82
* Use CommonCrypto to get SHA1 instead of shelling out #80

### 2.2.2

The DeviceAgent stack contains fixes for:
Expand All @@ -16,7 +70,7 @@ The DeviceAgent stack contains fixes for:
* DeviceAgent::Client: add support for query("\*") and query("all \*") #550
* DeviceAgent::Client: enter text without keyboard check #548

#### DeviceAgent 1.0.1
#### DeviceAgent 1.0.2

**20fbc23ece073e5beea611a4aafae436ad78e54b**

Expand Down
31 changes: 31 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,43 @@ target = #{target}
end
end

def ensure_valid_core_simulator_service
max_tries = 3
valid = false
3.times do |try|
valid = valid_core_simulator_service?
break if valid
log_info("Invalid CoreSimulator service for active Xcode: try #{try + 1} of #{max_tries}")
end
if valid
log_info("CoreSimulatorService is valid")
else
puts "CoreSimulatorService is invalid, try running again."
exit 1
end
end

def valid_core_simulator_service?
require "run_loop/shell"
args = ["xcrun", "simctl", "help"]

begin
hash = RunLoop::Shell.run_shell_command(args)
hash[:exit_status] == 0 &&
!hash[:out][/Failed to locate a valid instance of CoreSimulatorService/]
rescue RunLoop::Shell::Error => _
false
end
end

task :build do
banner("Building")

# Memoize base target directory
device_agent_dir

ensure_valid_core_simulator_service

env = {"DEVICEAGENT_PATH" => device_agent,
"FBSIMCONTROL_PATH" => fbsimctl}
Dir.chdir(ios_device_manager) do
Expand Down
2 changes: 1 addition & 1 deletion lib/run_loop/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def core_data_asset?(file)
def font?(file)
extension = File.extname(file)

extension == ".tff" || extension == ".otf"
extension == ".ttf" || extension == ".otf"
end
end
end
Expand Down
23 changes: 13 additions & 10 deletions lib/run_loop/cli/simctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ class Simctl < Thor

desc 'tail', 'Tail the log file of the booted simulator'
def tail
tail_booted
tail_simulator_logs
end

no_commands do
def tail_booted
device = booted_device
if device.nil?
version = xcode.version
puts "No simulator for active Xcode (version #{version}) is booted."
else
log_file = device.simulator_log_file_path
exec('tail', *["-n", "5000", '-F', log_file])
end
def tail_simulator_logs
paths = simctl.simulators.map do |simulator|
log_file_path = simulator.simulator_log_file_path
if log_file_path && File.exist?(log_file_path)
log_file_path
else
nil
end
end.compact

args = ["-n", "1000", "-F"] + paths
exec("tail", *args)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/run_loop/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ def self.include_calabash_script?(options)
# version.
def self.default_simulator(xcode=RunLoop::Xcode.new)

if xcode.version_gte_81?
if xcode.version_gte_82?
"iPhone 7 (10.2)"
elsif xcode.version_gte_81?
"iPhone 7 (10.1)"
elsif xcode.version_gte_8?
"iPhone 7 (10.0)"
Expand Down
Binary file modified lib/run_loop/device_agent/Frameworks.zip
Binary file not shown.
Binary file modified lib/run_loop/device_agent/app/DeviceAgent-Runner.app.zip
Binary file not shown.
27 changes: 27 additions & 0 deletions lib/run_loop/device_agent/bin/CLI.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,33 @@
"default" : true
}
},
"upload" : {
"-b" : {
"longFlag" : "--bundle-identifier",
"optionName" : "bundle-id",
"info" : "bundle identifier (e.g. com.my.app)",
"required" : true
},
"-d" : {
"longFlag" : "--device-id",
"optionName" : "device-identifier",
"info" : "iOS Simulator GUID or 40-digit physical device ID",
"required" : true
},
"-f" : {
"longFlag" : "--filepath",
"optionName" : "filepath",
"info" : "absolute path to file to be uploaded",
"required" : true
},
"-o" : {
"longFlag" : "--overwrite",
"optionName" : "overwrite",
"info" : "overwrite file if already in app container",
"required" : false,
"default" : false
}
},
"is_installed" : {
"-b" : {
"longFlag" : "--bundle-identifier",
Expand Down
Binary file modified lib/run_loop/device_agent/bin/iOSDeviceManager
Binary file not shown.
63 changes: 35 additions & 28 deletions lib/run_loop/device_agent/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ class HTTPError < RuntimeError; end
# For example:
#
# RunLoop::DeviceAgent::Client::DEFAULTS[:http_timeout] = 60
# RunLoop::DeviceAgent::Client::DEFAULTS[:device_agent_install_timeout] = 120
DEFAULTS = {
:port => 27753,
:simulator_ip => "127.0.0.1",
:http_timeout => (RunLoop::Environment.ci? || RunLoop::Environment.xtc?) ? 120 : 10,
:http_timeout => (RunLoop::Environment.ci? || RunLoop::Environment.xtc?) ? 120 : 20,
:route_version => "1.0",

# Ignored in the XTC.
# This key is subject to removal or changes
:device_agent_install_timeout => RunLoop::Environment.ci? ? 120 : 60,
:device_agent_install_timeout => RunLoop::Environment.ci? ? 120 : 90,
# This value must always be false on the XTC.
# This is should only be used by gem maintainers or very advanced users.
:shutdown_device_agent_before_launch => false
Expand Down Expand Up @@ -106,33 +107,20 @@ def self.run(options={})
code_sign_identity = RunLoop::Environment::code_sign_identity
end

if device.physical_device? && cbx_launcher.name == :ios_device_manager
if !code_sign_identity
raise RuntimeError, %Q[
Targeting a physical devices requires a code signing identity.

Rerun your test with:

$ CODE_SIGN_IDENTITY="iPhone Developer: Your Name (ABCDEF1234)" cucumber

To see the valid code signing identities on your device run:

$ xcrun security find-identity -v -p codesigning

]
end
end

install_timeout = options.fetch(:device_agent_install_timeout,
DEFAULTS[:device_agent_install_timeout])
shutdown_before_launch = options.fetch(:shutdown_device_agent_before_launch,
DEFAULTS[:shutdown_device_agent_before_launch])
aut_args = options.fetch(:args, [])
aut_env = options.fetch(:env, {})

launcher_options = {
code_sign_identity: code_sign_identity,
device_agent_install_timeout: install_timeout,
shutdown_device_agent_before_launch: shutdown_before_launch,
dylib_injection_details: dylib_injection_details
dylib_injection_details: dylib_injection_details,
aut_args: aut_args,
aut_env: aut_env
}

xcuitest = RunLoop::DeviceAgent::Client.new(bundle_id, device,
Expand Down Expand Up @@ -307,10 +295,6 @@ def device_info
expect_300_response(response)
end

# TODO Legacy API; remove once this branch is merged:
# https://github.com/calabash/DeviceAgent.iOS/pull/133
alias_method :runtime, :device_info

# @!visibility private
def server_version
options = http_options
Expand Down Expand Up @@ -362,7 +346,7 @@ def enter_text(string)
parameters = {
:gesture => "enter_text",
:options => {
:string => string
:string => string.to_s
}
}
request = request("gesture", parameters)
Expand All @@ -382,7 +366,7 @@ def enter_text_without_keyboard_check(string)
parameters = {
:gesture => "enter_text",
:options => {
:string => string
:string => string.to_s
}
}
request = request("gesture", parameters)
Expand Down Expand Up @@ -802,6 +786,8 @@ def wait_for_text_in_view(text, uiquery, options={})
merged_options = WAIT_DEFAULTS.merge(options)
result = wait_for_view(uiquery, merged_options)

# This is not quite right. It is possible to get a false positive.
# If result does not have "value" or "label" and the text is nil
candidates = [result["value"],
result["label"]]
match = candidates.any? do |elm|
Expand Down Expand Up @@ -1250,7 +1236,7 @@ def launch_cbx_runner

To diagnose the problem tail the launcher log file:

$ tail -1000 -F #{cbx_launcher.class.log_file}
$ tail -1000 -F #{cbx_launcher_log_file}

]
end
Expand Down Expand Up @@ -1294,9 +1280,19 @@ def launch_aut(bundle_id = @bundle_id)

retries = 5

# Launch arguments and environment arguments cannot be nil
# The public interface Client.run has a guard against this, but
# internal callers to do not.
aut_args = launcher_options.fetch(:aut_args, [])
aut_env = launcher_options.fetch(:aut_env, {})
begin
client = http_client(http_options)
request = request("session", {:bundleID => bundle_id})
request = request("session",
{
:bundleID => bundle_id,
:launchArgs => aut_args,
:environment => aut_env
})
response = client.post(request)
RunLoop.log_debug("Launched #{bundle_id} on #{device}")
RunLoop.log_debug("#{response.body}")
Expand Down Expand Up @@ -1421,6 +1417,17 @@ def orientation_for_position_symbol(position)
end
end

# @!visibility private
def cbx_launcher_log_file
if cbx_launcher.name == :ios_device_manager
# The location of the iOSDeviceManager logs has changed
File.join(RunLoop::Environment.user_home_directory,
".calabash", "iOSDeviceManager", "logs", "current.log")
else
cbx_launcher.class.log_file
end
end

# @!visibility private
# Private method. Do not call.
# Flattens the result of `tree`.
Expand Down
Loading