gpt4 book ai didi

org.xwiki.test.ui.XWikiWebDriver.setTimeout()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 10:19:05 30 4
gpt4 key购买 nike

本文整理了Java中org.xwiki.test.ui.XWikiWebDriver.setTimeout()方法的一些代码示例,展示了XWikiWebDriver.setTimeout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWikiWebDriver.setTimeout()方法的具体详情如下:
包路径:org.xwiki.test.ui.XWikiWebDriver
类名称:XWikiWebDriver
方法名:setTimeout

XWikiWebDriver.setTimeout介绍

暂无

代码示例

代码示例来源: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-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

/**
 * 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);
  }
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com