Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added UI Testing #571

Open
wants to merge 25 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e3c65aa
Added UI Testing
Akash-Ramjyothi Jul 25, 2020
8ec2744
Update .travis.yml
Akash-Ramjyothi Jul 25, 2020
650fe22
Update .travis.yml
Akash-Ramjyothi Jul 25, 2020
29ea349
Merge branch 'new_branch3' of https://github.com/amahi/android into n…
chirag-jn Jul 26, 2020
daa81ec
remove captures
chirag-jn Jul 26, 2020
7ee4206
reformat tests
chirag-jn Jul 26, 2020
5c2deb9
reformat tests
chirag-jn Jul 26, 2020
ab3d87f
update espresso dependencies
chirag-jn Jul 26, 2020
cd75cc5
update espresso dependencies
chirag-jn Jul 26, 2020
83e7f2b
update travis
chirag-jn Jul 26, 2020
9db6ba3
update travis
chirag-jn Jul 26, 2020
0609e57
update travis
chirag-jn Jul 26, 2020
22b3e00
update travis
chirag-jn Jul 26, 2020
51754b9
update travis
chirag-jn Jul 26, 2020
b41f5a9
update travis
chirag-jn Jul 26, 2020
158f075
update travis
chirag-jn Jul 26, 2020
be70344
Merge pull request #572 from chirag-jn/new_branch3
chirag-jn Jul 26, 2020
ee5ca6b
Update ExpandedControlsActivityTest.java
Akash-Ramjyothi Jul 26, 2020
4cc8982
Update ExpandedControlsActivityTest.java
Akash-Ramjyothi Jul 26, 2020
2f4100d
Delete ExpandedControlsActivityTest.java
Akash-Ramjyothi Jul 26, 2020
d51f26e
Update OfflineFilesActivityTest.java
Akash-Ramjyothi Jul 26, 2020
c875826
Delete OfflineFilesActivityTest.java
Akash-Ramjyothi Jul 26, 2020
f94b045
Merge branch 'beta' into new_branch3
chirag-jn Jul 29, 2020
16c064f
Merge branch 'new_branch3' of https://github.com/amahi/android into n…
chirag-jn Feb 28, 2021
0f05e21
Merge branch 'beta' into new_branch3
chirag-jn Feb 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ dependencies {
implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
implementation 'com.l4digital.fastscroll:fastscroll:2.0.1'

// Espresso Testing Framework Implementations
def ESPRESSO_LIBRARY_VERSION = "3.2.0"
androidTestImplementation ("androidx.test.espresso:espresso-core:${ESPRESSO_LIBRARY_VERSION}") {
exclude group: "javax.inject"
}
androidTestImplementation ("androidx.test.espresso:espresso-web:${ESPRESSO_LIBRARY_VERSION}") {
exclude group: "javax.inject"
}
androidTestImplementation ("androidx.test.espresso:espresso-intents:${ESPRESSO_LIBRARY_VERSION}") {
exclude group: "javax.inject"
}

// Otto and Retrofit
implementation 'com.squareup:otto:1.3.8'
implementation 'com.github.apl-devs:appintro:v4.2.3'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package org.amahi.anywhere.activity;

import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import org.amahi.anywhere.R;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@LargeTest
@FixMethodOrder(MethodSorters.DEFAULT)

public class IntroductionActivityTest {

@Rule
public ActivityTestRule<IntroductionActivity> mActivityRule
= new ActivityTestRule<>(IntroductionActivity.class);

@Before
public void setUp() throws Exception {
}

@Test
public void test1() {
onView(withText(R.string.intro_phone_1)).check(matches(isDisplayed()));
onView(withText(R.string.intro_desc_phone_1)).check(matches(isDisplayed()));
}

@Test
public void test2() {
onView(withText(R.string.intro_title_2));
onView(withText(R.string.intro_desc_2));
}

@Test
public void test3() {
onView(withText(R.string.intro_title_3));
onView(withText(R.string.intro_desc_phone_3));
}

@Test
public void test4() {
onView(withText(R.string.intro_title_4));
onView(withText(R.string.intro_desc_phone_4));
}

@Test
public void test5() {
onView(withText(R.string.intro_title_5));
onView(withText(R.string.intro_desc_phone_5));
}

@Test
public void test6() {
onView(withText(R.string.intro_title_6));
onView(withText(R.string.intro_desc_6));
}

@After
public void tearDown() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package org.amahi.anywhere.activity;

import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import org.amahi.anywhere.R;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@LargeTest
@FixMethodOrder(MethodSorters.DEFAULT)

public class NativeVideoActivityTest {

@Rule
public ActivityTestRule<IntroductionActivity> mActivityRule
= new ActivityTestRule<>(IntroductionActivity.class);

@Before
public void setUp() throws Exception {
}

@Test
public void test1() {
onView(withText(R.string.intro_phone_1)).check(matches(isDisplayed()));
onView(withText(R.string.intro_desc_phone_1)).check(matches(isDisplayed()));
}

@Test
public void test2() {
onView(withText(R.string.intro_title_2));
onView(withText(R.string.intro_desc_2));
}

@Test
public void test3() {
onView(withText(R.string.intro_title_3));
onView(withText(R.string.intro_desc_phone_3));
}

@Test
public void test4() {
onView(withText(R.string.intro_title_4));
onView(withText(R.string.intro_desc_phone_4));
}

@Test
public void test5() {
onView(withText(R.string.intro_title_5));
onView(withText(R.string.intro_desc_phone_5));
}

@Test
public void test6() {
onView(withText(R.string.intro_title_6));
onView(withText(R.string.intro_desc_6));
}

@After
public void tearDown() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package org.amahi.anywhere.activity;

import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import org.amahi.anywhere.R;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@LargeTest
@FixMethodOrder(MethodSorters.DEFAULT)

public class NavigationActivityTest {

@Rule
public ActivityTestRule<NavigationActivity> mActivityRule
= new ActivityTestRule<>(NavigationActivity.class);

@Before
public void setUp() throws Exception {
}

@Test
public void test1() {
onView(withId(R.id.view_stub_tv_loading));
}

@Test
public void test2() {
onView(withId(R.id.tv_loading));
}

@Test
public void test3() {
onView(withId(R.id.container_content));
}

@Test
public void test4() {
onView(withId(R.id.container_navigation));
}

@Test
public void test5() {
onView(withId(R.id.toolbar));
}

@Test
public void test6() {
onView(withText(R.string.title_shares));
}

@Test
public void test7() {
onView(withText(R.string.menu_navigation_open));
}

@Test
public void test8() {
onView(withId(R.id.drawer_content));
}

@Test
public void test9() {
onView(withText(R.string.application_name));
}

@Test
public void test10() {
onView(withText(R.string.title_apps));
}

@After
public void tearDown() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package org.amahi.anywhere.activity;

import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import org.amahi.anywhere.R;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.not;

@RunWith(AndroidJUnit4.class)
@LargeTest
@FixMethodOrder(MethodSorters.DEFAULT)

public class RecentFilesActivityTest {

@Rule
public ActivityTestRule<RecentFilesActivity> mActivityRule
= new ActivityTestRule<>(RecentFilesActivity.class);

@Before
public void setUp() throws Exception {
}

@Test
public void test1() {
onView(withText(R.string.title_recent_files)).check(matches(isDisplayed()));
}

@Test
public void test2() {
onView(withId(R.id.recent_list)).check(matches(not(isDisplayed())));
}

@Test
public void test3() {
onView(withId(android.R.id.empty)).check(matches(isDisplayed()));
}

@Test
public void test4() {
onView(withId(R.id.layout_refresh)).check(matches(isDisplayed()));
}

@Test
public void test5() {
onView(withText(R.string.message_delete_file_error)).check(doesNotExist());
}

@Test
public void test6() {
onView(withText(R.string.message_offline_file_deleted)).check(doesNotExist());
}

@Test
public void test7() {
onView(withId(R.id.media_route_menu_item)).check(doesNotExist());
}

@After
public void tearDown() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.amahi.anywhere.activity;

import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;

import org.amahi.anywhere.R;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@LargeTest
@FixMethodOrder(MethodSorters.DEFAULT)

public class ServerAppActivityTest {

@Rule
public ActivityTestRule<OfflineFilesActivity> mActivityRule
= new ActivityTestRule<>(OfflineFilesActivity.class);

@Before
public void setUp() throws Exception {
}

@Test
public void test1() {
onView(withText(R.string.title_offline_files)).check(matches(isDisplayed()));
}

@Test
public void test2() {
onView(withId(R.id.container_files)).check(matches(isDisplayed()));
}

@Test
public void test3() {
onView(withText(R.string.message_progress_file_downloading));
}


@After
public void tearDown() throws Exception {
}
}
Loading