Skip to content

Commit

Permalink
Android UI Kit v2.3.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanbhanushali committed Apr 8, 2021
1 parent 4e17be3 commit 1fa5e43
Show file tree
Hide file tree
Showing 124 changed files with 2,679 additions and 794 deletions.
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ dependencies {
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
// required if you want to use Mockito for unit tests
testImplementation 'org.mockito:mockito-core:3.7.7'
// required if you want to use Mockito for Android tests
androidTestImplementation 'org.mockito:mockito-android:3.7.7'
implementation project(path: ':uikit')

implementation 'com.google.android.material:material:1.2.0-alpha05'
implementation 'com.facebook.shimmer:shimmer:0.4.0'

//
implementation 'com.cometchat:pro-android-chat-sdk:2.2.1'
implementation 'com.cometchat:pro-android-chat-sdk:2.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@Suite.SuiteClasses(
{
MainActivityTest.class,
CreateUserActivity.class,
SelectActivityTest.class,
ComponentActivityTest.class
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.cometchat.pro.androiduikit;

import com.cometchat.pro.androiduikit.app.ComponentActivityTest;
import com.cometchat.pro.androiduikit.app.MainActivityTest;
import com.cometchat.pro.androiduikit.app.SelectActivityTest;
import com.cometchat.pro.androiduikit.uikit.CometChatUITest;
import com.cometchat.pro.androiduikit.uikit.ConversationListTest;
import com.cometchat.pro.androiduikit.uikit.GroupListTest;
import com.cometchat.pro.androiduikit.uikit.UsersListTest;
import com.cometchat.pro.uikit.ui_components.cometchat_ui.CometChatUI;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
CometChatUITest.class,
ConversationListTest.class,
UsersListTest.class,
GroupListTest.class
})

public class UIKitTestSuite {}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public void J_checkCallList() {
public void K_checkCallList_2Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_callList)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_callList)).check(matches(isDisplayed()));
Espresso.onView(ViewMatchers.withId(R.id.cometchat_callList)).perform(click());
Thread.sleep(2000);
Espresso.onView(ViewMatchers.withId(R.id.callList_rv))
Expand All @@ -168,16 +169,22 @@ public void D_checkUserList() {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_user_view)).perform(click());
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchatUserList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (PerformException e) {
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()))
.perform(pressBack());
mDevice.pressBack();;
}
catch (NoMatchingViewException e) {
Log.e( "D_checkUserList: ","No View found...Trying again with 2 Sec Delay");
D_checkUserList_2Sec();
}
catch (PerformException e) {
Assert.assertTrue("View not loaded",true);
} catch (Exception e) {
Assert.fail();
Assert.fail(e.getMessage());
}
}

@Test
public void E_checkUserList_2Sec() {
public void D_checkUserList_2Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_user_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_user_view)).perform(ViewActions.click());
Expand Down Expand Up @@ -205,38 +212,107 @@ public void G_checkGroupList_2Sec() {
Thread.sleep(2000);
Espresso.onView(ViewMatchers.withId(R.id.cometchatGroupList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (InterruptedException e) {
} catch (NoMatchingViewException e) {
Log.e( "F_checkGroupList_2Sec: ","View Not loaded...Moving to 5 sec" );
F_checkGroupList_5Sec();
}catch (InterruptedException e) {
e.printStackTrace();
}
}

public void F_checkGroupList_5Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_group_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_group_view)).perform(ViewActions.click());
Thread.sleep(5000);
Espresso.onView(ViewMatchers.withId(R.id.cometchatGroupList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (NoMatchingViewException e) {
Log.e( "F_checkGroupList_2Sec: ","View Not loaded...Moving to 10 sec" );
F_checkGroupList_10Sec();
}catch (InterruptedException e) {
e.printStackTrace();
}
}

public void F_checkGroupList_10Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_group_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_group_view)).perform(ViewActions.click());
Thread.sleep(10000);
Espresso.onView(ViewMatchers.withId(R.id.cometchatGroupList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (NoMatchingViewException e) {
Assert.fail("View Not Loaded"+e.getMessage());
}catch (InterruptedException e) {
e.printStackTrace();
}
}



@Test
public void H_checkConversationList() {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.click());
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchatConversationList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (PerformException e) {
}
catch (NoMatchingViewException e) {
Log.e( "H_checkConversationList: ","No View found...Trying again with 2 Sec Delay");
H_checkConversationList_2Sec();
}
catch (PerformException e) {
Assert.assertTrue("View not loaded",true);
} catch (Exception e) {
Assert.fail();
Assert.fail(e.getMessage());
}
}

@Test
public void I_checkConversationList_2Sec() {
public void H_checkConversationList_2Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.click());
Thread.sleep(2000);
Espresso.onView(ViewMatchers.withId(R.id.cometchatConversationList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (InterruptedException e) {
} catch (NoMatchingViewException e) {
Log.e("H_checkConversationList_2Sec: ","View Not loaded..Moving to 5 Sec");
H_checkConversationList_5Sec();
}catch (InterruptedException e) {
e.printStackTrace();
}
}

public void H_checkConversationList_5Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.click());
Thread.sleep(5000);
Espresso.onView(ViewMatchers.withId(R.id.cometchatConversationList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (NoMatchingViewException e) {
Log.e("H_checkConversationList_5Sec: ","View Not loaded..Moving to 10 Sec");
H_checkConversationList_10Sec();
}catch (InterruptedException e) {
e.printStackTrace();
}
}

public void H_checkConversationList_10Sec() {
try {
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.scrollTo());
Espresso.onView(ViewMatchers.withId(R.id.cometchat_conversation_view)).perform(ViewActions.click());
Thread.sleep(10000);
Espresso.onView(ViewMatchers.withId(R.id.cometchatConversationList))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
} catch (NoMatchingViewException e) {
Assert.fail("View Not Loaded"+e.getMessage());
}catch (InterruptedException e) {
e.printStackTrace();
}
}
// RecyclerView callRv = activityRule.getActivity().findViewById(R.id.cometchat_callList);
// int itemCount = callRv.getAdapter().getItemCount();
// if (itemCount>0) {
Expand Down

This file was deleted.

Loading

0 comments on commit 1fa5e43

Please sign in to comment.