本文整理汇总了Java中org.jboss.arquillian.graphene.Graphene类的典型用法代码示例。如果您正苦于以下问题:Java Graphene类的具体用法?Java Graphene怎么用?Java Graphene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Graphene类属于org.jboss.arquillian.graphene包,在下文中一共展示了Graphene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: editContent
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
public void editContent(String firstName,
String lastName,
String address,
String city,
String telephone) {
this.firstName.clear();
this.lastName.clear();
this.address.clear();
this.city.clear();
this.telephone.clear();
this.firstName.sendKeys(firstName);
this.lastName.sendKeys(lastName);
this.address.sendKeys(address);
this.city.sendKeys(city);
this.telephone.sendKeys(telephone);
Graphene.guardHttp(this.save).click();
}
示例2: testTimeout
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
@RunAsClient
@InSequence(20)
public void testTimeout(@ArquillianResource URL url) throws Exception {
// 1. Create our test with a unique channel id.
final String channelId = "" + System.currentTimeMillis();
// Set timeout for 1 minute.
String params = String.format("/channelPage.jsp?test-channel-id=%s&timeout-minutes=%d", channelId, 1);
driver.get(url + params);
// 2. Verify that the server received our channel id and is using it for this tests.
WebElement channel = driver.findElement(By.id("channel-id"));
assertEquals(channelId, channel.getText());
// 3. Verify that the channel gets closed after the 1 minute timeout.
Graphene.waitModel(driver).until().element(By.id("status")).text().equalTo("opened");
// This should put us over the 1 minute timeout.
Graphene.waitModel(driver).withTimeout(90, TimeUnit.SECONDS).until().element(By.id("status")).text().equalTo("closed");
}
示例3: testRpc
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
@RunAsClient
public void testRpc(@ArquillianResource URL url) throws Exception {
driver.get(url.toExternalForm());
WebElement getButton = driver.findElement(By.id("getButton"));
Graphene.waitModel(driver).until().element(getButton).is().enabled();
getButton.click();
final WebElement response = driver.findElement(By.id("response"));
Graphene.waitModel(driver).until(new Predicate<WebDriver>() {
public boolean apply(WebDriver input) {
return response.getText().length() > 0;
}
});
}
示例4: testSecuredResource
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testSecuredResource() throws InterruptedException {
try {
indexPage.clickSecured();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("error"), UNAUTHORIZED)));
} catch (Exception e) {
fail("Should display an error message");
}
}
示例5: testAdminResource
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testAdminResource() {
try {
indexPage.clickAdmin();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("error"), UNAUTHORIZED)));
} catch (Exception e) {
fail("Should display an error message");
}
}
示例6: testPublicResource
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testPublicResource() {
try {
indexPage.clickPublic();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("message"), MESSAGE_PUBLIC)));
} catch (Exception e) {
fail("Should display an error message");
}
}
示例7: testAdminWithAuthAndRole
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testAdminWithAuthAndRole() throws MalformedURLException, InterruptedException {
try {
indexPage.clickLogin();
loginPage.login("test-admin", "password");
indexPage.clickAdmin();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("message"), MESSAGE_ADMIN)));
indexPage.clickLogout();
} catch (Exception e) {
fail("Should display logged in user");
}
}
示例8: testUserWithAuthAndRole
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testUserWithAuthAndRole() throws MalformedURLException, InterruptedException {
try {
indexPage.clickLogin();
loginPage.login("alice", "password");
indexPage.clickSecured();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("message"), MESSAGE_SECURED)));
indexPage.clickLogout();
} catch (Exception e) {
fail("Should display logged in user");
}
}
示例9: testLogin
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testLogin() throws InterruptedException {
try {
indexPage.clickLogin();
loginPage.login("test-admin", "password");
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.id("username"), "admin")));
profilePage.clickLogout();
} catch (Exception e) {
fail("Should display logged in user");
}
}
示例10: testSecuredResource
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testSecuredResource() throws InterruptedException {
try {
indexPage.clickSecured();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("error"), UNAUTHORIZED)));
} catch (Exception e) {
debugTest(e);
fail("Should display an error message");
}
}
示例11: testAdminResource
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testAdminResource() {
try {
indexPage.clickAdmin();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.id("message"), UNAUTHORIZED)));
} catch (Exception e) {
debugTest(e);
fail("Should display an error message");
}
}
示例12: testPublicResource
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testPublicResource() {
try {
indexPage.clickPublic();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.id("message"), MESSAGE_PUBLIC)));
} catch (Exception e) {
debugTest(e);
fail("Should display an error message");
}
}
示例13: testAdminWithAuthAndRole
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testAdminWithAuthAndRole() throws MalformedURLException, InterruptedException {
try {
indexPage.clickLogin();
loginPage.login("test-admin", "password");
waitNg2Init();
indexPage.clickAdmin();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.className("message"), MESSAGE_ADMIN)));
indexPage.clickLogout();
} catch (Exception e) {
debugTest(e);
fail("Should display logged in user");
}
}
示例14: testUserWithAuthAndRole
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void testUserWithAuthAndRole() throws MalformedURLException, InterruptedException {
try {
indexPage.clickLogin();
loginPage.login("alice", "password");
waitNg2Init();
indexPage.clickSecured();
assertTrue(Graphene.waitGui().until(ExpectedConditions.textToBePresentInElementLocated(By.id("message"), MESSAGE_SECURED)));
indexPage.clickLogout();
} catch (Exception e) {
debugTest(e);
fail("Should display logged in user");
}
}
示例15: browserTest
import org.jboss.arquillian.graphene.Graphene; //导入依赖的package包/类
@Test
public void browserTest() {
driver.get("http://www.google.com/");
Graphene.waitAjax().until().element(queryField).is().visible();
queryField.sendKeys("browserstack");
queryField.submit();
Graphene.waitAjax().until().element(searchResult).text().contains("BrowserStack");
}