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

[New arch] [Modularization] Tests and cleanup #2728

Merged

Conversation

davigonz
Copy link
Contributor

@davigonz davigonz changed the title [New arch] [Modularization] Tests and cleanup [New arch] [Modularization] Tests and cleanup [WIP Nov 18, 2019
@davigonz davigonz changed the title [New arch] [Modularization] Tests and cleanup [WIP [New arch] [Modularization] Tests and cleanup [WIP] Nov 18, 2019
@davigonz davigonz changed the base branch from master to new_arch/modularization November 18, 2019 10:10
@davigonz davigonz changed the title [New arch] [Modularization] Tests and cleanup [WIP] [New arch] [Modularization] Tests and cleanup Nov 28, 2019
@davigonz davigonz force-pushed the new_arch/modularization_tests_cleanup branch from 4d2e43b to 60a87d0 Compare November 29, 2019 08:43
@davigonz davigonz mentioned this pull request Nov 29, 2019
)
)

onView(withText("Sheldon")).check(matches(isDisplayed()))

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))))
...

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

Copy link
Contributor Author

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()))

Choose a reason for hiding this comment

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

the same as before

Copy link
Contributor Author

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")

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??

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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")

Choose a reason for hiding this comment

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

Typo: Joker 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

giphy

val calendar = GregorianCalendar()
calendar.timeInMillis = expirationDate

val formatter: DateFormat = SimpleDateFormat("MMM dd, yyyy")

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

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"

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

Copy link
Contributor Author

@davigonz davigonz Dec 4, 2019

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/build.gradle Outdated Show resolved Hide resolved
import com.owncloud.android.presentation.ui.sharing.fragments.ShareFragmentListener
import com.owncloud.android.testing.SingleFragmentActivity

class TestShareFileActivity : SingleFragmentActivity(), ShareFragmentListener {

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

@davigonz davigonz force-pushed the new_arch/modularization_tests_cleanup branch from dbc9e18 to 1e9168f Compare December 4, 2019 09:46
@davigonz davigonz merged commit a804306 into new_arch/modularization Dec 4, 2019
@delete-merged-branch delete-merged-branch bot deleted the new_arch/modularization_tests_cleanup branch December 4, 2019 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants