Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.Duration


  public DesiredCapabilities capabilities = DesiredCapabilities.opera();
  public File profileDirectory;

  @Before
  public void setup() throws IOException {
    OperaIntervals.HANDSHAKE_TIMEOUT.setValue(new Duration(2, TimeUnit.SECONDS));
    profileDirectory = new TemporaryFolder().newFolder();
    capabilities.setCapability(PROFILE.getCapability(), profileDirectory.getPath());
  }
View Full Code Here


    settings = new OperaSettings();
  }

  @Before
  public void setup() {
    OperaIntervals.HANDSHAKE_TIMEOUT.setValue(new Duration(2, TimeUnit.SECONDS));
  }
View Full Code Here

  }

  public ScreenCaptureReply captureScreen(long timeout, List<String> knownMD5s) {
    assertNotShutdown();

    ScreenCapture capture = new ImplicitWait(new Duration(timeout, TimeUnit.MILLISECONDS))
        .until(new Callable<ScreenCapture>() {
          public ScreenCapture call() throws Exception {
            return ScreenCapture.of();
          }
        });
View Full Code Here

    }

    public OperaTimeouts timeouts() {
      return new OperaTimeouts() {
        public Timeouts implicitlyWait(long time, TimeUnit unit) {
          OperaIntervals.IMPLICIT_WAIT.setValue(new Duration(time, unit));
          return this;
        }

        public Timeouts setScriptTimeout(long time, TimeUnit unit) {
          OperaIntervals.SCRIPT_TIMEOUT.setValue(new Duration(time, unit));
          return this;
        }

        public Timeouts setDefaultResponseTimeout(long time, TimeUnit unit) {
          OperaIntervals.DEFAULT_RESPONSE_TIMEOUT.setValue(new Duration(time, unit));
          return this;
        }

        /* this will not work as expected since SOCKET_READ_RETRY_TIMEOUT is used before it can be changed
        public Timeouts setSocketReadRetryTimeout(long time, TimeUnit unit) {
          OperaIntervals.SOCKET_READ_RETRY_TIMEOUT.setValue(new Duration(time, unit));
          return this;
        }
       */

        public Timeouts pageLoadTimeout(long time, TimeUnit unit) {
          OperaIntervals.PAGE_LOAD_TIMEOUT.setValue(new Duration(time, unit));
          return this;
        }

        public Timeouts responseTimeout(long time, TimeUnit unit) {
          OperaIntervals.RESPONSE_TIMEOUT.setValue(new Duration(time, unit));
          return this;
        }

        public Timeouts selftestTimeout(long time, TimeUnit unit) {
          OperaIntervals.SELFTEST_TIMEOUT.setValue(new Duration(time, unit));
          return this;
        }
      };
    }
View Full Code Here

     *
     * @return duration string.
     */
    public String getDurationString() {
        StringBuilder ds = new StringBuilder();
        Duration d = new Duration(endTime - startTime, TimeUnit.NANOSECONDS);
        long h = d.in(TimeUnit.HOURS);
        if (h > 0)
            ds.append(h).append("hour");
        long m = d.in(TimeUnit.MINUTES) % 60;
        if (ds.length() > 0)
            ds.append('/').append(m).append("min");
        else if (m > 0)
            ds.append(m).append("min");
        long s = d.in(TimeUnit.SECONDS) % 60;
        double ms = (d.in(TimeUnit.MILLISECONDS) % 1000) / 1000.0;
        if (ds.length() > 0)
            ds.append('/');
        ds.append(String.format("%.3fsec", s + ms));
        return ds.toString();
    }
View Full Code Here

        waitFor.withTimeoutOf(5000).milliseconds()
                .pollingEvery(100).milliseconds()
                .until(weHaveWaitedEnough(counter));

        verify(sleeper, times(3)).sleep(new Duration(100, TimeUnit.MILLISECONDS));
    }
View Full Code Here

        ignoredExceptions.addAll(Arrays.asList(types));
        return this;
    }

    public ThucydidesFluentWait<T> withTimeout(long duration, TimeUnit unit) {
        this.timeout = new Duration(duration, unit);
        return this;
    }
View Full Code Here

        this.timeout = new Duration(duration, unit);
        return this;
    }

    public ThucydidesFluentWait<T> pollingEvery(long duration, TimeUnit unit) {
        this.interval = new Duration(duration, unit);
        return this;
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.Duration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.