Sha256: 2d2033ade9345f3c2bd94dec0b9af1171c757051936a06433855609f2c793ca0
Contents?: true
Size: 1.09 KB
Versions: 121
Compression:
Stored size: 1.09 KB
Contents
package sh.calaba.instrumentationbackend.actions.wait; import sh.calaba.instrumentationbackend.InstrumentationBackend; import sh.calaba.instrumentationbackend.Result; import sh.calaba.instrumentationbackend.actions.Action; public class WaitForText implements Action { @Override public Result execute(String... args) { int timeout = 90 * 1000; if (args.length > 1) { // a second argument is a timeout try { // the argument is in seconds but robotium takes milliseconds timeout = 1000 * Integer.parseInt(args[1]); } catch (NumberFormatException e) { return new Result(false, "Invalid timeout supplied. Should be an integer."); } } boolean timedOut = !InstrumentationBackend.solo.waitForText(args[0], 1, timeout); if(timedOut) { return new Result(false, "Time out while waiting for text:" + args[0]); } else { return Result.successResult(); } } @Override public String key() { return "wait_for_text"; } }
Version data entries
121 entries across 121 versions & 2 rubygems