-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Anvil testcase for activityIndicator test Suite #4806
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7ecc690
Anvil testcase for activityIndicator test Suite
7722974
Anvil Modified testcase for Activity_indicator test suite
1393cc0
Anvil modified testcase for Activity_indicator
0ba2400
Modified tset case for Android_activity_indicator
877e20d
Modified testCase for Android_activity_indicator
96dbdd6
Test case for Android_activity_indicator test suite
6507ef5
Anvil testcase for Activity_indicator
740412e
win changed to win1
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
support/anvil/configSet/Resources/suites/android/android_activityIndicator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2011-2012 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
module.exports = new function() { | ||
var finish; | ||
var valueOf; | ||
this.init = function(testUtils) { | ||
finish = testUtils.finish; | ||
valueOf = testUtils.valueOf; | ||
} | ||
|
||
this.name = "activityIndicator"; | ||
this.tests = [ | ||
{name: "activityIndicator", timeout: 5000}, | ||
{name: "focusWindow", timeout:50000}, | ||
] | ||
|
||
//TIMOB-6092 | ||
this.activityIndicator = function(testRun) { | ||
var win = Ti.UI.createWindow({ | ||
backgroundColor : 'red' | ||
}); | ||
var style1; | ||
if (Ti.Platform.name === 'iPhone OS') { | ||
style1 = Ti.UI.iPhone.ActivityIndicatorStyle.PLAIN; | ||
} else { | ||
style1 = Ti.UI.ActivityIndicatorStyle.PLAIN; | ||
} | ||
var activityIndicator = Ti.UI.createActivityIndicator({ | ||
color : 'red', | ||
font : { | ||
fontFamily : 'Helvetica Neue', | ||
fontSize : 26, | ||
fontWeight : 'bold' | ||
}, | ||
message : 'Loading...', | ||
style:style1, | ||
top : 0, | ||
left : 0, | ||
height: Ti.UI.SIZE, | ||
width: Ti.UI.SIZE | ||
}); | ||
win.add(activityIndicator); | ||
win.addEventListener('focus', function(){ | ||
valueOf(testRun, function(){ | ||
activityIndicator.show(); | ||
}).shouldNotThrowException(); | ||
valueOf(testRun, activityIndicator.color).shouldBe('red'); | ||
activityIndicator.color = 'green'; | ||
valueOf(testRun, activityIndicator.color).shouldBe('green'); | ||
valueOf(testRun, activityIndicator.getTop()).shouldBe(0); | ||
valueOf(testRun, activityIndicator.getLeft()).shouldBe(0); | ||
activityIndicator.color = 'blue'; | ||
valueOf(testRun, activityIndicator.color).shouldBe('blue'); | ||
valueOf(testRun, function(){ | ||
activityIndicator.hide(); | ||
}).shouldNotThrowException(); | ||
|
||
finish(testRun); | ||
}); | ||
win.open(); | ||
} | ||
|
||
//TIMOB-7024 | ||
this.focusWindow = function(testRun) { | ||
var suite_complete=false; | ||
var win1 = Ti.UI.createWindow({ | ||
fullscreen : false, | ||
backgroundColor:'red' | ||
}); | ||
win1.add(Ti.UI.createLabel({ | ||
top : '0dp', | ||
text : 'Win1' | ||
})); | ||
setTimeout(function(){ | ||
var win2 = Ti.UI.createWindow({ | ||
fullscreen : false, | ||
backgroundColor:'green' | ||
}); | ||
win2.add(Ti.UI.createLabel({ | ||
top : '0dp', | ||
text : 'Win2' | ||
})); | ||
win2.open(); | ||
setTimeout(function(){ | ||
suite_complete=true; | ||
win2.close(); | ||
},1000); | ||
},3000); | ||
win1.addEventListener('focus', function(){ | ||
var actInd = Ti.UI.createActivityIndicator({ | ||
bottom : 10, | ||
height : 50, | ||
width : 10, | ||
message : 'Loading...' | ||
}); | ||
win1.add(actInd); | ||
valueOf(testRun,function(){ | ||
actInd.show(); | ||
}).shouldNotThrowException(); | ||
valueOf(testRun, actInd.getBottom()).shouldBe(10); | ||
valueOf(testRun, actInd.getHeight()).shouldBe(50); | ||
valueOf(testRun, actInd.getWidth()).shouldBe(10); | ||
setTimeout(function(){ | ||
valueOf(testRun,function(){ | ||
actInd.hide(); | ||
}).shouldNotThrowException(); | ||
}, 2000); | ||
if(suite_complete == true) | ||
finish(testRun); | ||
}); | ||
win1.open(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed with @shameer49 about the change required here.