Permalink
Browse files

Merge pull request #4 from EmbeddedSources/master

Added an automator script for the CoverStory
  • Loading branch information...
farcaller committed May 29, 2012
2 parents 32da69c + b693a5d commit d60ee9e18a8e0a1d7fd268da71e3ab0cffc9530d
@@ -0,0 +1,22 @@
+on run argv
+
+ tell application "/Applications/CoverStory.app"
+
+ quit
+
+ activate
+
+ set x to open (item 1 of argv)
+
+ tell x to export to HTML in (item 2 of argv)
+
+ quit
+
+ end tell
+
+
+
+ return item 1 of argv & "|" & item 2 of argv
+
+end run
+
@@ -0,0 +1 @@
+http://jorudolph.wordpress.com/category/ios-continous-integration-series/
View
@@ -32,4 +32,5 @@ size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
}
```
-Add the code above to any .c file that is going to be linked into your application (must be in app itself, not the tests bundle).
+Add the code above to any .c file that is going to be linked into your application (must be in app itself, not the tests bundle). You can find this file in the source tree above.
+Alternatively, you can link libCoverageFopenFix.a to it. This is a "fat" library that can be used both with for device and the simulator build.
View
@@ -11,7 +11,9 @@
UI Automation has a few issues, to make it work on simulator you need to launch it as follows:
```shell
-TPL=/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
+
+XCODE_PATH=`xcode-select -print-path`
+TPL=$XCODE_PATH/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
APP=/Users/USERNAME/Library/Developer/Xcode/DerivedData/APP-RANDOMHASH/Build/Products/CONFIG-iphonesimulator/APPNAME.app
instruments -t "$TPL" "$APP" -e UIASCRIPT PATHTOYOUR/suite.js -e UIARESULTSPATH PATHTO/ARTIFACTS
@@ -79,4 +81,4 @@ describe("PocketCasts", function() {
2012-02-10 10:07:19 +0000 Fail: Expected 'Tap to download video' to equal 'Tap to subscribe at railscasts.com'.
Instruments Trace Complete (Duration : 8.940802s; Output : /Users/farcaller/Developer/Active/pocketcasts/PocketCasts/instrumentscli4.trace)
-```
+```
@@ -0,0 +1,6 @@
+
+XCODE_PATH=`xcode-select -print-path`
+TPL=$XCODE_PATH/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
+APP=/Users/USERNAME/Library/Developer/Xcode/DerivedData/APP-RANDOMHASH/Build/Products/CONFIG-iphonesimulator/APPNAME.app
+
+instruments -t "$TPL" "$APP" -e UIASCRIPT PATHTOYOUR/suite.js -e UIARESULTSPATH PATHTO/ARTIFACTS
@@ -0,0 +1,38 @@
+describe("PocketCasts", function() {
+ var target = UIATarget.localTarget();
+
+ function dumpTree() {
+ UIATarget.localTarget().frontMostApp().logElementTree();
+ }
+
+ function pickVideoWithIndex(i) {
+ target.frontMostApp().mainWindow().tableViews()[0].visibleCells()[i].tap();
+ }
+
+ function firstTableGroup() {
+ return target.frontMostApp().mainWindow().tableViews()[0].groups()[0];
+ }
+
+ function goBack() {
+ target.frontMostApp().navigationBar().leftButton().tap();
+ }
+
+ afterEach(function(){
+ goBack();
+ });
+
+ it("should show download button for video, that is not downloaded", function(){
+ pickVideoWithIndex(0);
+ expect(firstTableGroup().name()).toEqual("Tap to download video");
+ });
+
+ it("should show play button for video that is downloaded", function(){
+ pickVideoWithIndex(1);
+ expect(firstTableGroup().name()).toEqual("Tap to play video");
+ });
+
+ it("should show subscribe button for pro video when there's no subscription", function(){
+ pickVideoWithIndex(2);
+ expect(firstTableGroup().name()).toEqual("Tap to subscribe at railscasts.com");
+ });
+});

0 comments on commit d60ee9e

Please sign in to comment.