PixelDroid-App-Android/app/src/androidTest/java/com/h/pixeldroid/MockedServerTest.kt

293 lines
9.4 KiB
Kotlin
Raw Normal View History

package com.h.pixeldroid
/*
@RunWith(AndroidJUnit4::class)
class MockedServerTest {
private lateinit var mockServer: MockServer
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
private lateinit var activityScenario: ActivityScenario<MainActivity>
private lateinit var db: AppDatabase
private lateinit var context: Context
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
@Before
fun before(){
mockServer = MockServer()
mockServer.start()
val baseUrl = mockServer.getUrl()
context = ApplicationProvider.getApplicationContext()
db = initDB(context)
db.clearAllTables()
db.instanceDao().insertInstance(
InstanceDatabaseEntity(
uri = baseUrl.toString(),
title = "PixelTest"
)
)
db.userDao().insertUser(
UserDatabaseEntity(
user_id = "123",
instance_uri = baseUrl.toString(),
username = "Testi",
display_name = "Testi Testo",
avatar_static = "some_avatar_url",
isActive = true,
accessToken = "token"
)
)
db.close()
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
activityScenario = ActivityScenario.launch(MainActivity::class.java)
}
@After
fun after() {
clearData()
mockServer.stop()
}
/*
@Test
fun searchPosts() {
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(1)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.searchEditText)).perform(ViewActions.replaceText("caturday"), ViewActions.closeSoftKeyboard())
onView(withId(R.id.searchButton)).perform(click())
Thread.sleep(3000)
onView(first(withId(R.id.username))).check(matches(withText("memo")))
}
@Test
fun searchHashtags() {
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(1)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.searchEditText)).perform(ViewActions.replaceText("#caturday"), ViewActions.closeSoftKeyboard())
onView(withId(R.id.searchButton)).perform(click())
Thread.sleep(3000)
onView(first(withId(R.id.tag_name))).check(matches(withText("#caturday")))
}
*/
@Test
fun openDiscoverPost(){
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(1)?.select()
}
Thread.sleep(1000)
onView(first(withId(R.id.postPreview))).perform(click())
Thread.sleep(1000)
onView(withId(R.id.username)).check(matches(withText("Arthur")))
}
/*
@Test
fun searchAccounts() {
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(1)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.searchEditText)).perform(ViewActions.replaceText("@dansup"), ViewActions.closeSoftKeyboard())
onView(withId(R.id.searchButton)).perform(click())
Thread.sleep(3000)
onView(first(withId(R.id.account_entry_username))).check(matches(withText("dansup")))
}
*/
@Test
fun clickFollowButton() {
//Get initial like count
onView(withId(R.id.list))
.perform(actionOnItemAtPosition<PostViewHolder>
(0, clickChildViewWithId(R.id.username)))
Thread.sleep(1000)
// Unfollow
onView(withId(R.id.followButton)).perform((click()))
Thread.sleep(1000)
onView(withId(R.id.followButton)).check(matches(withText("Follow")))
// Follow
onView(withId(R.id.followButton)).perform((click()))
Thread.sleep(1000)
onView(withId(R.id.followButton)).check(matches(withText("Unfollow")))
}
@Test
fun clickOtherUserFollowers() {
//Get initial like count
onView(withId(R.id.list))
.perform(actionOnItemAtPosition<PostViewHolder>
(0, clickChildViewWithId(R.id.username)))
Thread.sleep(1000)
// Open followers list
onView(withId(R.id.nbFollowersTextView)).perform((click()))
Thread.sleep(1000)
// Open follower's profile
onView(withText("ete2")).perform((click()))
Thread.sleep(1000)
onView(withId(R.id.accountNameTextView)).check(matches(withText("Christian")))
}
@Test
fun testNotificationsList() {
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(3)?.select()
}
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
Thread.sleep(1000)
onView(withId(R.id.view_pager)).perform(ViewActions.swipeUp()).perform(ViewActions.swipeDown())
onView(withText("Dobios liked your post")).check(matches(withId(R.id.notification_type)))
onView(withId(R.id.view_pager)).perform(ViewActions.swipeDown())
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
Thread.sleep(1000)
onView(withText("Dobios followed you")).check(matches(withId(R.id.notification_type)))
}
@Test
fun clickNotification() {
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(3)?.select()
}
Thread.sleep(1000)
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
onView(withId(R.id.view_pager)).perform(ViewActions.swipeUp()).perform(ViewActions.swipeDown())
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
Thread.sleep(1000)
onView(withText("Dobios liked your post")).perform(click())
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
Thread.sleep(1000)
2020-04-02 20:22:48 +02:00
onView(withText("6 Likes")).check(matches(withId(R.id.nlikes)))
}
@Test
fun clickNotificationUser() {
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(3)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.view_pager)).perform(ViewActions.swipeUp()).perform(ViewActions.swipeDown())
Thread.sleep(1000)
onView(withText("Dobios followed you")).perform(click())
Thread.sleep(1000)
onView(second(withText("Andrew Dobis"))).check(matches(withId(R.id.accountNameTextView)))
}
@Test
fun clickNotificationPost() {
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(3)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.view_pager)).perform(ViewActions.swipeUp()).perform(ViewActions.swipeDown())
Thread.sleep(1000)
onView(withText("Dobios liked your post")).perform(click())
Thread.sleep(1000)
onView(withId(R.id.username)).perform(click())
Thread.sleep(1000)
onView(second(withText("Dante"))).check(matches(withId(R.id.accountNameTextView)))
}
@Test
fun clickNotificationRePost() {
activityScenario.onActivity{
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(3)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.view_pager)).perform(ViewActions.swipeUp()).perform(ViewActions.swipeDown())
Thread.sleep(1000)
onView(withText("Clement shared your post")).perform(click())
Thread.sleep(1000)
onView(first(withText("Andrea"))).check(matches(withId(R.id.username)))
}
@Test
fun swipingRightStopsAtHomepage() {
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
activityScenario.onActivity {
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(4)?.select()
} // go to the last tab
Feature/post creation (#83) * added perm and features for cameraS, gps and external storage * added camera activity accessible from main activity * added button to redirect to camera activity * implementing callback flow to use camera * working camera * added texture view for camera display * added camera activity * implemented texture listener * camera not working, flow done, no feedback implemented * camera working * refactored code, still an activity * added private to internal function, better error function handling * deleted camera activity * added camera fragment * added camera fragment * refactored camera as fragment * necessary dependencies for fragment testing * initial camera fragment test * corrected access to activity form fragment * Added state changes and termination * added lines to test, to test coverage * Removed unsupported state STARTED state transition * Added basic tests to test code coverage * use layout for tests, to trigger permissions requirements * grant camera permission to app in camera test * replaced null handlers by proper function getter * changed layout, added takePictureButton * using expresso to get code coverage on camea * take picture flow not finished * dummy change to camera test to perform new build * added connection flow before test to reach main activity * can take a picture and put it to ImageView * replaced button text with images * smaller buttons * test camera fragment buttons * added orientation handler * changed icon to make travis happy * test new espresso config for travis * removed useless rule * deleted useless val * added layout ID's * moved swipes from Before to Tests, and thread sleep * stoped swiping, now tests from fragment directly * start post creation flow * use Uri when taking photo, can now go back from picture preview * adjusted test and flow idea * tests on displayed UI elements for the post creation fragment * refactor camera fragment into transition new post fragemnt * finished first phase: get a picture Uri * fixed lint error found by travis CI * added global timeout to test * test the new way of test * refactor new way of testing * added in-app camera view and linked everything to the final flow + started API to post * strugling on the upload media part * upload image on server implemented * post upload implemented * added API call to get max_toot_chars and correct def of a post description * fixed some tests * fix tests: clicking on tabs make the app crash because of the camera fragment * comment problematic chunk of code while samuel tries to fix it * switch minimumsdk to api 24 * Revert "switch minimumsdk to api 24" This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549. * deactivited live camera for API 23 * tests for post creation fragment UI elements * remove worthless UI testing and add gallery intent test * removed camera intent for now * some refactor * lint error and more refactor * more refactor on merge from master * refactor and test for PostCreationActivity * Revert "refactor and test for PostCreationActivity" This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747. * Revert "Revert "refactor and test for PostCreationActivity"" This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6. * permissions correction for test * updtated test * fix a test and refactor * relink correct fragment * save picture locally * test post button * requested changes * fixed required changes * Revert "fixed required changes" This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b. * redo change request * added /media api response to mockserver Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
Thread.sleep(1000)
onView(withId(R.id.main_activity_main_linear_layout))
.perform(ViewActions.swipeRight()) // notifications
.perform(ViewActions.swipeRight()) // camera
.perform(ViewActions.swipeRight()) // search
.perform(ViewActions.swipeRight()) // homepage
.perform(ViewActions.swipeRight()) // should stop at homepage
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
onView(withId(R.id.list)).check(matches(isDisplayed()))
}
@Test
fun swipingLeftStopsAtPublicTimeline() {
activityScenario.onActivity {
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(0)?.select()
}
Thread.sleep(1000)
onView(withId(R.id.main_activity_main_linear_layout))
.perform(ViewActions.swipeLeft()) // notifications
.perform(ViewActions.swipeLeft()) // camera
.perform(ViewActions.swipeLeft()) // search
.perform(ViewActions.swipeLeft()) // homepage
.perform(ViewActions.swipeLeft()) // should stop at homepage
onView(withId(R.id.list)).check(matches(isDisplayed()))
}
@Test
fun swipingPublicTimelineWorks() {
activityScenario.onActivity {
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(4)?.select()
} // go to the last tab
Thread.sleep(1000)
onView(withId(R.id.view_pager))
.perform(ViewActions.swipeRight()) // notifications
.perform(ViewActions.swipeRight()) // camera
.perform(ViewActions.swipeRight()) // search
.perform(ViewActions.swipeRight()) // homepage
.perform(ViewActions.swipeRight()) // should stop at homepage
onView(withId(R.id.list)).check(matches(isDisplayed()))
activityScenario.onActivity {
a -> assert(a.findViewById<TabLayout>(R.id.tabs).getTabAt(0)?.isSelected ?: false)
}
}
@Test
fun censorMatrices() {
val array: FloatArray = floatArrayOf(
0f, 0f, 0f, 0f, 0f, // red vector
0f, 0f, 0f, 0f, 0f, // green vector
0f, 0f, 0f, 0f, 0f, // blue vector
0f, 0f, 0f, 1f, 0f ) // alpha vector
assert(censorColorMatrix().equals(ColorMatrix(array)))
assert(uncensorColorMatrix().equals(ColorMatrix()))
}
}
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
*/