*
* @param timeoutMillis
* Number of ms to wait
- * @throws InterruptedException
*/
- protected void sleep(int timeoutMillis) throws InterruptedException {
+ protected void sleep(int timeoutMillis) {
while (timeoutMillis > 0) {
int d = Math.min(BROWSER_TIMEOUT_IN_MS, timeoutMillis);
- Thread.sleep(d);
+ try {
+ Thread.sleep(d);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
timeoutMillis -= d;
// Do something to keep the connection alive
private void assertInitialItemCount() {
// wait for a bit in case the count is updating
- try {
- sleep(1000);
- } catch (InterruptedException ignore) {
- }
+ sleep(1000);
assertThat("Wrong initial item count.", labelElement.getText(),
is("2600"));
}
attemptShortcut("A on");
// add a bit more delay to make sure the caption doesn't change later
- try {
- sleep(2000);
- } catch (InterruptedException ignore) {
- }
+ sleep(2000);
assertThat(panel.findElement(By.className("v-panel-caption"))
.findElement(By.tagName("span")).getText(), is("A on"));
assertScrollPositionIsNotVisible();
}
- @Override
- protected void sleep(int milliseconds) {
- try {
- super.sleep(milliseconds);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
private void assertFirstRowIdIs(String expected) {
List<WebElement> cellsOfFirstColumn = getCellsOfFirstColumn();
WebElement first = cellsOfFirstColumn.get(0);
private void pressEscAndWait() {
new Actions(driver).sendKeys(Keys.ESCAPE).build().perform();
- try {
- sleep(100);
- } catch (InterruptedException e) {
- }
+ sleep(100);
}
}
protected void disableWaitingAndWait() {
testBench().disableWaitForVaadin();
- try {
- sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ sleep(500);
}
}
createProxy(getProxyPort());
break;
} catch (JSchException e) {
- try {
- sleep(500);
- } catch (InterruptedException e1) {
- }
+ sleep(500);
if (i == 9) {
throw new RuntimeException(
"All 10 attempts to connect a proxy failed", e);