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

Update remove-uiautomation branch #46

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
615a56a
Adding sdk option to Frank launch
aceunreal Nov 25, 2013
049d022
Merge pull request #15 from TestingWithFrank/better-messages-for-sele…
MichaelBuckley Jan 19, 2014
8425542
Merge pull request #13 from airservice/create_sdk_option
MichaelBuckley Jan 31, 2014
5048e6b
Update the Controls example for iOS 7
MichaelBuckley Dec 20, 2013
32465e6
Limit Bonjour to IPv4
MichaelBuckley Dec 22, 2013
c624c9f
Updated Controls example to non-deprecated CLLocationManager delegate…
MichaelBuckley Jan 18, 2014
301aa67
Fix UIAlertView tests in controls example
MichaelBuckley Jan 19, 2014
cc3b4ab
Update UISwitch swipe method to work in iOS 7
MichaelBuckley Jan 18, 2014
26b7568
Update PublicAutomation
MichaelBuckley Feb 2, 2014
25f6bbb
Make linking to PublicAutomation easier for debug builds
MichaelBuckley Feb 2, 2014
29f1cc1
Specify exact versions of dependencies
MichaelBuckley Feb 17, 2014
9cf9dd2
Specify approximate versions of dependencies
MichaelBuckley Feb 22, 2014
e4397c6
Merge pull request #18 from TestingWithFrank/specify-dependency-version
MichaelBuckley Mar 11, 2014
62adc68
Fix crashing of OS X apps on 10.8 and earlier
MichaelBuckley Apr 12, 2014
ecbe77f
Bumping version to 1.2.3
MichaelBuckley Apr 12, 2014
e28415f
HTTP server was being started multiple times
cvanes May 7, 2014
6ed538a
Merge pull request #22 from instil/master
MichaelBuckley May 7, 2014
2c2f5e6
Removed hardcoded 30s wait timeout for navigation
joemasilotti May 20, 2014
61307b4
Ensure navigation titles are actually the title
May 28, 2014
84877fe
Merge pull request #24 from joemasilotti/fork
MichaelBuckley Jun 12, 2014
b90b3a7
Move nav title to helper and add check method
joemasilotti Jun 13, 2014
a946a1f
Merge pull request #25 from joemasilotti/navigation-titles
MichaelBuckley Jun 13, 2014
5fb4312
Merge branch 'joemasilotti-navigation-titles'
MichaelBuckley Jun 13, 2014
ce78cea
update PublicAutomation to pull in fix for https://github.com/moredip…
moredip Nov 16, 2014
b2c485b
version bump and library re-build for 1.2.4.pre1
moredip Nov 16, 2014
f5421d2
Added FEX_dragWithDelayToX:y:duration: method to be able to specify d…
Jan 29, 2015
391bb15
Merge pull request #41 from nacuteodor/teodor/dragWithDelay
moredip Jan 29, 2015
5915223
Isolated changes for 32+64 bit support in Frank.
Jan 29, 2015
471c100
update PublicAutomation submodule
moredip Jan 31, 2015
78d15e6
version bump to 1.2.5
moredip Jan 31, 2015
7c6f84f
Merge pull request #42 from CMTaylor/Dual32+64bitSupport
moredip Jan 31, 2015
61f6275
update PublicAutomation submodule
moredip Jan 31, 2015
ba188c2
`rake build_for_release`
moredip Jan 31, 2015
063300c
Merge remote-tracking branch 'origin/master'
moredip Jan 31, 2015
858d8e7
`rake build_for_release`
moredip Jan 31, 2015
f715354
Merge branch 'master' into remove-uiautomation-in-ios7
qmfrederik Sep 7, 2015
9c76c36
Avoid null reference exception while executing operations - return an…
qmfrederik Sep 7, 2015
70db5ea
Fix duplicate variable name
qmfrederik Sep 7, 2015
071d5e4
Remove FEX_dragWithInitialDelayToX method
qmfrederik Sep 7, 2015
77f4731
Make sure applicationDidBecomeActive is called, even on iOS 9
qmfrederik Oct 13, 2015
18dc8d1
Bug-fix: Fall back to orientation via status-bar when orientation via…
KotiJocki Nov 25, 2013
f0fc517
Allowing UIAlertViews be queryable in iOS7.
seanoshea Dec 5, 2013
8096656
Removing debug code in favour of frankly_os_version
seanoshea Dec 6, 2013
933997d
Updating the pull request for iOS and UIAlertViews
seanoshea Dec 6, 2013
b494e83
Merge branch 'pending-moredip-commits' into remove-uiautomation-in-ios7
qmfrederik Jan 20, 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
29 changes: 20 additions & 9 deletions Frank.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@
remoteGlobalIDString = 305CA782164205F800C4ACE5;
remoteInfo = CocoaHTTPServerMac;
};
3092C0F3189EF7EB00371BF9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C18A5F16160D528C00DC25F6 /* PublicAutomation.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = C194253715D838BD004FC314;
remoteInfo = PublicAutomation;
};
65DBDDB616A89D97007D3D43 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
Expand Down Expand Up @@ -1073,6 +1080,7 @@
buildRules = (
);
dependencies = (
3092C0F4189EF7EB00371BF9 /* PBXTargetDependency */,
ABA9E46815C81C8D00112290 /* PBXTargetDependency */,
);
name = Frank;
Expand Down Expand Up @@ -1310,6 +1318,11 @@
target = 305CA782164205F800C4ACE5 /* CocoaHTTPServerMac */;
targetProxy = 30228E1D1642146F00B1F9E7 /* PBXContainerItemProxy */;
};
3092C0F4189EF7EB00371BF9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = PublicAutomation;
targetProxy = 3092C0F3189EF7EB00371BF9 /* PBXContainerItemProxy */;
};
65DBDDB716A89D97007D3D43 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 65DBDD7216A89CCA007D3D43 /* CocoaAsyncSocket */;
Expand Down Expand Up @@ -1342,7 +1355,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD)";
COPY_PHASE_STRIP = NO;
DSTROOT = /tmp/Frank.dst;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -1351,25 +1364,23 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/Frank_Prefix.pch;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = (
"-ObjC",
"-all_load",
);
PRODUCT_NAME = Frank;
SDKROOT = iphoneos;
USER_HEADER_SEARCH_PATHS = lib/Shelley/Shelley;
USER_HEADER_SEARCH_PATHS = "lib/Shelley/Shelley lib/PublicAutomation\"";
};
name = Debug;
};
1DEB922008733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
ARCHS = "$(ARCHS_STANDARD)";
DSTROOT = /tmp/Frank.dst;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand All @@ -1382,14 +1393,14 @@
);
PRODUCT_NAME = Frank;
SDKROOT = iphoneos;
USER_HEADER_SEARCH_PATHS = lib/Shelley/Shelley;
USER_HEADER_SEARCH_PATHS = "lib/Shelley/Shelley lib/PublicAutomation\"";
};
name = Release;
};
1DEB922308733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
Expand All @@ -1403,7 +1414,7 @@
1DEB922408733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
Expand Down
9 changes: 9 additions & 0 deletions Frank.xcodeproj/xcshareddata/xcschemes/Frank.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D6E8FF3113D3DC9200D24F43"
BuildableName = "libShelley.a"
BlueprintName = "Shelley"
ReferencedContainer = "container:lib/Shelley/Shelley.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
Expand Down
18 changes: 9 additions & 9 deletions gem/frank-cucumber.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_dependency( "cucumber" )
s.add_dependency( "rspec", [">=2.0"] )
s.add_dependency( "sim_launcher", [">=0.4.6"] )
s.add_dependency( "i18n" )
s.add_dependency( "plist" )
s.add_dependency( "json" ) # TODO: figure out how to be more permissive as to which JSON gems we allow
s.add_dependency( "dnssd" )
s.add_dependency( "thor" )
s.add_dependency( "xcodeproj", [">=0.5.3"] )
s.add_dependency( "cucumber", ["~>1.3.10"] )
s.add_dependency( "rspec", ["~>2.14.1"] )
s.add_dependency( "sim_launcher", ["~>0.4.6"] )
s.add_dependency( "i18n", ["~>0.6.9"] )
s.add_dependency( "plist", ["~>3.1.0"] )
s.add_dependency( "json", ["1.8.1"] ) # TODO: figure out how to be more permissive as to which JSON gems we allow
s.add_dependency( "dnssd", ["~>2.0"] )
s.add_dependency( "thor", ["~>0.18.1"] )
s.add_dependency( "xcodeproj", ["~>0.14.1"] )

