本文整理汇总了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);
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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");
}
}
示例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;
}
示例12: BasePage
import com.codeborne.selenide.Configuration; //导入依赖的package包/类
BasePage() {
ChromeDriverManager.getInstance().setup();
Configuration.browser = "chrome";
}
示例13: globalSetUp
import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@BeforeClass
public void globalSetUp() {
Configuration.reportsFolder = "target/selenideReports/tests";
}
示例14: setUp
import com.codeborne.selenide.Configuration; //导入依赖的package包/类
@Before
public void setUp() {
Configuration.browser = AndroidDriverProvider.class.getName();
}
示例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");
}