Back to project page andro_auto_framework.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCT...
If you think the Android project andro_auto_framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.imaginea.botbot.common; /*w w w.j a v a 2 s . com*/ import org.imaginea.botbot.api.DefaultProperties; import org.testng.annotations.*; import com.google.android.testing.nativedriver.client.AndroidNativeDriver; import com.google.android.testing.nativedriver.client.AndroidNativeDriverBuilder; public class BaseClass { protected AndroidNativeDriver driver = null; DefaultProperties prop = DefaultProperties.getDefaultProperty(); String appPackage = prop.getValueFromProperty("APP_PACKAGE").concat(".") .concat(prop.getValueFromProperty("DEFAULT_ACTIVITY")); protected Prefrences prefrences=new Prefrences(); protected AndroidNativeDriver getDriver() { /* * if (driver == null) { driver = new * AndroidNativeDriverBuilder().withDefaultServer() .build(); return * driver; } else return driver; */ driver = new AndroidNativeDriverBuilder().withDefaultServer().build(); return driver; } private void startActivity() { /* * String appPackage = prop.getValueFromProperty("APP_PACKAGE"); * appPackage.concat("."); * appPackage.concat(prop.getValueFromProperty("DEFAULT_ACTIVITY")); */ driver.startActivity(appPackage); } @BeforeMethod public void beforeMethod() { driver = this.getDriver(); prefrences.setExecutionContext(driver); this.startActivity(); } @AfterMethod public void afterMethod() { driver.quit(); } @BeforeSuite public void beforeTest() { // driver = this.getDriver(); // this.startActivity(); } @AfterSuite public void afterTest() { // driver.quit(); } }