s.add_development_dependency( "rr" )
s.add_development_dependency( "yard" )
Expand Down
Binary file modified gem/frank-skeleton/libCocoaAsyncSocket.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libCocoaAsyncSocketMac.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libCocoaHTTPServer.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libCocoaHTTPServerMac.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libCocoaLumberjack.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libCocoaLumberjackMac.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libFrank.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libFrankMac.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libShelley.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libShelleyMac.a
Binary file not shown.
3 changes: 2 additions & 1 deletion gem/lib/frank-cucumber/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def build_and_launch
desc "launch", "open the Frankified app in the simulator"
method_option :debug, :type => :boolean, :default => false
method_option :idiom, :banner => 'iphone|ipad', :type => :string, :default => (ENV['FRANK_SIM_IDIOM'] || 'iphone')
method_option :sdk, :type => :string, :default => nil
def launch
$DEBUG = options[:debug]
version = case options[:idiom].downcase
Expand All @@ -188,7 +189,7 @@ def launch

say "LAUNCHING APP..."

launch_app(frankified_app_dir, nil, version, false)
launch_app(frankified_app_dir, options[:sdk], version, false)
end
end

Expand Down
26 changes: 17 additions & 9 deletions gem/lib/frank-cucumber/core_frank_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@

Then /^I should see a navigation bar titled "([^\"]*)"$/ do |expected_mark|
quote = get_selector_quote(expected_mark)
check_element_exists( "navigationItemView marked:#{quote}#{expected_mark}#{quote}" )
quoted_text = "#{quote}#{expected_mark}#{quote}"
navigation_title_exists_with_text("#{quoted_text}").should be_true, "expected to see a navigation bar titled #{quoted_text}"
end

