ensure selendroid test app doesn't need to have its version updated when we update selendroid

This commit is contained in:
Jonathan Lipps 2014-02-13 15:25:45 -08:00
Родитель 706a61041c
Коммит 0de0452b75
6 изменённых файлов: 9 добавлений и 30 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -9,6 +9,7 @@ sample-code/apps/TestApp/build
sample-code/apps/WebViewApp/build
sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.xcworkspace/xcshareddata
sample-code/apps/gps-demo*
sample-code/apps/*.apk
*.sublime-*
sample-code/apps/UICatalog*
sample-code/apps/io.appium.gappium*

Просмотреть файл

@ -349,9 +349,10 @@ reset_selendroid() {
reset_toggle_test
uninstall_android_app com.example.toggletest.selendroid
fi
echo "* Linking selendroid test app: WebViewDemo"
run_cmd rm -rf $appium_home/sample-code/apps/WebViewDemo
run_cmd ln -s $appium_home/submodules/selendroid/selendroid-test-app $appium_home/sample-code/apps/WebViewDemo
echo "* Linking selendroid test app"
run_cmd rm -rf $appium_home/sample-code/apps/selendroid-test-app.apk
test_apk=$(ls $appium_home/submodules/selendroid/selendroid-test-app/target/*.apk | head -1)
run_cmd ln -s $test_apk $appium_home/sample-code/apps/selendroid-test-app.apk
uninstall_android_app io.selendroid.testapp.selendroid
uninstall_android_app io.selendroid.testapp
# keep older versions of package around to clean up

Просмотреть файл

@ -19,9 +19,7 @@ public class AndroidWebViewTest {
public void setUp() throws Exception {
// set up appium
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "../../../apps/WebViewDemo/target");
String file = getApkFile(appDir);
File app = new File(appDir, file);
File app = new File(classpathRoot, "../../../apps/selendroid-test-app.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device","selendroid");
capabilities.setCapability("app", app.getAbsolutePath());
@ -29,14 +27,6 @@ public class AndroidWebViewTest {
capabilities.setCapability("app-activity", ".HomeScreenActivity");
driver = new SwipeableWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
private String getApkFile(File appDir) {
for(String s : appDir.list())
if(s.contains(".apk")){
return s;
}
return "";
}
@After
public void tearDown() throws Exception {
driver.quit();

Просмотреть файл

@ -20,9 +20,7 @@ public class AndroidWebViewTest {
public void setUp() throws Exception {
// set up appium
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "../../../apps/WebViewDemo/target");
String file = getApkFile(appDir);
File app = new File(appDir, file);
File app = new File(classpathRoot, "../../../apps/selendroid-test-app.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device","selendroid");
capabilities.setCapability("app", app.getAbsolutePath());
@ -31,15 +29,6 @@ public class AndroidWebViewTest {
driver = new SwipeableWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
private String getApkFile(File appDir) {
for(String s : appDir.list())
if(s.contains(".apk")){
return s;
}
return "";
}
@AfterMethod
public void tearDown() throws Exception {
driver.quit();

Просмотреть файл

@ -10,8 +10,7 @@ class TestAndroidWebView(unittest.TestCase):
def setUp(self):
app = os.path.abspath(
glob.glob(os.path.join(
os.path.dirname(__file__), '../../apps/WebViewDemo/target')
+ '/*.apk')[0])
os.path.dirname(__file__), '../../apps/selendroid-test-app.apk')))
desired_caps = {
'device': 'selendroid',
'app': app,

Просмотреть файл

@ -7,8 +7,7 @@ var env = require('../../helpers/env')
, path = require('path');
var desired = {
app: path.resolve(__dirname, "../../../sample-code/apps/WebViewDemo/target/" +
"selendroid-test-app-0.8.0.apk"),
app: path.resolve(__dirname, "../../../sample-code/apps/selendroid-test-app.apk"),
'app-package': 'io.selendroid.testapp',
'app-activity': '.HomeScreenActivity'
};