Skip to content
Browse files

Added tests for newly introduced API differences support

  • Loading branch information...
1 parent cfc7784 commit 44fdc16fb2a7cb5aa7d5a0db71b93c53a1a8b778 @dtmilano committed
Showing with 26 additions and 0 deletions.
  1. +26 −0 AndroidViewClient/tests/com/dtmilano/android/viewclient.py
View
26 AndroidViewClient/tests/com/dtmilano/android/viewclient.py
@@ -140,6 +140,32 @@ def testTopPropertyForDifferentSdkVersions_device(self):
view = View(None, device, -1)
self.assertEqual(topProperty, view.topProperty, msg='version %d' % version)
+ def testWidthPropertyForDifferentSdkVersions(self):
+ VP = { -1:WIDTH_PROPERTY, 8:WIDTH_PROPERTY_API_8, 10:WIDTH_PROPERTY, 15:WIDTH_PROPERTY, 16:WIDTH_PROPERTY, 17:WIDTH_PROPERTY}
+ for version, widthProperty in VP.items():
+ view = View(None, None, version)
+ self.assertEqual(widthProperty, view.widthProperty, msg='version %d' % version)
+
+ def testWidthPropertyForDifferentSdkVersions_device(self):
+ VP = { -1:WIDTH_PROPERTY, 8:WIDTH_PROPERTY_API_8, 10:WIDTH_PROPERTY, 15:WIDTH_PROPERTY, 16:WIDTH_PROPERTY, 17:WIDTH_PROPERTY}
+ for version, widthProperty in VP.items():
+ device = MockDevice(version=version)
+ view = View(None, device, -1)
+ self.assertEqual(widthProperty, view.widthProperty, msg='version %d' % version)
+
+ def testHeightPropertyForDifferentSdkVersions(self):
+ VP = { -1:HEIGHT_PROPERTY, 8:HEIGHT_PROPERTY_API_8, 10:HEIGHT_PROPERTY, 15:HEIGHT_PROPERTY, 16:HEIGHT_PROPERTY, 17:HEIGHT_PROPERTY}
+ for version, heightProperty in VP.items():
+ view = View(None, None, version)
+ self.assertEqual(heightProperty, view.heightProperty, msg='version %d' % version)
+
+ def testHeightPropertyForDifferentSdkVersions_device(self):
+ VP = { -1:HEIGHT_PROPERTY, 8:HEIGHT_PROPERTY_API_8, 10:HEIGHT_PROPERTY, 15:HEIGHT_PROPERTY, 16:HEIGHT_PROPERTY, 17:HEIGHT_PROPERTY}
+ for version, heightProperty in VP.items():
+ device = MockDevice(version=version)
+ view = View(None, device, -1)
+ self.assertEqual(heightProperty, view.heightProperty, msg='version %d' % version)
+
def testGetText(self):
self.assertTrue(self.view.map.has_key('text:mText'))
self.assertEqual('Button with ID', self.view.getText())

0 comments on commit 44fdc16

Please sign in to comment.
Something went wrong with that request. Please try again.