iCuke 0.4.9 → 0.4.10
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.
- data/History.txt +6 -0
- data/VERSION +1 -1
- data/ext/iCuke/Viewer.m +26 -26
- data/ext/iCuke/libicuke.dylib +0 -0
- data/iCuke.gemspec +2 -2
- data/lib/icuke/cucumber.rb +6 -6
- metadata +3 -3
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.10
|
data/ext/iCuke/Viewer.m
CHANGED
@@ -22,27 +22,29 @@ static Viewer *sharedViewer = nil;
|
|
22
22
|
|
23
23
|
-(void)appendOpenToXml:(NSMutableString*)xml {
|
24
24
|
[xml appendFormat: @"<%@", NSStringFromClass([self class])];
|
25
|
-
[self
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
25
|
+
if ([self isAccessibilityElement]) {
|
26
|
+
[self appendTraitsToXml: xml];
|
27
|
+
if ([[self accessibilityLabel] length] > 0) {
|
28
|
+
NSString *escaped_label = [self accessibilityLabel];
|
29
|
+
escaped_label = [escaped_label stringByReplacingOccurrencesOfString: @"&" withString: @"&"];
|
30
|
+
escaped_label = [escaped_label stringByReplacingOccurrencesOfString: @"'" withString: @"""];
|
31
|
+
escaped_label = [escaped_label stringByReplacingOccurrencesOfString: @"\\" withString: @"'"];
|
32
|
+
escaped_label = [escaped_label stringByReplacingOccurrencesOfString: @">" withString: @">"];
|
33
|
+
escaped_label = [escaped_label stringByReplacingOccurrencesOfString: @"<" withString: @"<"];
|
34
|
+
[xml appendFormat: @"label=\"%@\" ", escaped_label];
|
35
|
+
}
|
36
|
+
if ([[self accessibilityHint] length] > 0) {
|
37
|
+
[xml appendFormat: @"hint=\"%@\" ", [self accessibilityHint]];
|
38
|
+
}
|
39
|
+
if ([[self accessibilityValue] length] > 0) {
|
40
|
+
NSString *escaped_value = [self accessibilityValue];
|
41
|
+
escaped_value = [escaped_value stringByReplacingOccurrencesOfString: @"&" withString: @"&"];
|
42
|
+
escaped_value = [escaped_value stringByReplacingOccurrencesOfString: @"'" withString: @"""];
|
43
|
+
escaped_value = [escaped_value stringByReplacingOccurrencesOfString: @"\\" withString: @"'"];
|
44
|
+
escaped_value = [escaped_value stringByReplacingOccurrencesOfString: @">" withString: @">"];
|
45
|
+
escaped_value = [escaped_value stringByReplacingOccurrencesOfString: @"<" withString: @"<"];
|
46
|
+
[xml appendFormat: @"value=\"%@\" ", escaped_value];
|
47
|
+
}
|
46
48
|
}
|
47
49
|
[xml appendString: @">"];
|
48
50
|
}
|
@@ -123,8 +125,9 @@ static Viewer *sharedViewer = nil;
|
|
123
125
|
@implementation UIView (Viewer)
|
124
126
|
|
125
127
|
-(void)appendToXml:(NSMutableString *)xml {
|
128
|
+
[self appendOpenToXml: xml];
|
129
|
+
|
126
130
|
if ([self isAccessibilityElement]) {
|
127
|
-
[self appendOpenToXml: xml];
|
128
131
|
[self appendFrameToXml: xml];
|
129
132
|
}
|
130
133
|
|
@@ -133,10 +136,7 @@ static Viewer *sharedViewer = nil;
|
|
133
136
|
}
|
134
137
|
|
135
138
|
[self appendChildrenToXml: xml];
|
136
|
-
|
137
|
-
if ([self isAccessibilityElement]) {
|
138
|
-
[self appendCloseToXml: xml];
|
139
|
-
}
|
139
|
+
[self appendCloseToXml: xml];
|
140
140
|
}
|
141
141
|
|
142
142
|
@end
|
data/ext/iCuke/libicuke.dylib
CHANGED
Binary file
|
data/iCuke.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{iCuke}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rob Holland"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-23}
|
13
13
|
s.description = %q{Cucumber support for iPhone applications}
|
14
14
|
s.email = %q{rob@the-it-refinery.co.uk}
|
15
15
|
s.extensions = ["ext/iCuke/Rakefile"]
|
data/lib/icuke/cucumber.rb
CHANGED
@@ -32,8 +32,8 @@ class ICukeWorld
|
|
32
32
|
@simulator.record
|
33
33
|
end
|
34
34
|
|
35
|
-
def can_see?(text)
|
36
|
-
page.xpath(%Q{//*[contains(., "#{text}") or contains(@label, "#{text}") or contains(@value, "#{text}")]}).any?
|
35
|
+
def can_see?(text, scope = '')
|
36
|
+
page.xpath(%Q{#{scope}//*[contains(., "#{text}") or contains(@label, "#{text}") or contains(@value, "#{text}")]}).any?
|
37
37
|
end
|
38
38
|
|
39
39
|
def onscreen?(x, y)
|
@@ -178,12 +178,12 @@ Given /^(?:"([^\"]*)" from )?"([^\"]*)" is loaded in the simulator(?: using sdk
|
|
178
178
|
:env => { 'DYLD_INSERT_LIBRARIES' => LIBICUKE }
|
179
179
|
end
|
180
180
|
|
181
|
-
Then /^I should see "([^\"]*)"
|
182
|
-
raise %Q{Content "#{text}" not found in: #{response}} unless can_see?(text)
|
181
|
+
Then /^I should see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, scope|
|
182
|
+
raise %Q{Content "#{text}" not found in: #{response}} unless can_see?(text, scope)
|
183
183
|
end
|
184
184
|
|
185
|
-
Then /^I should not see "([^\"]*)"
|
186
|
-
raise %Q{Content "#{text}" was found but was not expected in: #{response}} if can_see?(text)
|
185
|
+
Then /^I should not see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, scope|
|
186
|
+
raise %Q{Content "#{text}" was found but was not expected in: #{response}} if can_see?(text, scope)
|
187
187
|
end
|
188
188
|
|
189
189
|
When /^I tap "([^\"]*)"$/ do |label|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 10
|
9
|
+
version: 0.4.10
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Rob Holland
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-23 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|