bendyworks / bwoken Goto Github PK
View Code? Open in Web Editor NEWiOS UIAutomation Test Runner
Home Page: http://bendyworks.github.com/bwoken/
License: MIT License
iOS UIAutomation Test Runner
Home Page: http://bendyworks.github.com/bwoken/
License: MIT License
Similar to issue #4....after first execution of tests (tests execute fine), when trying to relaunch tests, tests do not execute. The first run of test complete fine, but second just displays prompt of executing tests but no tests are run. I have to restart machine to fix issue.
I am using:
bwoken 1.1.0
ruby 1.9.3 (using rvm)
Xcode 4.3.3 (with command line tools installed)
Mac OS X 10.7.4
This is a question. I have searched over these docs, issues, Apple docs, StackOverflow, blogs… Am not finding an answer.
When a test calls, UIAElement.logElementTree()
, where does the output go? I have found png files in the results directory, but not any log output. My console log shows:
Debug: keyboard.typeString("[email protected]")
logElementTree:
Debug: tap scrollViews[0].secureTextFields[0]
Running with ruby 2.1.0, Gemfiles:
specs:
bwoken (2.0.0)
coffee-script-source
colorful
execjs
json_pure
rake
slop
coffee-script-source (1.6.3)
colorful (0.0.3)
execjs (2.0.2)
json_pure (1.8.1)
rake (10.1.1)
slop (3.4.7)
ignore
bwoken v2.0.0.beta.3
I followed the instructions, and put my tests on the dir "integration/javascript/ipad", on an existing project.
Then I run sudo bwoken test --verbose
(without sudo I have an error while cleaning about removing a .bundle file)
And it builds succesfully (the last thing that I see on the command line is "** BUILD SUCCEEDED **").
The simulator launches, goes to landscape (like if it is launching the app), and the app gets immediately closed, returning to the springboard �(it doesn't show the splascreen or anything else).
Does someone know how to solve the problem?.
What I tried:
Not sure what happened here, when I run rake iphone --trace
, simulator didn't run and I got this
** Invoke iphone (first_time)
** Invoke iphone:test (first_time)
** Invoke integration/tmp/results (first_time, not_needed)
** Invoke coffeescript (first_time)
** Invoke integration/tmp/javascript/iphone/example.js (first_time, not_needed)
** Invoke integration/tmp/javascript/iphone (first_time, not_needed)
** Invoke integration/coffeescript/iphone/example.coffee (first_time, not_needed)
** Invoke integration/coffeescript/iphone (first_time, not_needed)
** Invoke integration/tmp/javascript/example_js.js (first_time, not_needed)
** Invoke integration/tmp/javascript (first_time, not_needed)
** Invoke integration/javascript/example_js.js (first_time, not_needed)
** Invoke integration/javascript (first_time, not_needed)
** Execute coffeescript
** Execute iphone:test
iphone example.js
: (null)
rake aborted!
Test Script Failed
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bwoken-1.3.0/lib/bwoken/script.rb:88:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bwoken-1.3.0/lib/bwoken/script.rb:32:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bwoken-1.3.0/lib/bwoken/script.rb:20:in `block in run_all'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bwoken-1.3.0/lib/bwoken/script.rb:19:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bwoken-1.3.0/lib/bwoken/script.rb:19:in `run_all'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bwoken-1.3.0/lib/bwoken/tasks/bwoken.rake:82:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
OSX 10.8.4
Xcode 4.6.3 (4H1503)
Help, please....
Can you add a support for that? Or are you planning that?
Steps to repro:
When running multiple tests, if one test fails the test run stops. In practical terms, that means if one component turns buggy, tests for non-buggy components will never run (and we'll never know for sure that they're non-buggy).
It could be argued that it is preferred that as many tests are run as possible. One failing test should not stop the run. Log the failure and move on.
Perhaps it's just a difference in philosophy between me and the bwoken authors. For now I've modified script.rb so that the run method does not raise if a test fails.
Darn. I was so close to getting my xcode project up and runnign with travis ci, but recently when I work my way through the new (non rake based) install instructions, I get stuck at:
$ bwoken init
-bash: bwoken: command not found
Do I have to do something to enable bwoken as a shell command in OSX?
Hey!
First, thanks for this great wrapper for UIAutomation. The setup is really straight forward and it's easy to get going.
I've setup a really simple sample application with two buttons and a small 1.5 second animation at startup - all I test for is to see that both buttons are actually available in the view.
This simple test case fails about 1/3 of all test runs.
See my attached test case:
#import "../../../../tuneup/tuneup.js"
test "Initial screen has two buttons", (target, app) ->
target.delay(2) # wait until animation is over
window = app.mainWindow()
assertNotNull window.elements()["buttonA"], "buttonA is missing"
assertNotNull window.elements()["buttonB"], "buttonB is missing"
Any ideas on why that is?
I've checked for common errors:
My UIAutomation tests, are able to run both on iPhone and iPad (I use tuneup js that adds target.isDeviceiPhone() and target.isDeviceiPad() to make them universal).
Would be really cool to have a "universal" directory where we put tests meant to be run both on iPhone and iPad.
The only option right now seems to be copying the files in both folders iphone and ipad, but I don't like it at all.
I also tried to make a folder alias inside iphone\ipad pointing to a folder where I have the tests, but it is ignored by bwoken.
If someone can point me in the right direction I could try to implement this feature, also if I'm not experienced with Ruby :-)
I ask because my build fails on
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This could be because bwoken wants to build my .xcodeproj instead of my .xcworkspace, or it could be something idiosyncratic to my machine. I'm not sure where to look for guidance on this sort of thing, or how much it is to do with bwoken itself.
Hi, I installed Bwoken because it seems pretty cool and fits my needs.
Problem is that I'm not sure where to start. Do you guys have any examples?
Specifically, I'm looking for ones that uses CoffeeScript, and has classes and extends.
Hey guys,
first of all thanks for this great tool!
I'm not using a workspace in my project, just have the xcodeproj file.
In your setup instructions you tell us to create a workspace, but bwoken works just fine without the xcworkspace file.
Can you tell me a little more about this, should i create a workspace anyway?
It would be easier for me to keep going with the xcodeproj file only...
Thanks in advance!
When I try to use the simulator it does a pop up that says:
Path not found 'Users/ryanjm/code/myAppName/iphone/build/iphonesimulator/MyAppName.app'
Any ideas? With their being multiple iOS versions for the simulator can we pass additional preferences to --simulator
?
trying to run my ios app test installation, I get the following error :
macMini:OAuthClientSetup yves$ bwoken init
macMini:OAuthClientSetup yves$ bwoken test
Building............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Build Successful!
iphone example.js
: Failed to load document 'file:///Users/yves/Developpement/iOS7/rails_clients/OAuthClientSetup/integration/tmp/trace.trace/' : (Error Domain=com.apple.instruments Code=-6 "Document Missing Template Error: The operation couldn’t be completed. (com.apple.instruments error -6.)")
/Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bwoken-2.0.0/lib/bwoken/script.rb:55:in `block in run': Test Script Failed (Bwoken::ScriptFailedError)
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/open3.rb:199:in `popen_run'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/open3.rb:93:in `popen3'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bwoken-2.0.0/lib/bwoken/script.rb:53:in `run'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bwoken-2.0.0/lib/bwoken/simulator_runner.rb:21:in `each'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bwoken-2.0.0/lib/bwoken/simulator_runner.rb:21:in `execute'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bwoken-2.0.0/lib/bwoken/script_runner.rb:33:in `execute_for_family'
Hey, is there a way how to run tests without debug info? So basically that there will be just info about which test is currently running and if it passed or not.
Thanks
bwoken just stuck there because of following error:
bin/unix_instruments.sh: line 54: /dev/ptyvf: Resource busy
Anything I can do to solve it?
Thanks
In order to omit options at the command line that I always use (e.g., --simulator
)
As a tester
I want to populate a .bwokenrc
file with my default options, which would also get overridden when I specify conflicting options at the command line
By default it runs on iPhone 4-inch.
I finally got bwoken to run the included test script and now am trying to get my own script to work, but have to go through lots of trial and error to figure out where to put my files (just dropping them in the javascript folder does not seem to work)
I got this error when running tests on device
Exception encountered during 'setThrottleConstraints:' dispatch: (null)
and this error on simulator.
xcodebuild: error: 'sim' not found.
xcrun: error: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild failed with exit code 17664
1.339582 handled [c0]: < DTXMessage 0x7f9da36a8c60 : i1.0 c0 dispatch:[agentIsReady] >
1.340150 sending [c0]: < DTXMessage 0x7f9da36aa140 : i1.1 c0 >
1.349105 handled [c0]: < DTXMessage 0x7f9da36aa2f0 : i2.0 c0 dispatch:[updateScriptStatus:[1]] >
1.349543 sending [c0]: < DTXMessage 0x7f9da3763bf0 : i2.1 c0 >
1.351177 sending [c0]: < DTXMessage 0x7f9da36ab730 : i3.0 c0 dispatch:[startScriptWithInfo:< NSDictionary 0x7f9da36aca60 | 3 key/value pairs>] >
1.358965 handled [c0]: < DTXMessage 0x7f9da36ac800 : i3.1 c0 object:(NSNull*)[<null>] >
1.368855 handled [c0]: < DTXMessage 0x7f9da3440f10 : i4.0 c0 dispatch:[updateScriptStatus:[2]] >
1.369123 sending [c0]: < DTXMessage 0x7f9da374e780 : i4.1 c0 >
1.379418 handled [c0]: < DTXMessage 0x7f9da36a4ce0 : i5.0 c0 dispatch:[scriptDidThrowException:< NSDictionary 0x7f9da36ab810 | 3 key/value pairs>] >
1.379867 sending [c0]: < DTXMessage 0x7f9da36aad80 : i5.0 c0 dispatch:[stopScript] >
1.380970 handled [c0]: < DTXMessage 0x7f9da36ad1c0 : i6.0 c0 dispatch:[updateScriptStatus:[1]] >
1.389602 handled [c0]: < DTXMessage 0x7f9da3763bf0 : i5.1 c0 object:(NSNull*)[<null>] >
1.497598 handled [c0]: < DTXMessage : kDTXInterruptionMessage >
1.497767 handled [c0]: < DTXMessage : kDTXInterruptionMessage >
It seems like paths to /Developer and Instruments hardcoded somewhere in gem, so xcode-select switch cause build to fail.
Can you please add 4.5 support!
I am trying to have bwoken run during a jenkins job. the build completes successfully, and it starts the first test from the iPhone folder, but then the simulator times out. this is the command i'm using
cd /Users/Shared/Jenkins/Home/jobs/TestJob/workspace/src/folder
bwoken test --scheme 'folder\ -\ Folder'
after clicking ok on the simulator pop up the log shows this.
Building in workspace /Users/Shared/Jenkins/Home/jobs/TestJob/workspace
Fetching changes from the remote Git repository
Fetching upstream changes from https://github.com/project.git
Checking out Revision 5fb24f1a4b477047c05818d780f5d5365bf766f8 (origin/feature/bwoken-final)
[workspace] $ /bin/sh -xe /var/folders/9h/89ywpzvx2v7c37yy8hn49yq80000gn/T/hudson2637842362533209426.sh
run': Test Script Failed (Bwoken::ScriptFailedError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:86:in
popen3'run' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1427:in
to_proc'each' from /Library/Ruby/Gems/1.8/gems/bwoken-2.0.0.beta.2/lib/bwoken/simulator_runner.rb:21:in
execute'execute_for_family' from /Library/Ruby/Gems/1.8/gems/bwoken-2.0.0.beta.2/lib/bwoken/script_runner.rb:28:in
execute_in_simulator'each' from /Library/Ruby/Gems/1.8/gems/bwoken-2.0.0.beta.2/lib/bwoken/script_runner.rb:27:in
execute_in_simulator'execute' from /Library/Ruby/Gems/1.8/gems/bwoken-2.0.0.beta.2/lib/bwoken/cli/test.rb:105:in
test'run' from /Library/Ruby/Gems/1.8/gems/bwoken-2.0.0.beta.2/lib/bwoken/cli.rb:56 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require'require' from /Library/Ruby/Gems/1.8/gems/bwoken-2.0.0.beta.2/bin/bwoken:3 from /usr/bin/bwoken:19:in
load'it is running correctly from terminal.
if you need more info just let me know
I am getting this error that I couldn't overcome. I followed the instructions, saved the project as a workspace with title.
'/.rvm/gems/ruby-1.9.3-p194@Auto/gems/bwoken-1.1.1/lib/bwoken/tasks/bwoken.rake:69:in `block in <top (required)>'
I pasted the error, .rvmrc and directory structure in the below image.
I am guessing the directory structure $(BWOKEN_CONFIGURATION_BUILD_DIR) is not being set correctly. Can I do this manually.
Let me know if you need further info.
Hi,
How can I properly run a basic UIAutomation script through bwoken ?
I filled ./integration/javascript/example_js.js with the test script and tried to run it through bwoken without success. It started but it did nothing.
$>rake
Building....................................................................................................................................
Build Successful!
iphone example.js
Complete
Duration: 3.169913s
I want to transform cucumber test script to UIAutomation test script and then run them through bwoken.
Is there some hooks on bwoken ?
Bellow is the file that I tried to use through bwoken. It's working with Apple example CoreDataBooks
// Generated by CoffeeScript 1.4.0
(function() {
var AuthorScreen, BookTitleScreen, BooksScreen, NewBookScreen, Screen, Zucchini, app, extend, isNullElement, puts, raise, screensCount, target, view,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Function.prototype.bind = function(context) {
var fun;
if (!context) {
return this;
}
fun = this;
return function() {
return fun.apply(context, arguments);
};
};
String.prototype.camelCase = function() {
return this.replace(/([\-\ ][A-Za-z])/g, function($1) {
return $1.toUpperCase().replace(/[\-\ ]/g, "");
});
};
extend = function(obj, mixin) {
var method, name;
for (name in mixin) {
method = mixin[name];
obj[name] = method;
}
return obj;
};
puts = function(text) {
return UIALogger.logMessage(text);
};
raise = function(message) {
throw new Error(message);
};
UIATarget.onAlert = function(alert) {
return true;
};
target = UIATarget.localTarget();
app = target.frontMostApp();
view = app.mainWindow();
UIAElement.prototype.$ = function(name) {
var el, elem, _i, _len, _ref;
target.pushTimeout(0);
elem = null;
_ref = this.elements();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
el = _ref[_i];
elem = el.name() === name ? el : el.$(name);
if (elem) {
break;
}
}
target.popTimeout();
return elem;
};
target.waitForElement = function(element) {
var counter, found, _results;
if (!element) {
return;
}
found = false;
counter = 0;
_results = [];
while (!found && (counter < 10)) {
if (element.isValid() && element.isVisible()) {
found = true;
puts("Got the awaited element: " + element);
_results.push(this.delay(1));
} else {
this.delay(0.5);
_results.push(counter++);
}
}
return _results;
};
isNullElement = function(elem) {
return elem.toString() === "[object UIAElementNil]";
};
screensCount = 0;
target.captureScreenWithName_ = target.captureScreenWithName;
target.captureScreenWithName = function(screenName) {
var screensCountText;
screensCountText = (++screensCount < 10 ? "0" + screensCount : screensCount);
return this.captureScreenWithName_(screensCountText + "_" + screenName);
};
Zucchini = (function() {
function Zucchini() {}
Zucchini.run = function(featureText) {
var func, functionFound, line, lines, match, regExpText, screen, screenMatch, screenName, section, sections, _i, _len, _results;
sections = featureText.trim().split(/\n\s*\n/);
_results = [];
for (_i = 0, _len = sections.length; _i < _len; _i++) {
section = sections[_i];
lines = section.split(/\n/);
screenMatch = lines[0].match(/.+ on the "([^"]*)" screen:$/);
if (!screenMatch) {
raise("Line '" + lines[0] + "' doesn't define a screen context");
}
screenName = screenMatch[1];
try {
screen = eval("new " + (screenName.camelCase()) + "Screen");
} catch (e) {
raise("Screen '" + screenName + "' not defined");
}
_results.push((function() {
var _j, _len1, _ref, _ref1, _results1;
_ref = lines.slice(1);
_results1 = [];
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
line = _ref[_j];
functionFound = false;
_ref1 = screen.actions;
for (regExpText in _ref1) {
func = _ref1[regExpText];
match = line.trim().match(new RegExp(regExpText));
if (match) {
functionFound = true;
func.bind(screen)(match[1], match[2]);
}
}
if (!functionFound) {
_results1.push(raise("Action for line '" + line + "' not defined"));
} else {
_results1.push(void 0);
}
}
return _results1;
})());
}
return _results;
};
return Zucchini;
})();
Screen = (function() {
function Screen(name) {
this.name = name;
if (this.anchor) {
target.waitForElement(this.anchor());
}
}
Screen.prototype.elements = {};
Screen.prototype.actions = {
'Take a screenshot$': function() {
return target.captureScreenWithName(this.name);
},
'Take a screenshot named "([^"]*)"$': function(name) {
return target.captureScreenWithName(name);
},
'Tap "([^"]*)"$': function(element) {
if (!this.elements[element]) {
raise("Element '" + element + "' not defined for the screen '" + this.name + "'");
}
return this.elements[element]().tap();
},
'Confirm "([^"]*)"$': function(element) {
return this.actions['Tap "([^"]*)"$'].bind(this)(element);
},
'Wait for "([^"]*)" second[s]*$': function(seconds) {
return target.delay(seconds);
},
'Type "([^"]*)" in the "([^"]*)" field$': function(text, element) {
if (!this.elements[element]) {
raise("Element '" + element + "' not defined for the screen '" + this.name + "'");
}
this.elements[element]().tap();
return app.keyboard().typeString(text);
},
'Clear the "([^"]*)" field$': function(element) {
if (!this.elements[element]) {
raise("Element '" + element + "' not defined for the screen '" + this.name + "'");
}
return this.elements[element]().setValue("");
},
'Cancel the alert': function() {
var alert;
alert = app.alert();
if (isNullElement(alert)) {
raise("No alert found to dismiss on screen '" + this.name + "'");
}
return alert.cancelButton().tap();
},
'Confirm the alert': function() {
var alert;
alert = app.alert();
if (isNullElement(alert)) {
raise("No alert found to dismiss on screen '" + this.name + "'");
}
return alert.defaultButton().tap();
},
'Select the date "([^"]*)"$': function(dateString) {
var counter, dateParts, datePicker, monthWheel;
datePicker = view.pickers()[0];
if (!((!isNullElement(datePicker)) && datePicker.isVisible())) {
raise("No date picker available to enter the date " + dateString);
}
dateParts = dateString.match(/^(\d{2}) (\D*) (\d{4})$/);
if (dateParts == null) {
raise("Date is in the wrong format. Need DD Month YYYY. Got " + dateString);
}
view.pickers()[0].wheels()[0].selectValue(dateParts[1]);
counter = 0;
monthWheel = view.pickers()[0].wheels()[1];
while (monthWheel.value() !== dateParts[2] && counter < 12) {
counter++;
monthWheel.tapWithOptions({
tapOffset: {
x: 0.5,
y: 0.33
}
});
target.delay(0.4);
}
if (!(counter < 12)) {
raise("Counldn't find the month " + dateParts[2]);
}
return view.pickers()[0].wheels()[2].selectValue(dateParts[3]);
}
};
return Screen;
})();
AuthorScreen = (function(_super) {
__extends(AuthorScreen, _super);
AuthorScreen.prototype.anchor = function() {
return view.navigationBars()["Author"];
};
function AuthorScreen() {
AuthorScreen.__super__.constructor.call(this, 'author');
extend(this.elements, {
'Save': function() {
return view.navigationBars()[0].buttons()["Save"];
}
});
extend(this.actions, {
'Type "([^"]*)"$': function(text) {
var field;
field = view.textFields()[0];
return field.setValue(text);
}
});
}
return AuthorScreen;
})(Screen);
BookTitleScreen = (function(_super) {
__extends(BookTitleScreen, _super);
BookTitleScreen.prototype.anchor = function() {
return view.navigationBars()["Book Title"];
};
function BookTitleScreen() {
BookTitleScreen.__super__.constructor.call(this, 'book-title');
extend(this.elements, {
'Save': function() {
return view.navigationBars()[0].buttons()["Save"];
}
});
extend(this.actions, {
'Type "([^"]*)"$': function(text) {
var field;
field = view.textFields()[0];
return field.setValue(text);
}
});
}
return BookTitleScreen;
})(Screen);
BooksScreen = (function(_super) {
__extends(BooksScreen, _super);
BooksScreen.prototype.anchor = function() {
return view.navigationBars()["Books"];
};
function BooksScreen() {
BooksScreen.__super__.constructor.call(this, 'books');
extend(this.elements, {
'Edit': function() {
return view.navigationBars()[0].buttons()["Edit"];
},
'Add': function() {
return view.navigationBars()[0].buttons()["Add"];
}
});
extend(this.actions, {
'Scroll to "([^"]*)"$': function(elementName) {
return view.tableViews()[0].scrollToElementWithName(elementName);
},
'Delete a row "([^"]*)"$': function(rowName) {
view.tableViews()[0].cells()[rowName].switches()[0].setValue(true);
return view.tableViews()[0].cells()[rowName].buttons()[0].tap();
}
});
}
return BooksScreen;
})(Screen);
NewBookScreen = (function(_super) {
__extends(NewBookScreen, _super);
NewBookScreen.prototype.anchor = function() {
return view.navigationBars()["New Book"];
};
function NewBookScreen() {
NewBookScreen.__super__.constructor.call(this, 'new-book');
extend(this.elements, {
'Save': function() {
return view.navigationBars()[0].buttons()["Save"];
}
});
extend(this.elements, {
'Title': function() {
return view.tableViews()[0].cells()[0];
},
'Author': function() {
return view.tableViews()[0].cells()[1];
}
});
}
return NewBookScreen;
})(Screen);
Zucchini.run('Start on the "Books" screen:\n Take a screenshot\n Tap "Add"\n\nThen on the "New Book" screen:\n Take a screenshot\n Tap "Title"\n \nThen on the "Book Title" screen:\n Type "Testing with Zucchini"\n Take a screenshot\n Confirm "Save"\n\nThen on the "New Book" screen:\n Tap "Author"\n\nThen on the "Author" screen:\n Type "Vasily M. and Raj K."\n Take a screenshot\n Confirm "Save"\n\nThen on the "New Book" screen:\n Take a screenshot named "new-book-filled"\n Confirm "Save"\n \nThen on the "Books" screen:\n Scroll to "Testing with Zucchini"\n Take a screenshot named "books-with-a-new"\n Tap "Edit"\n Delete a row "Testing with Zucchini"\n \n');
}).call(this);
I have an iPad and an iPhone connected and I want to set it up so it can test on both devices. "bwoken test" and all variants of "--family=" run only against the first connected device. I'm including a screenshot of an attempt to test against the attached iPhone, with "bwoken test --family=iphone" and it executing against the iPad instead. Thanks.
Hi there,
i'm currently setting up a test environment for our app using bwoken as testrunner on jenkins and so far, everything is working fine if the tests run on simulator.
However, i recently tried to run the tests on a real device and somehow, thing didn't work out as expected:
Is bwoken supposed to deploy the app onto a connected device and start testing afterwards, just like it does on the simulator?
In my case, this does not seem to work. (if it is supposed to)
Tested with iPad 1 (seems like it does NOT work with iOS 5?!) and iPad mini (testing only started if the app was already installed, but the tests kept failing as no buttons could be tapped).
Thanks in advance!
Cheers, Tobias
Bwoken works great locally but when the Travis-CI machines try to run the tests I get the error below:
Failed to connect to local pid watcher service: (os/kern) failure
The project builds and it tests fine but the exit code is still 1 instead of 0
https://travis-ci.org/ARISGames/iOSClient
Do you guys have any suggestions on how to fix this?
Thank you,
P.S. I think this is related to the Authorization prompt when the simulator opens.
If your project or target has non-standard name for Info.plist file, you will get this error and tests are stopped.
** Execute coffeescript
** Execute iphone:test
File Doesn't Exist, Will Create: /build/iphonesimulator/Prototype.app/Info.plist
Delete: Entry, ":UIDeviceFamily", Does Not Exist
File Doesn't Exist, Will Create: /build/iphonesimulator/Prototype.app/Info.plist
File Doesn't Exist, Will Create: /build/iphonesimulator/Prototype.app/Info.plist
iphone example.js
Any ideas how to fix this?
Our iPad only app doesn't create the following build/iphonesimulator folder
BWOKEN_CONFIGURATION_BUILD_DIR = /build/iphonesimulator
and hence I am following error
Check dependencies
No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv7)
This happens when you abort a test execution half way. It causes several issues.
ScriptAgent
process will stay running forever and for some reason it cannot be killed. It's holding /dev/ptyvf
, but it's not listed by lsof
. Whoever finds out how to kill this thing via launchctl
gets a 🍺 from me.stdout
output, only stderr
, which says Resource busy - /dev/ptyvf
. Bwoken needs to pipe that properly so that the user sees it, and not hang.The last change to colorful_formatter (do not show Other lines on Sept.25) changes doesn't allow logElementTree to display. Need to add logElementTree, logElement as statuses to display in file.
There's no way to get an #import statement into the generated javascript through pure coffeescript means... the compiler would choke.
I imagine having to use something like:
###
imports:
tuneup.js
###
which would result in:
#import "tuneup.js"
I don't know if anyone as tried to run Bwoken as a post-action in build scheme, I was trying out that today so we could run UI test on OS X Server, but I've run into this weird error says invalid byte sequence in US-ASCII (ArgumentError)
I've tried to add encoding info into my own Gemfile but that didn't work. And this doesn't happen if I run Bwoken locally on my machine.
The full error message
/Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/formatter.rb:29:in `line_demuxer': invalid byte sequence in US-ASCII (ArgumentError)
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/formatter.rb:65:in `block in format'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/formatter.rb:64:in `each_line'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/formatter.rb:64:in `format'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/script.rb:54:in `block in run'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:217:in `popen_run'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:99:in `popen3'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/script.rb:53:in `run'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/device_runner.rb:17:in `each'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/device_runner.rb:17:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/script_runner.rb:55:in `execute_on_device'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/script_runner.rb:22:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/cli/test.rb:103:in `test'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/cli/test.rb:65:in `run'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/lib/bwoken/cli.rb:52:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/bwoken-2.0.0.beta.1/bin/bwoken:3:in `<top (required)>'
from /usr/bin/bwoken:23:in `load'
from /usr/bin/bwoken:23:in `<main>'
Hey,
I got very strange issue with bwoken, that basically simulator is not launched automatically when I run "rake" command. That means its stucked on "iphone example.js"...
Please check this very short video http://cl.ly/1h1f473r2f2f0C2j060f of running rake with --trace.
I am using:
bwoken 1.0.0
ruby 1.9.3 (using rvm)
Xcode 4.3.3 (with command line tools installed)
Mac OS X 10.7.4
I'm trying to debug why broken won't work when run from jenkins and i would need to see the command that is launching instruments so that i can check that it is correct.
--verbose option unfortunately does not do this.
Is there a quick way for me to see this in the meantime?
Thanks, olivier
The installation docs says to use 2.0.0.beta3, but they should say 2.0.0 as the beta3 has a bug or two around spaces in project paths.
I have Xcode 4.6 and iphone simulator 6.0 on the machine. I'm able to run bwoken tests just fine from the machine itslef. But when I run from a remote machine via ssh. The simulator shows up but when the app launches it shows a blank, black colored screen and the tests are not seeing the UI elements and return UIAElementNil.
I needed to be able to run remotely because I was trying to setup the machine as a Jenkins slave so that I can do the builds from the CI interface.
At least for my two machines, there is no longer a full path to Automation.tracetemplate. Running xcrun instruments -s
I'm left with the following templates:
Known Templates:
"Activity Monitor"
"Allocations"
"Automation"
"Blank"
"Cocoa Layout"
"Core Animation"
"Core Data"
"Counters"
"Dispatch"
"Energy Diagnostics"
"File Activity"
"GPU Driver"
"Leaks"
"Multicore"
"Network"
"OpenGL ES Analysis"
"Sudden Termination"
"System Trace"
"System Usage"
"Time Profiler"
"UI Recorder"
"Zombies"
I haven't done much digging into this, but it runs fine for me if I adjust the [-t template]
option via a slight code tweak like so:
def path_to_automation_template
template = nil
`xcrun instruments -s 2>&1 | grep Automation.tracetemplate`.split("\n").each do |path|
path = path.gsub(/^\s*"|",\s*$/, "")
template = path if File.exists?(path)
break if template
end
template || 'Automation' #ADDED HERE
end
We're back in business. I'm not sure if it's safe to assume this as a default, however. Without this, you'll get the following error message:
2014-09-22 17:21:22.000 instruments[9053:1007] *** -[__NSCFConstantString stringByAppendingPathExtension:]: cannot append extension 'tracetemplate' to path ''
Instruments Usage Error : The specified template '' does not exist.
instruments, version 6.0 (56156)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
Vanilla JS tests choke on the #github command. Parser only runs on coffeescript tests. This should either be fixed or specified in the documentation.
Hi guys,
just another question regarding continuous integration:
By default bwoken uses the colorful formatter which is really nice!
However if you run your tests with bwoken on jenkins, the console can't handle the colorful highlighting and it looks like this:
[34mBuilding�[m�[34m.�[m�[34m.[m�[34m.�[m�[34m.�[m�[34m.�[m�[34m.�[m�[34m.�[m�[34m.�[m�[34m.�[m�[34m.�[m�[34m.�[m
�[32mBuild Successful!�[m
�[36mipad Testscript.js�[m
�[36mStart:�[m Testscript
�[36mDefault:�[m I'm an iPad Simulator
�[36mDebug:�[m �[33mtap�[m toolbar.buttons[�[35m"Show menu"�[m]
�[36mDebug:�[m �[33mtap�[m popover.actionSheet.buttons[�[35m"Settings"�[m]
�[36mDebug:�[m �[33mtap�[m tableViews[�[35m"Empty list"�[m].cells[�[35m"Something"�[m]
�[36mDebug:�[m �[33mtap�[m tableViews[�[35m"Empty list"�[m].cells[�[35m"Test"�[m].textFields[0]
�[36mDebug:�[m �[33mtap�[m tableViews[�[35m"Empty list"�[m].cells[�[35m"Test"�[m].textFields[0].buttons[�[35m"Clear text"�[m]
�[36mDebug:�[m keyboard.typeString("default")
�[36mDebug:�[m �[33mtap�[m tableViews[�[35m"Empty list"�[m].cells[�[35m"Test2"�[m].textFields[0]
�[36mDebug:�[m �[33mtap�[m tableViews[�[35m"Empty list"�[m].cells[�[35m"Test2"�[m].textFields[0].buttons[�[35m"Clear text"�[m]
�[36mDebug:�[m keyboard.typeString("address")
�[36mDebug:�[m �[33mtap�[m navigationBar.leftButton
�[36mDebug:�[m �[33mtap�[m navigationBar.leftButton
�[32mPass:�[m Testscript
�[32mComplete�[m
Duration: �[4;1m27.359995s�[m
So, is there an easy option to disable the colorful formatting for this configuration?
Thanks!
my tests won't, just completes immediately.
That, or I'm doing it wrong :)
It suggests running 'rvm rvmrc to .ruby-version', which I did. OK.
rake aborted!
cannot load such file -- bwoken/tasks
Unsure how to proceed here.
(Ruby version is 1.9.3-p429)
I followed the instructions to a T and set it up with tuneup. It builds fine but nothing is run inside of my tests. Even a blank test with UIALogger.logMessage("Turn on edit mode") logs out nothing.
Any ideas? I'm on IOS7/Xcode5
We currently need to set the architecture to i386 in order to run the application in the simulator, we set the flag "-arch i386" . Is there a way that we can customize the xcodebuild command to incorporate this?
Extracted from #72.
--family
specifying iPad or iPhone.Bwoken runs the test on the specified family
Bwoken only ever runs on the first device that was connected.
Hello,
May be I missed it while reading docs, but...
How can I install bwoken and it's folders structure in different folder, not in root folder (that contains .xproject file)
Thanks.
In unit testing frameworks (which admittedly bwoken is not) there are setup and tear down methods that can be implemented to run before and after each test. Is there such a mechanism in bwoken?
The scenario is this, and I'd be quite surprised that I'm the first to run up against it: I need to reset (or delete my app) before/after some tests so that he app starts in a known state. If I don't have this sort of thing, it makes trying to script tests pretty much useless since I still need manual steps to clear the simulator (put it in a known state) before the tests can be run.
Does bwoken all ready provide such a hook? If not, how are others dealing with putting the application into a known state before running tests? I don't see how you could do any sort of reliable tests without having a known starting state.
Thanks for your thoughts!
I have problem with using bwoken.
When I use "rake" command after installation of bwoken, this text is displayed in the terminal:
Instruments Usage Error : The specified template 'file://localhost/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate' does not exist.
instruments, version 4.5 (4523)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
I am using:
bwoken 1.1.0
ruby 1.9.3 (using rvm)
Xcode 4.5 (4G182) (with command line tools installed)
Mac OS X 10.8.2
Do you have a solution for this, please?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.