-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[New arch] [Modularization] Tests and cleanup #2728
[New arch] [Modularization] Tests and cleanup #2728
Conversation
4d2e43b
to
60a87d0
Compare
...pp/src/androidTest/java/com/owncloud/android/sharing/sharees/ui/SearchShareesFragmentTest.kt
Show resolved
Hide resolved
) | ||
) | ||
|
||
onView(withText("Sheldon")).check(matches(isDisplayed())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use just once onView(withText("Sheldon")) if you do it
onView(withText("Sheldon"))
.check(matches(isDisplayed()))
.check(matches(hasSibling(withId(R.id.unshareButton))))
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the way, I think this is text is not good because you are repeating onView(withText("Sheldon")).check(matches(isDisplayed())) several times.
check out https://developer.android.com/training/testing/espresso/recipes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
) | ||
) | ||
|
||
onView(withText("Friends (group)")).check(matches(isDisplayed())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
val calendar = GregorianCalendar() | ||
calendar.timeInMillis = expirationDate | ||
|
||
val formatter: DateFormat = SimpleDateFormat("MMM dd, yyyy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, are you using this format for Spanish users??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we use dd mm yyyy for Spanish users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, running a device in Spanish, it will fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
) | ||
private var userSharesList = listOf( | ||
OC_SHARE.copy(sharedWithDisplayName = "Batman"), | ||
OC_SHARE.copy(sharedWithDisplayName = "Jocker") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Joker 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...loudApp/src/androidTest/java/com/owncloud/android/sharing/shares/ui/ShareFileFragmentTest.kt
Show resolved
Hide resolved
owncloudApp/src/androidTest/java/com/owncloud/android/utils/AppTestUtil.kt
Show resolved
Hide resolved
...main/java/com/owncloud/android/presentation/ui/sharing/fragments/EditPrivateShareFragment.kt
Show resolved
Hide resolved
...ain/java/com/owncloud/android/presentation/ui/sharing/fragments/PublicShareDialogFragment.kt
Outdated
Show resolved
Hide resolved
...pp/src/main/java/com/owncloud/android/presentation/ui/sharing/fragments/ShareFileFragment.kt
Outdated
Show resolved
Hide resolved
...main/java/com/owncloud/android/presentation/viewmodels/capabilities/OCCapabilityViewModel.kt
Outdated
Show resolved
Hide resolved
val calendar = GregorianCalendar() | ||
calendar.timeInMillis = expirationDate | ||
|
||
val formatter: DateFormat = SimpleDateFormat("MMM dd, yyyy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, running a device in Spanish, it will fail
owncloudTestUtil/build.gradle
Outdated
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation project(':owncloudDomain') | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" | ||
implementation "androidx.lifecycle:lifecycle-livedata:2.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use the global livedata version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tried it with 2.1.0
but it triggered a mess of dependencies. Anyway, I've moved 2.0.0
version to the root build.gradle file
owncloudTestUtil/src/main/java/com/owncloud/android/testutil/livedata/LiveDataUtils.kt
Show resolved
Hide resolved
owncloudData/src/androidTest/java/com/owncloud/android/data/MigrationTest.kt
Outdated
Show resolved
Hide resolved
...p/src/test/java/com/owncloud/android/presentation/viewmodels/sharing/OCShareViewModelTest.kt
Outdated
Show resolved
Hide resolved
...p/src/test/java/com/owncloud/android/presentation/viewmodels/sharing/OCShareViewModelTest.kt
Outdated
Show resolved
Hide resolved
...p/src/test/java/com/owncloud/android/presentation/viewmodels/sharing/OCShareViewModelTest.kt
Outdated
Show resolved
Hide resolved
...pp/src/main/java/com/owncloud/android/presentation/ui/sharing/fragments/ShareFileFragment.kt
Outdated
Show resolved
Hide resolved
import com.owncloud.android.presentation.ui.sharing.fragments.ShareFragmentListener | ||
import com.owncloud.android.testing.SingleFragmentActivity | ||
|
||
class TestShareFileActivity : SingleFragmentActivity(), ShareFragmentListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't find my previous comment. If you had a dependency with an activity, it would be great to have an interface ActivityProvider and be able to mock it. But now it is done in that way hehe
dbc9e18
to
1e9168f
Compare
Implements #2701
Needs owncloud/android-library#282