Then /^I wait to see a navigation bar titled "([^\"]*)"$/ do |expected_mark|
quote = get_selector_quote(expected_mark)
wait_until( :timeout => 30, :message => "waited to see a navigation bar titled #{quote}#{expected_mark}#{quote}" ) {
element_exists( "navigationItemView marked:#{quote}#{expected_mark}#{quote}" )
}
Then /^I wait to see a navigation bar titled "([^\"]*)"$/ do |expected_title|
wait_until(message: "waited to see a navigation bar titled #{quoted_text}") do
navigation_title_with_text_exists(expected_title)
end
end

Then /^I wait to not see a navigation bar titled "([^\"]*)"$/ do |expected_mark|
quote = get_selector_quote(expected_mark)
wait_until( :timeout => 30, :message => "waited to not see a navigation bar titled #{quote}#{expected_mark}#{quote}" ) {
wait_until( :message => "waited to not see a navigation bar titled #{quote}#{expected_mark}#{quote}" ) {
!element_exists( "navigationItemView marked:#{quote}#{expected_mark}#{quote}" )
}
end
Expand Down Expand Up @@ -66,7 +66,11 @@
end

Then /^I should see an alert view titled "([^\"]*)"$/ do |expected_mark|
values = frankly_map( 'alertView', 'title')
if frankly_os_version.to_f >= 7.0
values = frankly_map( "view:'_UIModalItemRepresentationView' label", 'text')
else
values = frankly_map( 'alertView', 'title')
end
values.should include(expected_mark)
end

Expand All @@ -76,7 +80,11 @@
end

Then /^I should not see an alert view$/ do
check_element_does_not_exist( 'alertView' )
if frankly_os_version.to_f >= 7.0
check_element_does_not_exist( '_UIModalItemRepresentationView' )
else
check_element_does_not_exist( 'alertView' )
end
end

Then /^I should see an element of class "([^\"]*)" with name "([^\"]*)" with the following labels: "([^\"]*)"$/ do |className, classLabel, listOfLabels|
Expand Down
39 changes: 39 additions & 0 deletions gem/lib/frank-cucumber/frank_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ def view_with_mark_exists(expected_mark)
element_exists( "view marked:#{quote}#{expected_mark}#{quote}" )
end

# Indicate whether the title of the navigation bar matches the expected title.
# @param [String] expected_title the expected title of the navigation bar
# @return [Boolean]
def navigation_title_with_text_exists(expected_title)
quoted_text = "#{quote}#{expected_title}#{quote}"

navFrame = frankly_map('view:"UINavigationBar"', 'frame').first
navCenter = navFrame["size"]["width"] / 2.0

frame = frankly_map("view:'UINavigationBar' view:'UINavigationItemView' marked:#{quoted_text}", 'frame').first
return false unless frame && frame["origin"] && frame["size"]

left = frame["origin"]["x"]
right = frame["origin"]["x"] + frame["size"]["width"]
return false unless left && right && left < right

(left < navCenter) && (navCenter < right)
end

# Assert whether there are any views in the current view heirarchy which contain the specified accessibility label.
# @param [String] expected_mark the expected accessibility label
# @raise an rspec exception if the assertion fails
Expand All @@ -173,6 +192,26 @@ def check_view_with_mark_does_not_exist(expected_mark)
check_element_does_not_exist( "view marked:#{quote}#{expected_mark}#{quote}" )
end

# Assert the title of the navigation bar.
# @param [String] expected_title the expected title of the navigation bar
# @raise an rspec exception if the assertion fails
# @raise an rspec exception if the navigation bar and its subview `UINavigationItemView` cannot be found
# @raise an rspec exception if the `UINavigationItemView` does not cover the center x of the navigation bar
def check_navigation_title_with_text_exists(expected_title)
quoted_text = "#{quote}#{expected_title}#{quote}"

navFrame = frankly_map('view:"UINavigationBar"', 'frame').first
navCenter = navFrame["size"]["width"] / 2.0

frame = frankly_map("view:'UINavigationBar' view:'UINavigationItemView' marked:#{quoted_text}", 'frame').first
raise "Could not find navigation bar with title (#{expected_title})" unless frame && frame["origin"] && frame["size"]

left = frame["origin"]["x"]
right = frame["origin"]["x"] + frame["size"]["width"]
raise "Expected title (#{expected_title}) not in center of navigation bar" unless left && right && left < right

((left < navCenter) && (navCenter < right)).should be_true, "Could not find navigation title in center of navigation bar matching text (#{expected_title})"
end

# Waits for any of the specified selectors to match a view.
#
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/frank-cucumber/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Frank
module Cucumber
VERSION = "1.2.2"
VERSION = "1.2.5"
end
end
6 changes: 3 additions & 3 deletions src/AccessibilityCheckCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ + (BOOL) accessibilitySeemsToBeTurnedOn {

#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1090

extern Boolean AXIsProcessTrustedWithOptions(CFDictionaryRef options);
extern CFStringRef kAXTrustedCheckOptionPrompt;
extern Boolean AXIsProcessTrustedWithOptions(CFDictionaryRef options) __attribute__((weak_import));
extern CFStringRef kAXTrustedCheckOptionPrompt __attribute__((weak_import));

#endif // __MAC_OS_X_VERSION_MAX_ALLOWED < 1090

+ (BOOL) accessibilitySeemsToBeTurnedOn {
BOOL returnValue = NO;

if (AXIsProcessTrusted != NULL)
if (AXIsProcessTrustedWithOptions != NULL)
{
NSDictionary* options = @{ (id) kAXTrustedCheckOptionPrompt : @YES };
return AXIsProcessTrustedWithOptions((CFDictionaryRef) options);
Expand Down
30 changes: 25 additions & 5 deletions src/FrankLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
@implementation FrankLoader

+ (void)applicationDidBecomeActive:(NSNotification *)notification{
static dispatch_once_t frankDidBecomeActiveToken;
#if TARGET_OS_IPHONE
FrankServer *server = [[FrankServer alloc] initWithDefaultBundle];
[server startServer];

dispatch_once(&frankDidBecomeActiveToken, ^{
FrankServer *server = [[FrankServer alloc] initWithDefaultBundle];
[server startServer];
});
#else
static dispatch_once_t frankDidBecomeActiveToken;

dispatch_once(&frankDidBecomeActiveToken, ^{
FrankServer *server = [[FrankServer alloc] initWithDefaultBundle];
[server startServer];
Expand Down Expand Up @@ -86,6 +86,26 @@ + (void)load{
selector:@selector(applicationDidBecomeActive:)
name:notificationName
object:nil];

#if TARGET_OS_IPHONE
NSArray *iOSVersionComponents = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
int majorVersion = [[iOSVersionComponents objectAtIndex:0] intValue];

if (majorVersion >= 9)
{
// iOS9 is installed. The UIApplicationDidBecomeActiveNotification may have been fired *before*
// this code is called.
// See also:
// http://stackoverflow.com/questions/31785878/ios-9-uiapplicationdidbecomeactivenotification-callback-not-called

// Call applicationDidBecomeActive: after 0.5 second.
// Delay execution of my block for 10 seconds.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 500 * USEC_PER_SEC), dispatch_get_main_queue(), ^{
NSLog(@"Forcefully invoking applicationDidBecomeActive");
[FrankLoader applicationDidBecomeActive:nil];
});
}
#endif
}

@end
10 changes: 9 additions & 1 deletion src/MapOperationCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ - (NSString *)handleCommandWithRequestBody:(NSString *)requestBody {
for (FrankMapViewType *view in viewsToMap) {
@try {
id result = [self performOperation:operation onView:view];
[results addObject:[ViewJSONSerializer jsonify:result]];
NSString *resultValue = [ViewJSONSerializer jsonify:result];

// Can't add nil objects to an array.
if(resultValue == nil)
{
resultValue = @"";
}

[results addObject:resultValue];
}
@catch (NSException * e) {
NSLog( @"Exception while performing operation %@\n%@", operation, e );
Expand Down
2 changes: 1 addition & 1 deletion src/OrientationCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ - (NSString *)getOrientationDescriptionViaDevice{
- (NSString *)handleGet{
NSDictionary *orientationDescription = [self getOrientationRepresentationViaDevice];
if( !orientationDescription )
orientationDescription = [self getOrientationRepresentationViaDevice];
orientationDescription = [self getOrientationRepresentationViaStatusBar];

return TO_JSON(orientationDescription);
}
Expand Down