本文整理汇总了Java中com.thoughtworks.gauge.BeforeSuite类的典型用法代码示例。如果您正苦于以下问题:Java BeforeSuite类的具体用法?Java BeforeSuite怎么用?Java BeforeSuite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeforeSuite类属于com.thoughtworks.gauge包,在下文中一共展示了BeforeSuite类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Setup
import com.thoughtworks.gauge.BeforeSuite; //导入依赖的package包/类
@BeforeSuite
public void Setup() throws MalformedURLException {
// Get Appium Properties
String browser_name = System.getenv("BROWSER_NAME");
String platform_name = System.getenv("PLATFORM_NAME");
String platform_version = System.getenv("PLATFORM_VERSION");
String new_command_timeout = System.getenv("NEW_COMMAND_TIMEOUT");
String device_name = System.getenv("DEVICE_NAME");
String appium_host_url = System.getenv("APPIUM_HOST_URL");
// Set desiredCapabilities
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(MobileCapabilityType.BROWSER_NAME, browser_name);
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, platform_name);
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, platform_version);
desiredCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, new_command_timeout);
desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, device_name);
URL url = new URL(appium_host_url);
driver = new AndroidDriver(url, desiredCapabilities);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
示例2: Setup
import com.thoughtworks.gauge.BeforeSuite; //导入依赖的package包/类
@BeforeSuite
public void Setup() {
// Uses chrome driver by default
String browser = System.getenv("BROWSER");
if (browser == null) {
browser = DEFAULT;
}
if (browser.toLowerCase().equals(FIREFOX)) {
FirefoxDriverManager.getInstance().setup();
driver = new FirefoxDriver();
} else if (browser.toLowerCase().equals(IE)) {
InternetExplorerDriverManager.getInstance().setup();
driver = new InternetExplorerDriver();
} else {
ChromeDriverManager.getInstance().setup();
driver = new ChromeDriver();
}
}
示例3: init
import com.thoughtworks.gauge.BeforeSuite; //导入依赖的package包/类
@BeforeSuite
public void init(){
driver = DriverFactory.getDriver();
loginPage = PageFactory.initElements(driver, LoginPage.class);
logoutPage = PageFactory.initElements(driver, LogoutPage.class);
}
示例4: initializeDriver
import com.thoughtworks.gauge.BeforeSuite; //导入依赖的package包/类
@BeforeSuite
public void initializeDriver(){
webDriver = DriverFactory.getDriver();
}