+ def test_getIndexInParent(self, test):
+ root = self._desktop.getChildAtIndex(0)
+
+ for i in range(0, root.childCount):
+ child = root.getChildAtIndex(i)
+ test.assertEqual(i, child.getIndexInParent(), "Childs index in parent reported incorrectly")
+
+ def test_getLocalizedRoleName(self, test):
+ root = self._desktop.getChildAtIndex(0)
+
+ ans = "window"
+ res = root.getLocalizedRoleName()
+ test.assertEqual(ans, res,
+ "Expected LocalizedRoleName - \"%s\". Recieved - \"%s\"" % (ans, res,))
+
+ a = root.getChildAtIndex(1)
+ a = a.getChildAtIndex(0)
+ ans = "html container"
+ res = a.getLocalizedRoleName()
+ test.assertEqual(ans, res,
+ "Expected LocalizedRoleName - \"%s\". Recieved - \"%s\"" % (ans, res,))
+
+ def test_getRelationSet(self, test):
+ root = self._desktop.getChildAtIndex(0)
+ # Complete test of Relation interface is separate
+ rset = root.getRelationSet()
+
+ def test_getRole(self, test):
+ root = self._desktop.getChildAtIndex(0)
+ test.assertEqual(root.getRole(), 69,
+ "Expected role - \"69\". Recieved - \"%d\"" % (int(root.getRole()),))
+
+ def test_getRoleName(self, test):
+ root = self._desktop.getChildAtIndex(0)
+
+ ans = "window"
+ res = root.getRoleName()
+ test.assertEqual(ans, res,
+ "Expected roleName - \"%s\". Recieved - \"%s\"" % (ans, res,))
+
+ a = root.getChildAtIndex(1)
+ a = a.getChildAtIndex(0)
+ ans = "html container"
+ res = a.getRoleName()
+ test.assertEqual(ans, res,
+ "Expected roleName - \"%s\". Recieved - \"%s\"" % (ans, res,))
+
+ def test_getState(self, test):
+ root = self._desktop.getChildAtIndex(0)
+ state = root.getState()
+ res = StateSet(*st)
+ if not res.equals(state):
+ test.fail("States not reported correctly")
+
+ def test_childCount(self, test):
+ root = self._desktop.getChildAtIndex(0)
+ test.assertEqual(root.childCount, 11,
+ "Expected role - \"11\". Recieved - \"%d\"" % (root.childCount,))
+
+ def test_description(self, test):
+ root = self._desktop.getChildAtIndex(0)
+ description = "The main accessible object, root of the accessible tree"
+ test.assertEqual(root.description, description,
+ "Expected description - \"%s\". Recieved - \"%s\"" % (description, root.description,))
+
+ def test_tree(self, test):
+ """
+ This is a mild stress test for the
+ methods:
+
+ getChildAtIndex
+
+ And the attributes:
+
+ name
+ description
+
+ It checks a tree of these values is correctly
+ passed from Application to AT.
+ """
+ root = self._desktop.getChildAtIndex(0)