- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.xwiki.test.ui.XWikiWebDriver
类的一些代码示例,展示了XWikiWebDriver
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWikiWebDriver
类的具体详情如下:
包路径:org.xwiki.test.ui.XWikiWebDriver
类名称:XWikiWebDriver
[英]Wraps a org.openqa.selenium.WebDriver instance and adds new APIs useful for XWiki tests.
[中]包装一个组织。openqa。硒。WebDriver实例,并添加了对XWiki测试有用的新API。
代码示例来源:origin: org.xwiki.platform/xwiki-platform-flamingo-theme-test-pageobjects
public List<String> getVariableCategories()
{
List<String> results = new ArrayList<>();
List<WebElement> categoryElems = getDriver().findElements(
By.xpath("//div[@id='panel-theme-variables']//div[@class='panel-body']"
+ "//li//a[@data-toggle='tab']"));
for (WebElement elem : categoryElems) {
results.add(elem.getText());
}
return results;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* @since 7.0RC1
*/
private void clickSubMenuEntryFromMenu(By menuBy, String id)
{
// Open the parent Menu
getDriver().findElement(menuBy).click();
// Wait for the submenu entry to be visible
getDriver().waitUntilElementIsVisible(By.id(id));
// Click on the specified entry
getDriver().findElement(By.id(id)).click();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
public boolean hasElementWithoutWaiting(By by)
{
try {
findElementWithoutWaiting(by);
return true;
} catch (NoSuchElementException e) {
return false;
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* Forces the driver to wait for a {@link #getTimeout()} number of seconds when looking up page elements
* before declaring that it cannot find them.
*/
public void setDriverImplicitWait()
{
setDriverImplicitWait(getTimeout());
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* Wait until the element given by the locator is displayed. Give up after specified timeout (in seconds).
* <p>
* Only use this API if you absolutely need a longer timeout than the default, otherwise use
* {@link #waitUntilElementIsVisible(org.openqa.selenium.By)}.
*
* @param locator the locator for the element to look for
* @param timeout the timeout after which to give up
* @since 5.4RC1
*/
public void waitUntilElementIsVisible(final By locator, int timeout)
{
int currentTimeout = getTimeout();
try {
setTimeout(timeout);
waitUntilElementsAreVisible(new By[] {locator}, true);
} finally {
setTimeout(currentTimeout);
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
public List<WebElement> findElementsWithoutWaiting(By by)
{
// Temporarily remove the implicit wait on the driver since we're doing our own waits...
manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
try {
return findElements(by);
} finally {
setDriverImplicitWait();
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
public void deleteProperty(String propertyName)
{
final By propertyLocator = By.id("xproperty_" + propertyName);
final WebElement propertyContainer = getDriver().findElement(propertyLocator);
WebElement deleteLink = propertyContainer.findElement(By.className("delete"));
deleteLink.click();
// Expect a confirmation box
getDriver().waitUntilElementIsVisible(By.className("xdialog-box-confirmation"));
getDriver().findElement(By.cssSelector(".xdialog-box-confirmation input[value='Yes']")).click();
getDriver().waitUntilElementDisappears(propertyLocator);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
public void removeAllDeprecatedProperties()
{
getDriver().findElement(By.className("syncAllProperties")).click();
getDriver().waitUntilElementDisappears(By.className("deprecatedProperties"));
}
代码示例来源:origin: phenotips/phenotips
public boolean checkImmunodeficiencyDissapearsFromRightInvestigateBox()
{
this.getDriver().waitUntilElementDisappears(By
.xpath(
"//*[contains(@class, 'background-search')]//label[contains(@class, 'yes')][.//input[@value = 'HP:0002721']]"));
try {
return !getDriver()
.hasElement(
By.xpath(
"//*[contains(@class, 'background-search')]//label[contains(@class, 'yes')][.//input[@value = 'HP:0002721']]"));
} catch (NoSuchElementException e) {
return false;
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* @return the list of properties that have been modified
*/
public List<String> getPropertyNames()
{
List<String> propertyNames = new ArrayList<>();
for (WebElement element : getDriver().findElementsWithoutWaiting(this.container, By.className("diff-header"))) {
propertyNames.add(element.getText().trim());
}
return propertyNames;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* @param paneId valid values: "history", "comments", etc
*/
public void waitForDocExtraPaneActive(String paneId)
{
getDriver().waitUntilElementIsVisible(By.id(paneId + "content"));
}
代码示例来源:origin: org.phenotips/patient-data-pageobjects
@Override
public void waitUntilPageJSIsLoaded()
{
getDriver().waitUntilJavascriptCondition("return window.Prototype != null && window.Prototype.Version != null");
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
public AttachmentsPane openAttachmentsDocExtraPane()
{
getDriver().findElement(By.id("Attachmentslink")).click();
waitForDocExtraPaneActive("attachments");
return new AttachmentsPane();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* @return the number of rows in the live table
*/
public int getRowCount()
{
WebElement liveTableBody = getDriver().findElementWithoutWaiting(By.id(this.livetableId + "-display"));
// We use XPath because we're interested only in the direct children.
return getDriver().findElementsWithoutWaiting(liveTableBody, By.xpath("tr")).size();
}
代码示例来源:origin: phenotips/phenotips
public boolean hasPhenotypeSelected(String label, boolean positive)
{
return getDriver().hasElement(
By.xpath("//*[contains(@class, 'phenotype-info')]//*[contains(text(),'" + (positive ? "" : "NO ") + label
+ "')]"));
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* Waits until the given locator corresponds to either a hidden or a deleted element.
*
* @param locator the locator to wait for
*/
public void waitUntilElementDisappears(final By locator)
{
waitUntilElementDisappears(null, locator);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* @return true if we are currently logged in, false otherwise
*/
public boolean isAuthenticated()
{
return getDriver().hasElementWithoutWaiting(By.id("tmUser"));
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-administration-test-pageobjects
private void setAuthenticatedView(boolean enabled)
{
String desiredAltValue = enabled ? "yes" : "no";
if (!this.forceAuthenticatedViewLink.getAttribute("alt").equals(desiredAltValue)) {
this.forceAuthenticatedViewLink.click();
// Wait for the setting to apply. Wait longer than usual in this case in an attempt to avoid some false
// positives in the tests.
int defaultTimeout = getDriver().getTimeout();
try {
getDriver().setTimeout(defaultTimeout * 2);
getDriver().waitUntilElementHasAttributeValue(
By.id(this.forceAuthenticatedViewLink.getAttribute("id")), "alt", desiredAltValue);
} finally {
// Restore the utils timeout for other tests.
getDriver().setTimeout(defaultTimeout);
}
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
public HistoryPane deleteRangeVersions(String fromVersion, String toVersion)
{
getDriver().makeConfirmDialogSilent(true);
this.selectVersions(fromVersion, toVersion);
getDriver().findElementWithoutWaiting(pane, By.xpath(".//input[@name = 'deleteVersions']")).click();
return new HistoryPane();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
/**
* Same as {@link #waitUntilRowCountGreaterThan(int, int)} but with a specific timeout (ie not using the default
* timeout)
*
* @since 9.1RC1
*/
// We need to decide if it's bettter to introduce this method or to globally increase the default timeout.
public void waitUntilRowCountGreaterThan(int minimalExpectedRowCount, int timeout)
{
int originalTimeout = getDriver().getTimeout();
getDriver().setTimeout(timeout);
try {
waitUntilRowCountGreaterThan(minimalExpectedRowCount);
} finally {
getDriver().setTimeout(originalTimeout);
}
}
我使用 apt-get install libgtest-dev 安装了 gtest 我正在尝试检查它是否有效。 所以我在 eclipse 中编写了简单的测试代码。 但是有错误, undefined
($test) = (@test); $test = @test; 用一个括号括住变量,它访问数组的第一个元素。我找不到有关数组括号的信息。 最佳答案 ($test) = (@test); 这会将@t
在 clojure.test 中有一个允许同时测试多个设备的宏: are . 在 clojure.test 中,可以结合 are宏与 testing ? IE。就像是: (are [scenario
通常,Rust 中的单元测试被赋予一个单独的模块,该模块使用 #[cfg(test)] 进行条件编译: #[cfg(test)] mod tests { #[test] fn test
在过去,编程很少涉及猜测。我会写几行代码,一眼就能 100% 确定代码做什么和不做什么。错误主要是拼写错误,但与功能无关。 我相信在过去的几年中存在这种“试错”编程的趋势:编写代码(就像在草稿中一样)
在building the Kotlin compiler之后(在提交e80a01a处): ./gradlew dist 测试未成功通过: ./gradlew compiler:test 由于很少有测
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 9 年前。 Improve this qu
最近一直在思考模糊测试和猴子测试的区别。根据 wiki,猴子测试似乎“只是”一个单元测试,而模糊测试则不是。安卓有 UI/Application Exerciser monkey而且它看起来不像是单元
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
现在我正在使用 CMake 设置一个 C++ 测试环境。其实我已经意识到我想做什么,但我对两种不同的测试输出风格感到困惑。在我下面的示例中,“make test”实际上做了什么?我认为“make te
在 VS2012 中运行单个测试时,测试资源管理器底部会显示一个窗口,其中包括(假设失败)旁边带有“测试失败”的红色图标。紧随其后的是带有“已用时间”的失败消息。 我想简单地知道是否有办法清除这个窗口
bash 是否可以从 shell 执行命令,如果它返回某个值(或空值)则执行命令? if [ "echo test" == "test"]; then echo "echo test output
这个问题在这里已经有了答案: 8年前关闭。 Possible Duplicate: What is a smoke testing and what will it do for me? 为什么“冒烟
x86 下的并行编程可能很困难,尤其是在多核 CPU 下。假设我们有多核 x86 CPU 和更多不同的多线程通信组合。 单一作者和单一读者 单个读者多个作者 多个读者和单个作者 多个读者和多个作者 那
我使用Ctest来运行一堆使用add_test()注册的Google测试。当前,这些测试没有任何参数。但是,我想在运行--gtest_output=xml时为它们提供所有参数(所有参数都通用,特别是c
我有下表和数据: CREATE TABLE `test` ( `id` int(11) NOT NULL auto_increment, `name` varchar(8) NOT NULL,
go test 的两个标志 -parallel 和 -test.parallel 之间的区别以及哪个标志优先? -parallel n Allow parallel execu
在我的组件 AudioPlayer 中,我有一个 download() 方法: download() { this.audio.pause(); window.open(this.file,
您必须承认,对于 Rails 和数据库的新手来说,rubyonrails.org 上的官方解释使所有这四个任务听起来完全一样。引用: rake db:test:clone Recreate the
我过去曾讨论过这个话题,我想我可能知道答案,但我无法正确地表达出来。 这是我认为我所知道的: 如果您在编写测试之前已经有了关于事情如何工作的想法,那么我怀疑您是测试优先而不是测试驱动,因此您首先编写测
我是一名优秀的程序员,十分优秀!