use of com.stardust.automator.test.TestUiObject in project Auto.js by hyb1996.
the class ScrollMaxActionTest method perform.
@Test
public void perform() throws Exception {
ScrollMaxAction action = new ScrollMaxAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
UiObject root = new TestUiObject(20);
action.perform(root);
System.out.println(TestUiObject.max);
assertEquals(1, TestUiObject.count);
}
use of com.stardust.automator.test.TestUiObject in project Auto.js by hyb1996.
the class DepthFirstSearchTargetActionTest method perform.
@Test
public void perform() {
DepthFirstSearchTargetAction action = new DepthFirstSearchTargetAction(AccessibilityNodeInfo.ACTION_CLICK, new FilterAction.Filter() {
@Override
public List<UiObject> filter(UiObject root) {
List<UiObject> list = new ArrayList<>();
for (int i = 0; i < root.getChildCount(); i++) {
list.add(root.child(i));
}
return list;
}
});
TestUiObject root = new TestUiObject(5);
action.perform(root);
System.out.println(TestUiObject.max);
assertEquals(1, TestUiObject.count);
}
use of com.stardust.automator.test.TestUiObject in project Auto.js by hyb1996.
the class DfsFilterTest method filter.
@Test
public void filter() throws Exception {
DfsFilter filter = new RandomDfsFilter();
UiObject root = new TestUiObject(10);
List<UiObject> list = filter.filter(root);
for (UiObject uiObject : list) {
if (root != uiObject)
uiObject.recycle();
}
System.out.println(TestUiObject.max);
assertEquals(1, TestUiObject.count);
}
use of com.stardust.automator.test.TestUiObject in project Auto.js by hyb1996.
the class ScrollActionTest method perform.
@Test
public void perform() throws Exception {
ScrollAction action = new ScrollAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD, 0);
UiObject root = new TestUiObject(5);
action.perform(root);
System.out.println(TestUiObject.max);
assertEquals(1, TestUiObject.count);
}
Aggregations