RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

Robotium 5.5.1 List Condition failing #781

Closed macgills closed 5 years ago

macgills commented 9 years ago

private class WaitForListDeletion implements Condition {

  private final int initialCount;
  private final ListView view;

  public WaitForListDeletion(final ListView view)
  {
     this.view = view;
     initialCount = getCount(view);
  }

  private int getCount(final ListView view)
  {
     return view.getAdapter().getCount();
  }

  @Override
  public boolean isSatisfied()
  {
     return getCount(view) < initialCount;
  }

} So I delete an item from a list (with a swipe gesture) and then use this condition.This condition no longer works and I really don't know why. Can not upgrade from 5.3.1.

renas commented 9 years ago

Thanks for reporting this. When you say it doesn't work how exactly doesn't it work? Is this also the case with 5.4.1?

On Wed, Sep 23, 2015 at 7:07 AM, macgills notifications@github.com wrote:

private class WaitForListDeletion implements Condition {

private final int initialCount; private final ListView view;

public WaitForListDeletion(final ListView view) { this.view = view; initialCount = getCount(view); }

private int getCount(final ListView view) { return view.getAdapter().getCount(); }

@Override public boolean isSatisfied() { return getCount(view) < initialCount; }

} So I delete an item from a list (with a swipe gesture) and then use this condition.This condition no longer works and I really don't know why. Can not upgrade from 5.3.1.

— Reply to this email directly or view it on GitHub https://github.com/RobotiumTech/robotium/issues/781.

macgills commented 9 years ago

Thanks for speedy reply. I am asserting the result of the condition with a timeout of 20 seconds, probably overkill but the swipe triggers a DB transaction before the item is actually removed from the adapter. It passes on 5.3.1 in probably a second. Have not tried 5.4.1 but will do so now

macgills commented 9 years ago

Not working on 5.4.1

renas commented 9 years ago

Would it be possible for you to share your project or another project that exhibits this issue?

On Wed, Sep 23, 2015 at 7:28 AM, macgills notifications@github.com wrote:

Not working on 5.4.1

— Reply to this email directly or view it on GitHub https://github.com/RobotiumTech/robotium/issues/781#issuecomment-142618586 .

macgills commented 9 years ago

I don't think it will become a priority at work for a while yet (no need for recyclerView methods immediately) so I can't justify the time to setting up a demo project, sorry. Definitely cannot share the project.

renas commented 9 years ago

Ok no worries. We'll see try to reproduce it on our side. Thanks again for reporting this.

On Wed, Sep 23, 2015 at 7:37 AM, macgills notifications@github.com wrote:

I don't think it will become a priority at work for a while yet (no need for recyclerView methods immediately) so I can't justify the time to setting up a demo project, sorry. Definitely cannot share the project.

— Reply to this email directly or view it on GitHub https://github.com/RobotiumTech/robotium/issues/781#issuecomment-142621134 .

macgills commented 5 years ago

Project is dead? closing this to clear it out of my issues