Skip to content

Commit 3f26f95

Browse files
committed
Add explanatory comments to click and scroll actions
1 parent c044ad1 commit 3f26f95

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

app/src/androidTest/java/org/wordpress/aztec/demo/BetterClickAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public BetterClickAction(Tapper tapper, CoordinatesProvider coordinatesProvider,
3939
@Override
4040
@SuppressWarnings("unchecked")
4141
public Matcher<View> getConstraints() {
42+
// Check that at least 65% of the element is displayed (instead of default 90%)
4243
Matcher<View> standardConstraint = isDisplayingAtLeast(65);
4344
if (rollbackAction.isPresent()) {
4445
return allOf(standardConstraint, rollbackAction.get().getConstraints());

app/src/androidTest/java/org/wordpress/aztec/demo/BetterScrollToAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public Matcher<View> getConstraints() {
3636

3737
@Override
3838
public void perform(UiController uiController, View view) {
39+
// Check that at least 65% of the element is displayed (instead of default 90%)
3940
if (isDisplayingAtLeast(65).matches(view)) {
4041
Log.i(TAG, "View is already displayed. Returning.");
4142
return;
@@ -46,6 +47,7 @@ public void perform(UiController uiController, View view) {
4647
Log.w(TAG, "Scrolling to view was requested, but none of the parents scrolled.");
4748
}
4849
uiController.loopMainThreadUntilIdle();
50+
// Check that at least 65% of the element is displayed (instead of default 90%)
4951
if (!isDisplayingAtLeast(65).matches(view)) {
5052
throw new PerformException.Builder()
5153
.withActionDescription(this.getDescription())

0 commit comments

Comments
 (0)