You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
slow due to timing out of first condition before second condition is evaluated
if a new sub class of EditActivity is added, the above code needs to be modified. It is not scaleable.
Suggested modification
using the instanceof operator should work. I assume the current code is implemented using Class:getClass() comparisons.
Possible issues
Cases:
Where the current implementation returns true, the proposed waitForActivity() functionality will always return true
Where the current functionality returns false sometimes the new functionality will return true
eg.
Current: waitForClass(ParentActivity.class) -> false
Proposed: waitForClass(ParentActivity.class) -> true
The 2) case looks like it may be an issue for some current projects. If this is an issue adding a new method to Solo would be just as helpful. Actually thinking about it more, I think it would probably be the better solution.
Maybe call it waitForActivityInstanceOf()
Thanks for Robotium it has been a huge help for me :)
I would recommend that if the requested feature is not already present in another function, then it should definitely be implemented in a new separate function.
I'd see your waitForActivityInstanceOf() and raise you a waitForActivitySubclass().
InstanceOf "feels" like it would contradict the required Class parameter signature.
From ianm...@gmail.com on October 31, 2013 11:48:35
Lets say we have the following classes
Activity
EditActivity extends Activity
NoteEditActivity extends EditActivity
NotebookEditActivity extends EditActivity
Current functionality
In Robotium now calling waitForActivity(EditActivity.class)
will return false for its subclasses (ie. NoteEditActivity and NotebookEditActivity).
Desired functionality
having waitForActivity(EditActivity.class) return true for all its subclasses (ie. NoteEditActivity and NotebookEditActivity).
Current usage/workaround
calling
solo.waitForActivity(NoteEditActivity.class, TIME_OUT) || solo.waitForActivity(NotebookEditActivity.class, TIME_OUT)
Problems
Suggested modification
using the instanceof operator should work. I assume the current code is implemented using Class:getClass() comparisons.
Possible issues
Cases:
eg.
Current: waitForClass(ParentActivity.class) -> false
Proposed: waitForClass(ParentActivity.class) -> true
The 2) case looks like it may be an issue for some current projects. If this is an issue adding a new method to Solo would be just as helpful. Actually thinking about it more, I think it would probably be the better solution.
Maybe call it waitForActivityInstanceOf()
Thanks for Robotium it has been a huge help for me :)
Original issue: http://code.google.com/p/robotium/issues/detail?id=548
The text was updated successfully, but these errors were encountered: