Skip to content

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

Merged
davigonz merged 41 commits into
new_arch/modularizationfrom
new_arch/modularization_tests_cleanup
Dec 4, 2019
Merged

davigonz merged 41 commits into
new_arch/modularizationfrom
new_arch/modularization_tests_cleanup

Conversation

@davigonz

Copy link
Copy Markdown
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()))

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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
Copy Markdown
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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo: Joker 😉

Copy link
Copy Markdown
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")

Copy link
Copy Markdown

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

Comment thread 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"

Copy link
Copy Markdown

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

@davigonz davigonz Dec 4, 2019 •

Copy link
Copy Markdown
Contributor Author

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

Comment thread owncloudTestUtil/build.gradle Resolved
import com.owncloud.android.presentation.ui.sharing.fragments.ShareFragmentListener
import com.owncloud.android.testing.SingleFragmentActivity

class TestShareFileActivity : SingleFragmentActivity(), ShareFragmentListener {

Copy link
Copy Markdown

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