本文整理汇总了Java中org.testcontainers.containers.BrowserWebDriverContainer类的典型用法代码示例。如果您正苦于以下问题:Java BrowserWebDriverContainer类的具体用法?Java BrowserWebDriverContainer怎么用?Java BrowserWebDriverContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BrowserWebDriverContainer类属于org.testcontainers.containers包,在下文中一共展示了BrowserWebDriverContainer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: beforeEach
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
@Override
// public void beforeEach(ExtensionContext context) throws Exception {
public void beforeEach(TestExtensionContext context) throws Exception {
BrowserWebDriverContainer webDriverContainer
= new BrowserWebDriverContainer()
.withDesiredCapabilities(DesiredCapabilities.chrome()); // only one per container
webDriverContainer.start();
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(LoggerFactory.getLogger(this.getClass()));
webDriverContainer.followOutput(logConsumer);
storeTestcontainer().accept(context, webDriverContainer);
storeWebDriver().accept(context, webDriverContainer::getWebDriver);
}
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:16,代码来源:TestcontainersExtension.java
示例2: doSimpleWebdriverTest
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
protected void doSimpleWebdriverTest(BrowserWebDriverContainer rule) {
RemoteWebDriver driver = setupDriverFromRule(rule);
System.out.println("Selenium remote URL is: " + rule.getSeleniumAddress());
System.out.println("VNC URL is: " + rule.getVncAddress());
//Runtime.getRuntime().exec("open " + rule.getVncUrl(driver)); // For debugging, on a Mac
driver.get("http://www.google.com");
driver.findElement(By.name("q")).sendKeys("testcontainers");
driver.findElement(By.name("q")).submit();
assertEquals("the word 'testcontainers' appears in the search box", "testcontainers", driver.findElement(By.name("q")).getAttribute("value"));
}
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:13,代码来源:BaseWebDriverContainerTest.java
示例3: doSimpleExplore
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
protected static void doSimpleExplore(BrowserWebDriverContainer rule) {
RemoteWebDriver driver = setupDriverFromRule(rule);
driver.get("http://en.wikipedia.org/wiki/Randomness");
// Oh! The irony!
assertTrue("Randomness' description has the word 'pattern'", driver.findElementByPartialLinkText("pattern").isDisplayed());
}
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:8,代码来源:BaseWebDriverContainerTest.java
示例4: testAdditionalStartupString
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
@Test
public void testAdditionalStartupString() {
try (BrowserWebDriverContainer chrome = new BrowserWebDriverContainer("selenium/standalone-chrome-debug:" + tag)
.withDesiredCapabilities(DesiredCapabilities.chrome())) {
chrome.start();
}
}
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:8,代码来源:Selenium3xTest.java
示例5: testCreationOfManyContainers
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
@Test @Ignore
public void testCreationOfManyContainers() {
for (int i = 0; i < 50; i++) {
BrowserWebDriverContainer container = new BrowserWebDriverContainer()
.withDesiredCapabilities(DesiredCapabilities.chrome())
.withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING, new File("target"));
container.start();
RemoteWebDriver driver = container.getWebDriver();
driver.get("http://www.google.com");
container.stop();
}
}
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:16,代码来源:FlakyContainerCreationTest.java
示例6: testcontainer
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
public static Function<ExtensionContext, BrowserWebDriverContainer> testcontainer() {
return (context) -> store().apply(context).get(TESTCONTAINER, BrowserWebDriverContainer.class);
}
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:4,代码来源:TestcontainersExtension.java
示例7: storeTestcontainer
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
public static BiConsumer<ExtensionContext, BrowserWebDriverContainer> storeTestcontainer() {
return (context, webDriver) -> store().apply(context).put(TESTCONTAINER, webDriver);
}
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:4,代码来源:TestcontainersExtension.java
示例8: BrowserErrors
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
public BrowserErrors(String name, BrowserWebDriverContainer webDriver) {
this.name = name;
this.webDriver = webDriver;
}
开发者ID:pivotalsoftware,项目名称:pivotal-cla,代码行数:5,代码来源:BrowserErrors.java
示例9: setupDriverFromRule
import org.testcontainers.containers.BrowserWebDriverContainer; //导入依赖的package包/类
@NotNull
private static RemoteWebDriver setupDriverFromRule(BrowserWebDriverContainer rule) {
RemoteWebDriver driver = rule.getWebDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
return driver;
}
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:7,代码来源:BaseWebDriverContainerTest.java
注:本文中的org.testcontainers.containers.BrowserWebDriverContainer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论