Skip to content

Commit f9b948a

Browse files
authored
Merge pull request #16993 from wordpress-mobile/UI-tests-JP-and-Nuage-fix
[UI Tests] Addressing the `Nuage Laboratoire` issue and accidental(?) JP banner tap.
2 parents ed65f17 + 1905e16 commit f9b948a

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public LoginFlow chooseContinueWithWpCom() {
3838
public LoginFlow enterEmailAddress(String emailAddress) {
3939
// Email Address Screen – Fill it in and click "Continue"
4040
// See LoginEmailFragment
41+
clickOn(R.id.input);
4142
populateTextField(R.id.input, emailAddress);
4243
clickOn(R.id.login_continue_button);
4344
return this;
@@ -46,6 +47,7 @@ public LoginFlow enterEmailAddress(String emailAddress) {
4647
public LoginFlow enterPassword(String password) {
4748
// Password Screen – Fill it in and click "Continue"
4849
// See LoginEmailPasswordFragment
50+
clickOn(R.id.input);
4951
populateTextField(R.id.input, password);
5052
clickOn(R.id.bottom_button);
5153
return this;
@@ -104,7 +106,9 @@ public LoginFlow enterUsernameAndPassword(String username, String password) {
104106
Matchers.instanceOf(EditText.class)));
105107
ViewInteraction passwordElement = onView(allOf(isDescendantOfA(withId(R.id.login_password_row)),
106108
Matchers.instanceOf(EditText.class)));
109+
clickOn(usernameElement);
107110
populateTextField(usernameElement, username + "\n");
111+
clickOn(passwordElement);
108112
populateTextField(passwordElement, password + "\n");
109113
clickOn(R.id.bottom_button);
110114
return this;
@@ -120,6 +124,7 @@ public LoginFlow chooseEnterYourSiteAddress() {
120124
public LoginFlow enterSiteAddress(String siteAddress) {
121125
// Site Address Screen – Fill it in and click "Continue"
122126
// See LoginSiteAddressFragment
127+
clickOn(R.id.input);
123128
populateTextField(R.id.input, siteAddress);
124129
clickOn(R.id.bottom_button);
125130
return this;

WordPress/src/androidTest/java/org/wordpress/android/support/WPSupportUtils.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,17 @@ public static void scrollIntoView(Integer scrollableContainerID, ViewInteraction
820820
}
821821

822822
public static void dismissJetpackAdIfPresent() {
823+
String jetpackAdText = "Stats, Reader, Notifications, and other features are powered by Jetpack.";
824+
ViewInteraction jetpackBanner = onView(withText(jetpackAdText));
825+
823826
// Dismiss Jetpack ad that might be shown after Sign-Up or after opening Stats
824-
if (isElementDisplayed(onView(withText("Jetpack powered")))) {
827+
if (isElementDisplayed(jetpackBanner)) {
825828
clickOn(onView(withId(R.id.secondary_button)));
829+
waitForElementToNotBeDisplayed(jetpackBanner);
830+
831+
// Account for potential Emulator slowness on CI: the case of banner text
832+
// being already hidden, but top part of banner still sliding away
833+
idleFor(1000);
826834
}
827835
}
828836
}

0 commit comments

Comments
 (0)