Skip to content

Commit

Permalink
Add ContactCheck to whenTestContactNumberDeleted
Browse files Browse the repository at this point in the history
  • Loading branch information
AtinAgnihotri committed Oct 18, 2020
1 parent 9a5daab commit 8ca7596
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void test_E2E_EditContactInContactsList() {
@Test
public void test_E2E_DeleteContactInContactsList() {
AddContactWorkflow.givenTestContactAddedOnContactsList();
ContactActionsWorkflow.whenTestContactNumberDeleted();
ContactActionsWorkflow.whenTestContactNumberDeleted(mUiDevice);
ContactValidationWorkflow.thenTestContactDoesntExists(mUiDevice);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import android.provider.Settings;

import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;

import com.simplemobiletools.contacts.pro.R;
import com.simplemobiletools.contacts.pro.uiUtils.ContactInfoUtils;
import com.simplemobiletools.contacts.pro.uiUtils.GlobalUtils;
Expand Down Expand Up @@ -33,13 +38,16 @@ public static void whenTestContactNumberEdited() {

}

public static void whenTestContactNumberDeleted() {
public static void whenTestContactNumberDeleted(UiDevice mUiDevice) {
// Name of the New Contact
String stringToCheck = new StringBuilder(GlobalUtils.TEST_FIRST_NAME)
.append(" ")
.append(GlobalUtils.TEST_SURNAME)
.toString();

// Wait Till Number Comes
mUiDevice.wait(Until.hasObject(By.text(stringToCheck)), GlobalUtils.WAIT_STANDARD_5000);

// Go to Contact Info page
ContactInfoUtils.goToContactInfoFromContactList(stringToCheck);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ public String getDescription() {

@Override
public void perform(UiController uiController, View view) {
//the execution will continue after .perform(...) todo: finish espresso isElementAvailable

//the execution will continue after .perform(...)
}
});

Expand Down

0 comments on commit 8ca7596

Please sign in to comment.