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

[WIP] Added Caption and UI for depicts #2970

Closed
Show file tree
Hide file tree
Changes from 190 commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
f4e495b
[WIP] Fixes #2942. Set 'depicts' automatically for images uploaded vi…
VitalyVPinchuk May 21, 2019
a7712f0
Feature/refractor uploads [WIP] (#2887)
ashishkumar468 May 28, 2019
80dff48
refactored title
vanshikaarora May 28, 2019
6085c75
ui for depicts
vanshikaarora May 28, 2019
492a9a6
Merge branch 'master' into fix-2942
VitalyVPinchuk May 29, 2019
e18f0e1
bug fix
vanshikaarora May 30, 2019
74590cb
basic architecture for depicts
vanshikaarora May 30, 2019
d54225a
Merge branch 'refactor_uploads' of https://github.com/commons-app/app…
vanshikaarora May 30, 2019
f237113
adde architecture components for depicts
vanshikaarora May 30, 2019
8ec0159
[WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param cre…
VitalyVPinchuk May 30, 2019
79d37ff
resolved dagger errors
vanshikaarora Jun 1, 2019
0fec78b
multilingual captions and next button error resolved
vanshikaarora Jun 2, 2019
94e97b0
fixed next button issues in depicts fragment
vanshikaarora Jun 2, 2019
0068418
captions and depicts
vanshikaarora Jun 2, 2019
2a748d9
resolved previous button click issues
vanshikaarora Jun 2, 2019
c5a50b8
fixed bindview error and added multi-captions
vanshikaarora Jun 2, 2019
8a32aed
replaced description and caption with uploadmediadetail
vanshikaarora Jun 2, 2019
3fdd445
refactored few classes
vanshikaarora Jun 2, 2019
2de87a0
modified ui of depicts
vanshikaarora Jun 2, 2019
d624e68
minor fixes
vanshikaarora Jun 2, 2019
b53803b
Bug fix, reduced the add description edit text clickable bound (#2973)
ashishkumar468 Jun 2, 2019
9ea80c9
moved depicts before categories
vanshikaarora Jun 3, 2019
6a8644e
replaced previous filename with captions
vanshikaarora Jun 3, 2019
fa0891d
removed time from filename
vanshikaarora Jun 4, 2019
6e849e6
Merge branch 'refactor_uploads' of https://github.com/commons-app/app…
vanshikaarora Jun 4, 2019
5e1d785
Merge branch 'master' into fix-2942
VitalyVPinchuk Jun 4, 2019
c078d28
added depicts suggestions
vanshikaarora Jun 5, 2019
f7971ee
Merge branch 'master' into fix-2942
VitalyVPinchuk Jun 6, 2019
32c1043
[WIP] Wikidata Sandbox (Q4115189) test
VitalyVPinchuk Jun 7, 2019
9b988bd
changes layout of layout_upload_depicts
vanshikaarora Jun 8, 2019
db8523d
changed layout of upload_depicts
vanshikaarora Jun 8, 2019
48d05d0
code stuck at IO_SCHEDULER
vanshikaarora Jun 9, 2019
e05b337
Merge branch 'master' into refactor_uploads
maskaravivek Jun 9, 2019
a93c22c
labels and description for depicts activity
vanshikaarora Jun 9, 2019
82d1201
Bugfix/uploads (#3000)
ashishkumar468 Jun 9, 2019
7dd42c3
Fix memory leak (#3001)
maskaravivek Jun 9, 2019
0b357be
Bugfix/uploads (#3002)
ashishkumar468 Jun 10, 2019
0782e72
Bugfix/uploads (#3011)
ashishkumar468 Jun 11, 2019
ee9baf6
bugfix/uploads (#3012)
ashishkumar468 Jun 12, 2019
95f272a
merge conflict with strings (#3016)
ashishkumar468 Jun 12, 2019
bf5bb76
Merge branch 'master' into refactor_uploads
maskaravivek Jun 12, 2019
08cd28f
[WIP] Fixed duplicated subscriprion for 'addPropertyP180'
VitalyVPinchuk Jun 13, 2019
a8ef2f9
Merge branch 'master' into fix-2942
VitalyVPinchuk Jun 13, 2019
5d73d29
added documentation
vanshikaarora Jun 15, 2019
d900748
fixed issue #3006
vanshikaarora Jun 16, 2019
be6b726
resolved issue #3004
vanshikaarora Jun 16, 2019
76d2ed1
fixed issue with categoryPresenterTest.kt
vanshikaarora Jun 16, 2019
00d50d7
send captions as labels
vanshikaarora Jun 17, 2019
99bda68
Merge branch 'master' into fix-2942
VitalyVPinchuk Jun 17, 2019
6a6dd20
fixed issue with the captions
vanshikaarora Jun 17, 2019
eeb9fe1
resolved merge conflicts
vanshikaarora Jun 18, 2019
3fe29da
optimised imports
vanshikaarora Jun 18, 2019
f25b8b7
Merge branch 'master' of https://github.com/commons-app/apps-android-…
vanshikaarora Jun 18, 2019
c7b7b17
Merge branch 'fix-2942' of https://github.com/VitalyVPinchuk/apps-and…
vanshikaarora Jun 18, 2019
ee13ada
added upload for captions
vanshikaarora Jun 19, 2019
3c5e286
resolved merge conflicts with refactor_uploads
vanshikaarora Jun 19, 2019
a9f9231
minor changes
vanshikaarora Jun 19, 2019
6e3d271
resolved issue with uploading captions
vanshikaarora Jun 21, 2019
39be6a4
resolved issue with api call
vanshikaarora Jun 21, 2019
b88fa14
uploading captions to wikibase
vanshikaarora Jun 22, 2019
ec2367f
added some tests and documentation
vanshikaarora Jun 23, 2019
35e757b
undo formatting changes
vanshikaarora Jun 23, 2019
8a8c511
uploaded captions as labels to wikibase
vanshikaarora Jun 26, 2019
dfd0dba
minor changes
vanshikaarora Jun 26, 2019
5dc45a5
Fix bugs in peer review flow (#3039)
maskaravivek Jun 26, 2019
31b5179
Merge branch 'master' into 2.11-release
maskaravivek Jun 26, 2019
a1ce272
rebased branch with master
vanshikaarora Jun 26, 2019
ec9c964
resolved error with spinner adpater
vanshikaarora Jun 27, 2019
bb00bba
adding captions to local database
vanshikaarora Jun 29, 2019
f7c6758
Fixed issue #3035
vanshikaarora Jun 29, 2019
4a6bb78
fixed issue #3033
vanshikaarora Jun 29, 2019
cbd52ec
fixed issue #3005
vanshikaarora Jun 29, 2019
59327e0
Merge branch 'master' into upload_caption_depict
maskaravivek Jun 29, 2019
59ac109
fixed issue #3005
vanshikaarora Jun 30, 2019
2021e49
Merge branch 'upload_caption_depict' of https://github.com/vanshikaar…
vanshikaarora Jun 30, 2019
3886439
added search for depicts
vanshikaarora Jun 30, 2019
942ebbe
fixed issue with compile time
vanshikaarora Jul 4, 2019
160fdb5
fixe issue with project build
vanshikaarora Jul 4, 2019
e8db428
fixed issue #3044
vanshikaarora Jul 4, 2019
39f7251
merged uploading depicts into branch
vanshikaarora Jul 11, 2019
ead14c6
uploading depicts
vanshikaarora Jul 11, 2019
bb570a5
Localisation updates from https://translatewiki.net.
translatewiki Jul 11, 2019
abf641b
rebased branch
vanshikaarora Jul 12, 2019
256c587
fixed crash due to depicts
vanshikaarora Jul 14, 2019
d3b4e42
modified depicts interface
vanshikaarora Jul 15, 2019
03d540a
Merge branch 'backend-overhaul' of https://github.com/commons-app/app…
vanshikaarora Jul 15, 2019
b59e044
merged backend-overhaul
vanshikaarora Jul 15, 2019
94f3b6e
Localisation updates from https://translatewiki.net.
translatewiki Jul 15, 2019
fb1e213
Resolve merge conflicts
maskaravivek Jul 15, 2019
a6a50f6
Fix issues with API calls
maskaravivek Jul 15, 2019
2936d9b
Merge branch 'backend-overhaul' into mergeConflicts
maskaravivek Jul 15, 2019
76d6736
Use wikidata token
maskaravivek Jul 15, 2019
4df55eb
Merge branch 'backend-overhaul' into mergeConflicts
maskaravivek Jul 15, 2019
ebb339b
Merge pull request #6 from maskaravivek/mergeConflicts
vanshikaarora Jul 16, 2019
bacc9bc
searching depictions from depicts activity
vanshikaarora Jul 16, 2019
32715d9
Set defaults to ON for all EXIF tags (#3068)
VitalyVPinchuk Jul 16, 2019
3a029a2
added some documentation and other changes
vanshikaarora Jul 16, 2019
b210b1b
fixed crash on selecting depictions
vanshikaarora Jul 16, 2019
7167094
sending wikidataentity id to upload depictions
vanshikaarora Jul 16, 2019
583cfd3
added changes after review
vanshikaarora Jul 16, 2019
1560b77
Localisation updates from https://translatewiki.net.
translatewiki Jul 18, 2019
c045773
Fixed issue with next button diabling in media detail activity
vanshikaarora Jul 19, 2019
d6dc1b8
added tests for depictions
vanshikaarora Jul 19, 2019
ef686b2
added all the unit tests and fixed few more issues
vanshikaarora Jul 20, 2019
8cd9bd5
Fix category search bug (#3080)
ashishkumar468 Jul 21, 2019
1a60fec
Merge remote-tracking branch 'origin/2.11-release'
misaochan Jul 21, 2019
a2bf5c2
showing captions in media details
vanshikaarora Jul 22, 2019
0574b75
Localisation updates from https://translatewiki.net.
translatewiki Jul 22, 2019
308d703
show captions in media details
vanshikaarora Jul 22, 2019
b09f7ce
added documentations and worked upon review comments
vanshikaarora Jul 23, 2019
d03fc5e
parsing response for depictions
vanshikaarora Jul 23, 2019
2107a60
displaying captions and depiction QID in media detail
vanshikaarora Jul 24, 2019
1f0a1e9
added documentation
vanshikaarora Jul 24, 2019
824c091
fetching labels from QIDs
vanshikaarora Jul 24, 2019
7debc09
captions working perfectly
vanshikaarora Jul 24, 2019
1947778
added documentations and code cleaning
vanshikaarora Jul 24, 2019
2b1a8a8
minor changes
vanshikaarora Jul 24, 2019
2c7d210
Localisation updates from https://translatewiki.net.
translatewiki Jul 25, 2019
6becc39
minor changes
vanshikaarora Jul 25, 2019
32c82e9
Showing items in explore
vanshikaarora Jul 25, 2019
423d7ae
added search via depicts in explore
vanshikaarora Jul 29, 2019
9cc915b
Added setOffscreenPageLimit in ViewPager
ashishkumar468 Jul 29, 2019
1b03170
Merge pull request #7 from ashishkumar468/bugfix/search
vanshikaarora Jul 29, 2019
b15c1f7
resolved merge conflicts
vanshikaarora Jul 29, 2019
a41806f
Merge branch 'upload_caption_depict' of https://github.com/vanshikaar…
vanshikaarora Jul 29, 2019
ab1ba3a
resolved merge conflicts wih backend-overhaul
vanshikaarora Jul 29, 2019
b976619
show captions in explore
vanshikaarora Jul 29, 2019
22be5b5
show captions in home
vanshikaarora Jul 29, 2019
cf576c0
showing depict images under items
vanshikaarora Jul 29, 2019
0049e2b
added documentation and code refactoring
vanshikaarora Jul 29, 2019
7fc7783
enabled pagination in depiction search
vanshikaarora Jul 30, 2019
85fbe59
added some tests and media deatils in depiction detail activity
vanshikaarora Jul 30, 2019
ac8e347
fixed bug with back button in media
vanshikaarora Jul 30, 2019
f9a9854
fixed issue #3100
vanshikaarora Jul 30, 2019
29e0fca
fixed issue #3098
vanshikaarora Jul 30, 2019
6295408
fixed issue #3099
vanshikaarora Jul 30, 2019
369137a
fixed issue #3104 and #3098
vanshikaarora Jul 31, 2019
238a91a
showing captions in place of title in home and explore:media
vanshikaarora Jul 31, 2019
2c94e4e
show captions in explore:depiction image list activity
vanshikaarora Jul 31, 2019
e7a6d8d
showing depictions in media details
vanshikaarora Aug 1, 2019
19d8202
showing depictions in media details in production flavor
vanshikaarora Aug 2, 2019
46978b4
fixed issue #3108 and #3107
vanshikaarora Aug 2, 2019
b64ebbc
fix isse #3108
vanshikaarora Aug 2, 2019
ee2b7be
fixed issue #3110 and #3112
vanshikaarora Aug 2, 2019
c22762b
fixed issue #3113
vanshikaarora Aug 3, 2019
096199d
added documentations
vanshikaarora Aug 3, 2019
39834fb
fixed issue #3076 and #3109
vanshikaarora Aug 3, 2019
83a5b77
added depiction search test
vanshikaarora Aug 3, 2019
1607bd9
fixed issue #3113
vanshikaarora Aug 4, 2019
e791477
fixed issue #3111
vanshikaarora Aug 5, 2019
bcd4577
fixed issue #3106
vanshikaarora Aug 6, 2019
7aeb3d1
Showing items in explore
vanshikaarora Aug 7, 2019
c20bfe1
minor change
vanshikaarora Aug 7, 2019
f3389a5
fixed issue #3118 and some other changes
vanshikaarora Aug 7, 2019
ce70d29
added MVP in searchdepictionsfragment
vanshikaarora Aug 7, 2019
bd47547
added mvp architecture
vanshikaarora Aug 7, 2019
456c4b7
added MVP architecture to DepictedImagesDetailsActivity
vanshikaarora Aug 7, 2019
fd03dcf
added documentation and some minor changes
vanshikaarora Aug 7, 2019
6807d0d
added image to depicted item in search depictions
vanshikaarora Aug 8, 2019
1912356
* Use callbacks from renderer to fetch thumbnails
ashishkumar468 Aug 8, 2019
574e1bd
Merge pull request #8 from ashishkumar468/bugfix/depitcions-thumbnails
vanshikaarora Aug 8, 2019
6c453ee
adding fresco to load image in depictions
vanshikaarora Aug 8, 2019
262b4a6
adding thumbnail image for depictions in upload and explore
vanshikaarora Aug 8, 2019
d23d06f
pagination issues
vanshikaarora Aug 8, 2019
9909d64
fixed issue --(showing previous depiction thumbnail in explore)
vanshikaarora Aug 10, 2019
7eaf00d
Fixed the logic for pagination
ashishkumar468 Aug 10, 2019
f34281b
hide progress on success of last page
ashishkumar468 Aug 10, 2019
408c9cf
Merge pull request #9 from ashishkumar468/bugfix/pagination
vanshikaarora Aug 10, 2019
570b720
Merge branch 'test_scroll' into upload_caption_depict
vanshikaarora Aug 11, 2019
f536f3c
adding sub-items and parent items to search in explore
vanshikaarora Aug 11, 2019
ac82747
minor changes for review comments
vanshikaarora Aug 12, 2019
3370b11
fixed issue #3119
vanshikaarora Aug 12, 2019
e778de4
fixed issue #3130
vanshikaarora Aug 14, 2019
685d8f8
changes after review comments
vanshikaarora Aug 15, 2019
a9244b4
showing child classes for depictions
vanshikaarora Aug 15, 2019
7348d2d
Showing child items
vanshikaarora Aug 15, 2019
970e45e
showing parent classes for depicted items
vanshikaarora Aug 15, 2019
758928e
adding localised search for parent and child items
vanshikaarora Aug 15, 2019
47aad06
clicking on any child class or parent class should call the correspon…
vanshikaarora Aug 15, 2019
7cc08b7
fixed issue of showing wrong thumbnail for P18 item
vanshikaarora Aug 15, 2019
2ec7823
fixed issue #3132
vanshikaarora Aug 16, 2019
d8fc744
added test for DepictedImagesPresenter.java
vanshikaarora Aug 17, 2019
b01e769
added unit tests for depicted items parent and child classes
vanshikaarora Aug 17, 2019
1d82963
removed unused imports and code formatting
vanshikaarora Aug 17, 2019
a78f5aa
fixed issue in search test
vanshikaarora Aug 17, 2019
f0c2e2c
deleting unnecessary .attach_pid9313 file
vanshikaarora Aug 17, 2019
dc59f60
deleting unnecessary .attach_pid9655 file
vanshikaarora Aug 17, 2019
8836ae2
added SearchDepictionsPresenterTest
vanshikaarora Aug 17, 2019
77b1478
Merge branch 'upload_caption_depict' of https://github.com/vanshikaar…
vanshikaarora Aug 17, 2019
909cd4e
changes after review comments
vanshikaarora Aug 17, 2019
e400285
updates for review comments
vanshikaarora Aug 19, 2019
4bf86c3
added more documentations
vanshikaarora Aug 19, 2019
6bee22a
removed unused code and classes and addressed spacing changes
vanshikaarora Aug 19, 2019
3da6530
changes after review
vanshikaarora Aug 19, 2019
555c740
fixed build issues in the app
vanshikaarora Aug 20, 2019
74de3ff
worked on some review comments
vanshikaarora Aug 21, 2019
d267006
fixed issue:wrong thumbnail appears on wikidata item
vanshikaarora Aug 22, 2019
954e020
minor change
vanshikaarora Aug 22, 2019
05e7d85
worked on some review changes
vanshikaarora Aug 23, 2019
4645d0b
worked on review comments
vanshikaarora Aug 24, 2019
5db6140
minor change
vanshikaarora Aug 24, 2019
c082cb0
addressed remaining review comments
vanshikaarora Aug 24, 2019
5ddea4a
replaced hardcoded jpgs with pageIds to fetch captions
vanshikaarora Aug 25, 2019
c75222e
added documentation
vanshikaarora Aug 25, 2019
3a2c96b
removed hardcoded extensions and worked on review comments
vanshikaarora Aug 26, 2019
73419bb
review comments
vanshikaarora Aug 27, 2019
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
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dependencies {
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
implementation 'com.karumi:dexter:5.0.0'
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"

kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"

// Logging
Expand Down Expand Up @@ -189,6 +190,7 @@ android {
buildConfigField "String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\""
buildConfigField "String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.org/w/api.php\""
buildConfigField "String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\""
buildConfigField "String", "WIKIDATA_URL", "\"https://www.wikidata.org\""
buildConfigField "String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\""
buildConfigField "String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns.json\""
buildConfigField "String", "IMAGE_URL_BASE", "\"https://upload.wikimedia.org/wikipedia/commons\""
Expand All @@ -204,6 +206,7 @@ android {
buildConfigField "String", "CONTRIBUTION_AUTHORITY", "\"fr.free.nrw.commons.contributions.contentprovider\""
buildConfigField "String", "MODIFICATION_AUTHORITY", "\"fr.free.nrw.commons.modifications.contentprovider\""
buildConfigField "String", "CATEGORY_AUTHORITY", "\"fr.free.nrw.commons.categories.contentprovider\""
buildConfigField "String", "DEPICTION_AUTHORITY", "\"fr.free.nrw.commons.depicts.contentprovider\""
buildConfigField "String", "RECENT_SEARCH_AUTHORITY", "\"fr.free.nrw.commons.explore.recentsearches.contentprovider\""
buildConfigField "String", "BOOKMARK_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.contentprovider\""
buildConfigField "String", "BOOKMARK_LOCATIONS_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.locations.contentprovider\""
Expand All @@ -221,6 +224,7 @@ android {
buildConfigField "String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\""
buildConfigField "String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.beta.wmflabs.org/w/api.php\""
buildConfigField "String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\""
buildConfigField "String", "WIKIDATA_URL", "\"https://www.wikidata.org\""
buildConfigField "String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\""
buildConfigField "String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns_beta_active.json\""
buildConfigField "String", "IMAGE_URL_BASE", "\"https://upload.beta.wmflabs.org/wikipedia/commons\""
Expand All @@ -236,6 +240,7 @@ android {
buildConfigField "String", "CONTRIBUTION_AUTHORITY", "\"fr.free.nrw.commons.beta.contributions.contentprovider\""
buildConfigField "String", "MODIFICATION_AUTHORITY", "\"fr.free.nrw.commons.beta.modifications.contentprovider\""
buildConfigField "String", "CATEGORY_AUTHORITY", "\"fr.free.nrw.commons.beta.categories.contentprovider\""
buildConfigField "String", "DEPICTION_AUTHORITY", "\"fr.free.nrw.commons.beta.depicts.contentprovider\""
buildConfigField "String", "RECENT_SEARCH_AUTHORITY", "\"fr.free.nrw.commons.beta.explore.recentsearches.contentprovider\""
buildConfigField "String", "BOOKMARK_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.contentprovider\""
buildConfigField "String", "BOOKMARK_LOCATIONS_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.locations.contentprovider\""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package fr.free.nrw.commons

import androidx.test.runner.AndroidJUnit4
import org.junit.Rule
import org.junit.runner.RunWith
import android.net.Uri
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.rule.ActivityTestRule
import fr.free.nrw.commons.upload.UploadActivity
import org.hamcrest.Matchers
import org.hamcrest.core.AllOf
import org.junit.Test

@RunWith(AndroidJUnit4::class)
class DepictionSearchTest {
@get:Rule
var activityRule = ActivityTestRule(UploadActivity::class.java)

@Test
fun TestForCaptionsAndDepictions() {
val imageUri = Uri.parse("file://mnt/sdcard/image.jpg")

// Build a result to return from the Camera app


// Stub out the File picker. When an intent is sent to the File picker, this tells
// Espresso to respond with the ActivityResult we just created

Espresso.onView(ViewMatchers.withId(R.id.caption_item_edit_text))
.perform(ViewActions.typeText("caption in english"))
Espresso.onView(ViewMatchers.withId(R.id.description_item_edit_text))
.perform(ViewActions.typeText("description in english"))
Espresso.onView(ViewMatchers.withId(R.id.spinner_description_languages))
.perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.spinner_description_languages)).perform(ViewActions.click());
Espresso.onData(AllOf.allOf(Matchers.anything("spinner text"))).atPosition(1).perform(ViewActions.click());
Espresso.onView(ViewMatchers.withId(R.id.caption_item_edit_text))
.perform(ViewActions.typeText("caption in some other language"))
Espresso.onView(ViewMatchers.withId(R.id.description_item_edit_text))
.perform(ViewActions.typeText("description in some other language"))
Espresso.onView(ViewMatchers.withId(R.id.btn_next))
.perform(ViewActions.click())
}
}
36 changes: 34 additions & 2 deletions app/src/androidTest/java/fr/free/nrw/commons/UploadActivityTest.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package fr.free.nrw.commons

import android.net.Uri
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.upload.UploadActivity
import fr.free.nrw.commons.upload.depicts.DepictsFragment
import org.hamcrest.Matchers
import org.hamcrest.core.AllOf
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand All @@ -12,8 +21,31 @@ class UploadActivityTest {
@get:Rule
var activityRule = ActivityTestRule(UploadActivity::class.java)

@Test
@Test
fun orientationChange() {
UITestHelper.changeOrientation(activityRule)
}
}

@Test
fun TestForCaptionsAndDepictions() {
val imageUri = Uri.parse("file://mnt/sdcard/image.jpg")

Espresso.onView(ViewMatchers.withId(R.id.caption_item_edit_text))
.perform(ViewActions.typeText("caption in english"))
Espresso.onView(ViewMatchers.withId(R.id.description_item_edit_text))
.perform(ViewActions.typeText("description in english"))
Espresso.onView(ViewMatchers.withId(R.id.spinner_description_languages))
.perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.spinner_description_languages)).perform(ViewActions.click());
Espresso.onData(AllOf.allOf(Matchers.anything("spinner text"))).atPosition(1).perform(ViewActions.click());
Espresso.onView(ViewMatchers.withId(R.id.caption_item_edit_text))
.perform(ViewActions.typeText("caption in some other language"))
Espresso.onView(ViewMatchers.withId(R.id.description_item_edit_text))
.perform(ViewActions.typeText("description in some other language"))
Espresso.onView(ViewMatchers.withId(R.id.btn_next))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test for captions and Depictions is in two files ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the base test mentioned here #3031. I thoought it should all be in a continuation that's why I have put it in a single class

.perform(ViewActions.click())
Intents.intended(IntentMatchers.hasComponent(DepictsFragment::class.java.name))
/*onView(withId(R.id.depicts_search))
.perform(ViewActions.typeText("bridge"))*/
}
}
17 changes: 17 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity" />

<activity
android:name=".depictions.Media.DepictedImagesFragment"
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity" />

<activity
android:name=".depictions.DepictionDetailsActivity"
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity" />

<activity
android:name=".explore.categories.ExploreActivity"
android:label="@string/title_activity_explore"
Expand Down Expand Up @@ -191,6 +201,13 @@
android:label="@string/provider_categories"
android:syncable="false" />

<provider
android:authorities="{applicationId}.depicts.contentprovider"
android:name=".upload.structure.depictions.DepictsContentProvider"
android:exported="false"
android:label="@string/provider_depictions"
android:syncable="false"/>

<provider
android:name=".explore.recentsearches.RecentSearchesContentProvider"
android:authorities="${applicationId}.explore.recentsearches.contentprovider"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/fr/free/nrw/commons/CommonsApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import fr.free.nrw.commons.logging.FileLoggingTree;
import fr.free.nrw.commons.logging.LogUtils;
import fr.free.nrw.commons.upload.FileUtils;
import fr.free.nrw.commons.upload.structure.depictions.DepictionDao;
import fr.free.nrw.commons.utils.ConfigUtils;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.internal.functions.Functions;
Expand Down Expand Up @@ -266,6 +267,7 @@ private void updateAllDatabases() {
SQLiteDatabase db = dbOpenHelper.getWritableDatabase();

CategoryDao.Table.onDelete(db);
DepictionDao.Table.onDelete(db);
ContributionDao.Table.onDelete(db);
BookmarkPicturesDao.Table.onDelete(db);
BookmarkLocationsDao.Table.onDelete(db);
Expand Down
Loading