Skip to content

Instantly share code, notes, and snippets.

@DominikDary
Created July 20, 2014 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikDary/58a1a21e55eaabc1475a to your computer and use it in GitHub Desktop.
Save DominikDary/58a1a21e55eaabc1475a to your computer and use it in GitHub Desktop.
Test to verify the wait mechanism works fine in selendroid with the new netty implementation.
/*
* Copyright 2014 eBay Software Foundation and selendroid committers.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.selendroid.driver;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class NettyWaitForElementTest {
private SelendroidDriver driver = null;
@Before
public void setup() throws Exception {
driver =
new SelendroidDriver(
SelendroidCapabilities.emulator("io.selendroid.testapp:0.11.0-SNAPSHOT"));
}
@Test
public void shouldOpenActivityAndWaitForWebview() throws Exception {
driver.get("and-activity://" + "io.selendroid.testapp." + "WebViewActivity");
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("mainWebView")));
}
@After
public void tearDown() {
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment