-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from naeemark/develop
Develop
- Loading branch information
Showing
36 changed files
with
418 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
app/src/androidTest/java/com/tline/android/TimelineActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package com.tline.android; | ||
|
||
|
||
import android.support.test.espresso.ViewInteraction; | ||
import android.support.test.rule.ActivityTestRule; | ||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.suitebuilder.annotation.LargeTest; | ||
|
||
import com.tline.android.features.timeline.activity.view.impl.TimelineActivity; | ||
|
||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static android.support.test.espresso.Espresso.onView; | ||
import static android.support.test.espresso.assertion.ViewAssertions.matches; | ||
import static android.support.test.espresso.matcher.ViewMatchers.hasDescendant; | ||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; | ||
import static android.support.test.espresso.matcher.ViewMatchers.withId; | ||
|
||
@LargeTest | ||
@RunWith(AndroidJUnit4.class) | ||
public class TimelineActivityTest { | ||
|
||
@Rule | ||
public ActivityTestRule<TimelineActivity> mActivityTestRule = new ActivityTestRule<>(TimelineActivity.class); | ||
|
||
|
||
@Before | ||
public void setUp() throws Exception { | ||
try { | ||
Thread.sleep(2000); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
@Test | ||
public void checkActionbarItemsVisiblility(){ | ||
ViewInteraction language = onView(withId(R.id.action_language)); | ||
ViewInteraction logout = onView(withId(R.id.action_logout)).perform(); | ||
|
||
language.check(matches(isDisplayed())); | ||
logout.check(matches(isDisplayed())); | ||
} | ||
|
||
@Test | ||
public void checkTimelineBottomTabVisiblility(){ | ||
ViewInteraction tab = onView(withId(R.id.action_timeline)); | ||
|
||
tab.check(matches(isDisplayed())); | ||
} | ||
|
||
@Test | ||
public void checkAndroidDevBottomTabVisiblility(){ | ||
ViewInteraction tab = onView(withId(R.id.action_android_dev)); | ||
|
||
tab.check(matches(isDisplayed())); | ||
} | ||
|
||
@Test | ||
public void checkOlxBottomTabVisiblility(){ | ||
ViewInteraction tab = onView(withId(R.id.action_olx_egypt)); | ||
|
||
tab.check(matches(isDisplayed())); | ||
} | ||
|
||
@Test | ||
public void checkRecyclerViewVisibility(){ | ||
|
||
ViewInteraction scroll = onView(withId(R.id.recyclerView)); | ||
|
||
scroll.check(matches(isDisplayed())); | ||
} | ||
|
||
@Test | ||
public void checkScrollViewHasAnyItem(){ | ||
|
||
ViewInteraction container = onView(withId(R.id.recyclerView)); | ||
|
||
container.check(matches(hasDescendant(withId(R.id.tvUserName)))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
...src/main/java/com/tline/android/features/timeline/fragment/presenter/TweetsPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,14 @@ | ||
package com.tline.android.features.timeline.fragment.presenter; | ||
|
||
import com.tline.android.app.presenter.BasePresenter; | ||
import com.tline.android.features.timeline.fragment.interactor.TweetsInteractor; | ||
import com.tline.android.features.timeline.fragment.view.TweetsView; | ||
import com.twitter.sdk.android.core.models.Tweet; | ||
|
||
import java.util.List; | ||
|
||
public interface TweetsPresenter extends BasePresenter<TweetsView> { | ||
public interface TweetsPresenter extends BasePresenter<TweetsView>, TweetsInteractor.OnFetchDataListener { | ||
|
||
interface OnFetchDataListener { | ||
|
||
void onStart(); | ||
|
||
void onSuccess(List<Tweet> tweets); | ||
|
||
void onFailure(String message); | ||
|
||
void onComplete(); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.