当前位置: 首页>>代码示例>>Java>>正文


Java Configuration类代码示例

本文整理汇总了Java中com.codeborne.selenide.Configuration的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Configuration类属于com.codeborne.selenide包,在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDriver

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@Override
public WebDriver createDriver(DesiredCapabilities capabilities) {
  Configuration.startMaximized = false;
  Configuration.captureJavascriptErrors = false;

  capabilities.setCapability(MobileCapabilityType.VERSION, "4.4.2");
  capabilities.setCapability("automationName", "Appium");
  capabilities.setCapability("platformName", "Android");
  capabilities.setCapability("deviceName", "0123456789ABCDEF");
  capabilities.setCapability(APP_PACKAGE, "com.android.calculator2");
  capabilities.setCapability(APP_ACTIVITY, "com.android.calculator2.Calculator");

  try {
    return new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:codeborne,项目名称:selenide-appium,代码行数:19,代码来源:AndroidDriverProvider.java

示例2: baseTestBeforeClass

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@BeforeClass
public static void baseTestBeforeClass() {
    Configuration.browser = "chrome";
    Configuration.reopenBrowserOnFail = false;

    if (EnvironmentDetector.inLambda()) {
        WebDriverRunner.webdriverContainer = new LambdaWebDriverThreadLocalContainer();
    }
}
 
开发者ID:blackboard,项目名称:lambda-selenium,代码行数:10,代码来源:LambdaBaseTest.java

示例3: setup

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@BeforeClass
public static void setup() {
	//set up Selenide
	Configuration.timeout = 5 * 60 * 1000;
	Configuration.browser = TestConfiguration.syndesisBrowser();
	//getWebDriver().manage().window().setSize(new Dimension(1920, 1024));

	if (TestConfiguration.namespaceCleanup()) {
		CommonSteps commonSteps = new CommonSteps();
		commonSteps.cleanNamespace();
		commonSteps.deploySyndesis();
		commonSteps.waitForSyndeisis();
	}

}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:16,代码来源:CucumberTest.java

示例4: search

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@Test
public void search() {
  Configuration.browser = "chrome";
  open("https://google.com/");
  $(By.name("q")).val("Selenide").pressEnter();
  $$("#ires .g").shouldHave(CollectionCondition.sizeGreaterThan(5));

  for (int i = 0; i < 5; i++) {
    SelenideElement link = $("#ires .g", i).find("a");
    System.out.println(link.attr("href"));
    link.click();
    back();
  }
  sleep(1000);
}
 
开发者ID:selenide-examples,项目名称:testcontainers,代码行数:16,代码来源:GoogleTest.java

示例5: selectApiVersion

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
public CreateContractPage selectApiVersion(String name, String version) {
    selectApi(name);
    apiVersionSelect().select(version);
    selectApiOkButton().click();
    $(".modal-dialog").waitWhile(present, Configuration.timeout);
    return thisPageObject();
}
 
开发者ID:apiman,项目名称:apiman-test,代码行数:8,代码来源:CreateContractPage.java

示例6: addPolicy

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
/**
 * Add policy by clicking on the "Add Policy" button
 * @param pageClass class representing following page
 * @return following page object
 */
public <F> F addPolicy(Class<F> pageClass) {
    addPolicyButton().shouldBe(Condition.enabled);
    addPolicyButton().click();
    Selenide.sleep(Configuration.timeout); // TODO: possible propagation delay
    return page(pageClass);
}
 
开发者ID:apiman,项目名称:apiman-test,代码行数:12,代码来源:AbstractAddPolicyPage.java

示例7: closeDialog

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
/**
 * Dismiss dialog by clicking on X in upper right corner
 * @return this page object
 */
default P closeDialog() {
    Selenide.sleep(Configuration.timeout);
    closeDialogButton().shouldBe(present);
    closeDialogButton().shouldBe(visible);
    closeDialogButton().click();
    return thisPageObject();
}
 
开发者ID:apiman,项目名称:apiman-test,代码行数:12,代码来源:ModalDialog.java

示例8: confirmDialog

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
/**
 * Confirm dialog by clicking on yes button
 * @return this page object
 */
default P confirmDialog() {
    Selenide.sleep(Configuration.timeout);
    yesDialogButton().click();
    Selenide.sleep(Configuration.timeout); // TODO: possible propagation delay
    return thisPageObject();
}
 
开发者ID:apiman,项目名称:apiman-test,代码行数:11,代码来源:ModalDialog.java

示例9: doneWithDialog

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
/**
 * dismiss dialog by clicking on the "Done" button
 * @return this page object
 */
default P doneWithDialog() {
    Selenide.sleep(Configuration.timeout);
    doneDialogButton().shouldBe(visible);
    doneDialogButton().click();
    dialogWindow().shouldNotBe(visible);
    return thisPageObject();
}
 
开发者ID:apiman,项目名称:apiman-test,代码行数:12,代码来源:ModalDialog.java

示例10: configureTestOn

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
public static void configureTestOn(String testOn, Properties properties) {

    if (testOn.equals("grid")) {
      //!!!to run node - use -Dwebdriver.firefox.marionette=false - for FireFox<=47.0.1 usage
      Configuration.remote = properties.getProperty("test.grid.url");
      Configuration.browser = properties.getProperty("test.grid.browser", "chrome");
      System.setProperty("capabilities.marionette", "false");
    } else if (testOn.equals("browserStack")) {
      Configuration.remote = "https://" + properties.getProperty("test.browserStack.userName") + ":" + properties.getProperty("test.browserStack.automateKey") + "@hub-cloud.browserstack.com/wd/hub";
      System.setProperty("capabilities.browserstack.debug", "true");
      PropertiesHelper.fillCapabilities("test.browserStack", properties);
    } else if (testOn.equals("sauceLabs")) {
      String remoteUrl = "https://" + properties.getProperty("test.sauceLabs.userName") + ":" + properties.getProperty("test.sauceLabs.automateKey") + "@ondemand.saucelabs.com:443/wd/hub";
      if (properties.getProperty("test.sauceLabs.capabilities.appiumVersion") != null) {
        AppiumDriverProvider.setCapabilities(getCapabilities("test.sauceLabs", properties));
        AppiumDriverProvider.setUrl(remoteUrl);
        Configuration.browser = AppiumDriverProvider.class.getName();
      } else {
        Configuration.browser = properties.getProperty("test.sauceLabs.browser");
        Configuration.remote = remoteUrl;
        PropertiesHelper.fillCapabilities("test.sauceLabs", properties);
      }
    } else {
      //by default = local
      Configuration.browser = properties.getProperty("test.local.browser", "chrome");
    }
  }
 
开发者ID:automician,项目名称:snippets,代码行数:28,代码来源:PropertiesHelper.java

示例11: init

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
private void init() {
    environment.validate();

    System.setProperty("selenide.browser", environment.getDriver().name().toLowerCase());
    System.setProperty("selenide.baseUrl", environment.getBaseUrl());

    Configuration.timeout = 6000L;
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:9,代码来源:MidPoint.java

示例12: BasePage

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
BasePage() {
    ChromeDriverManager.getInstance().setup();
    Configuration.browser = "chrome";
}
 
开发者ID:endless-qa,项目名称:webdriver-examples-java,代码行数:5,代码来源:BasePage.java

示例13: globalSetUp

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@BeforeClass
public void globalSetUp() {
    Configuration.reportsFolder = "target/selenideReports/tests";
}
 
开发者ID:endless-qa,项目名称:webdriver-examples-java,代码行数:5,代码来源:MyTests.java

示例14: setUp

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration.browser = AndroidDriverProvider.class.getName();
}
 
开发者ID:codeborne,项目名称:selenide-appium,代码行数:5,代码来源:BaseTest.java

示例15: before

import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@Before
public void before(){
    Configuration.browser = WebDriverRunner.GECKO;
    //Configuration.browser = "edge";
    System.setProperty("webdriver.gecko.driver","/PATH/TO/geckodriver.exe");
}
 
开发者ID:shimashima35,项目名称:codezine-sample,代码行数:7,代码来源:SampleTest.java


注:本文中的com.codeborne.selenide.Configuration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。