gpt4 book ai didi

com.atlassian.webdriver.pageobjects.WebDriverTester类的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 08:39:05 32 4
gpt4 key购买 nike

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

WebDriverTester介绍

[英]Tester to be used by Atlassian pageobject tests.
[中]Atlassian pageobject测试使用的测试仪。

代码示例

代码示例来源:origin: com.atlassian.selenium/atlassian-webdriver-core

@Override
  public AtlassianWebDriver get()
  {
    return product.getTester().getDriver();
  }
};

代码示例来源:origin: com.atlassian.selenium/atlassian-webdriver-core

@Test
public void testVisitsHomePageAtDefaultBaseUrl() {
  goToHomePage();
  verify(tester).gotoUrl(urlCaptor.capture());
  assertThat(urlCaptor.getValue(), is(homePageAtHost(DEFAULT_HOST)));
}

代码示例来源:origin: com.atlassian.selenium/atlassian-webdriver-core

public void configure(Binder binder)
  {
    binder.bind(AtlassianWebDriver.class).toInstance(testedProduct.getTester().getDriver());
    binder.bind(WebDriver.class).toInstance(testedProduct.getTester().getDriver());
    binder.bind(SearchContext.class).toInstance(testedProduct.getTester().getDriver());
    binder.bind(PageFactoryPostInjectionProcessor.class);
    binder.bind(Waiter.class).to(WebDriverWaiter.class);
  }
}

代码示例来源:origin: com.atlassian.selenium/atlassian-webdriver-core

@Test
public void testVisitsHomePageAtBaseUrlForHost() {
  final String expectedHost = "mytenant";
  getProduct().setHost(expectedHost);
  goToHomePage();
  verify(tester).gotoUrl(urlCaptor.capture());
  assertThat(urlCaptor.getValue(), is(homePageAtHost(expectedHost)));
  final String actualHost = URI.create(urlCaptor.getValue()).getHost();
  assertThat(actualHost, is(expectedHost));
}

代码示例来源:origin: com.atlassian.selenium/atlassian-webdriver-core

@Before
public void setup() {
  when(testerFactory.create()).thenReturn(tester);
  when(tester.getDriver()).thenReturn(webDriver);
}

代码示例来源:origin: com.atlassian.confluence/confluence-webdriver-pageobjects

public void logOutFast() {
  webDriverTester.gotoUrl(getProductInstance().getBaseUrl() + "/plugins/functest/logout.action");
}

代码示例来源:origin: com.atlassian.confluence/confluence-webdriver-pageobjects

@Override
public void configure(Binder binder) {
  final AtlassianWebDriver driver = testedProduct.getTester().getDriver();
  binder.bind(JavascriptExecutor.class).toInstance(driver);
  binder.bind(AjaxTracing.class).to(AjaxTracingImpl.class).asEagerSingleton();
  final Optional<Capabilities> capabilities = CapabilityUtils.getBrowserCapabilities(driver);
  if (capabilities.isPresent()) {
    binder.bind(Capabilities.class).toInstance(capabilities.get());
  }
  binder.bind(ConfluenceFrameExecutor.class).to(ConfluenceFrameExecutorTemplate.Lenient.class); // default, lenient == ignores frame exceptions
  binder.bind(ConfluenceFrameExecutor.class).annotatedWith(Names.named("lenient")).to(ConfluenceFrameExecutorTemplate.Lenient.class);
  binder.bind(ConfluenceFrameExecutor.class).annotatedWith(Names.named("strict")).to(ConfluenceFrameExecutorTemplate.Strict.class);
}

代码示例来源:origin: com.atlassian.confluence/confluence-webdriver-pageobjects

/**
 * Faster way of login when in testing environment by embedding the credentials in the url,
 * so we don't have to visit the login page every single time.
 */
public <M extends Page> M autoLoginEmbeddingCredentialsInUrl(UserWithDetails user, Class<M> destinationClass, Object... args) {
  checkNotNull(destinationClass);
  DelayedBinder<M> binder = pageBinder.delayedBind(destinationClass, args);
  M p = binder.get();
  checkNotNull(p);
  URI uriBuilder = UriBuilder.fromUri(productInstance.getBaseUrl() + p.getUrl())
      .queryParam("os_username", user.getUsername())
      .queryParam("os_password", user.getPassword())
      .build();
  webDriverTester.gotoUrl(uriBuilder.toString());
  return binder.bind();
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-dvcs-connector-pageobjects

private boolean requiresGrantAccess() {
    // if access has been granted before browser will
    // redirect immediately back to jira
    final String currentUrl = jira.getTester().getDriver().getCurrentUrl();
    return !currentUrl.contains("/jira");
  }
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-dvcs-connector-pageobjects

public <P> P visit(String url, Class<P> pageClass, Object... args) {
    jira.getTester().gotoUrl(url);
    return jira.getPageBinder().bind(pageClass, args);
  }
}

代码示例来源:origin: com.atlassian.confluence/confluence-webdriver-pageobjects

public boolean isViewRestricted() {
  return product.getTester().getDriver().getTitle().contains(NO_PERMISSION_PAGE_TITLE);
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-dvcs-connector-pageobjects

public <P> P visit(String url, Class<P> pageClass) {
  jira.getTester().gotoUrl(url);
  return jira.getPageBinder().bind(pageClass);
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-dvcs-connector-pageobjects

protected void waitWhileNewPageLaoded() {
  jiraTestedProduct.getTester().getDriver().waitUntilElementIsNotLocated(By.id("old-page"));
}

代码示例来源:origin: com.atlassian.confluence/confluence-webdriver-pageobjects

public <P extends Page> P visitExternal(Class<P> pageClass, Object... args) {
  checkNotNull(pageClass);
  DelayedBinder<P> binder = pageBinder.delayedBind(pageClass, args);
  P p = binder.get();
  checkNotNull(p);
  String pageUrl = p.getUrl();
  try {
    getTester().gotoUrl(pageUrl);
  } catch (WebDriverException e) {
    throw new WebDriverException("Failed to load URL '" + pageUrl + "'", e);
  }
  return binder.bind();
}

代码示例来源:origin: com.atlassian.jira/atlassian-jira-pageobjects

public void closeAll()
  {
    jira.getTester().getDriver().executeScript(CLOSE_ALL_JS);
  }
}

代码示例来源:origin: com.atlassian.jira/atlassian-jira-pageobjects

public <P extends Page> DelayedBinder<P> visitDelayed(final Class<P> pageClass, final Object... args)
{
  final DelayedBinder<P> binder = pageBinder.delayedBind(pageClass, args);
  webDriverTester.gotoUrl(productInstance.getBaseUrl() + binder.get().getUrl());
  return binder;
}

代码示例来源:origin: com.atlassian.jira/atlassian-jira-pageobjects

public void closeAll()
  {
    jira.getTester().getDriver().executeScript(CLOSE_ALL_JS);
  }
}

代码示例来源:origin: com.atlassian.confluence/confluence-webdriver-pageobjects

public void clearLocalStorage() {
  if (browserCapabilities.isPresent() && browserCapabilities.get().isJavascriptEnabled()) {
    getTester().getDriver().executeScript("localStorage && localStorage.clear()");
  }
}

代码示例来源:origin: com.atlassian.jira/atlassian-jira-pageobjects

public void closeAllFlags()
  {
    jira.getTester().getDriver().executeScript(CLOSE_FLAGS_JS);
  }
}

代码示例来源:origin: com.atlassian.jira/atlassian-jira-pageobjects

private WebDriverDebug getWebDriverDebug()
  {
    return new WebDriverDebug(jira.getTester().getDriver());
  }
}

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