Testing Navigation with Mockito & Espresso - Testing in Android - Part 13

Testing Navigation with Mockito & Espresso - Testing in Android - Part 13

Philipp Lackner

3 года назад

22,773 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@nishaaggarwal7876
@nishaaggarwal7876 - 25.09.2023 12:20

@Phillipp Thanks for this awesome video.
But how are you able to test on backPressed from Fragment2 in isolation with Fragment1?

Ответить
@akashsaha8357
@akashsaha8357 - 28.12.2022 18:04

Everytime I am getting this error while testing navigation for ShoppingFragment.
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
Can anyone please help ???

Ответить
@muhammadsarimmehdi
@muhammadsarimmehdi - 09.12.2022 02:11

how would you use this with databinding?

Ответить
@thomasknee7844
@thomasknee7844 - 13.10.2022 14:31

Everytime I get stuck in my Android testing knowledge and I can't find what I'm looking for in the docs, I find a video by you and it helps answer most if not all of my questions, thank you, keep doing what you do :)

Ответить
@ardinalbts3330
@ardinalbts3330 - 29.06.2022 22:10

thank you sir.. great explanation

Ответить
@sheshusanju5315
@sheshusanju5315 - 18.10.2021 16:36

For me it's showing no injection was found in fragment how to inject dagger reference in Espresso tests?

Ответить
@mustafaammar551
@mustafaammar551 - 09.09.2021 03:23

Thank you Bro

Ответить
@Alchemist10241
@Alchemist10241 - 28.07.2021 12:02

I was looking for a way to test navigations for a long time and this video explains how to do it in a simplistic manner. Philipp YOU ARE THE BEST 😎. By the way to create a new test class from a class (or switch to an existing test class) just use CTRL + SHIFT + T shortcut key. Thanks a lot.

Ответить
@baselnat93
@baselnat93 - 25.07.2021 07:25

big thanks <3

Ответить
@mattgraves3709
@mattgraves3709 - 14.07.2021 14:41

Love it.
After this bit, I will be extremely comfortable with every aspect of modern professional Android development...
I mean shit I have been doing it since Eclipse in 2009, MVC. SQLiteOpenhelper, crashes, crashes, ANRs.... lol.
Things have come a long way, I can't wait to see how Compose goes!!!
(I put off testing for too long really was the issue why as a Sr developer I am just doing this, I love testing now though )

Ответить
@siavashparsa5046
@siavashparsa5046 - 12.06.2021 15:39

java.lang.AbstractMethodError: abstract method "java.util.List org.mockito.invocation.Invocation.getArgumentsAsMatchers()"
i got this error would you please help me to solve this?

Ответить
@manuelsiebeneicher4426
@manuelsiebeneicher4426 - 14.05.2021 15:34

I was wondering if it is possible to use TestNavHostController instead of the mocked NavHostController? To assert that the navigation was successful I can check TestNavHostController.currentDestination. What do you think of that?

Ответить
@homanhuang2054
@homanhuang2054 - 07.04.2021 20:18

Error: Mockito cannot mock this class: class androidx.navigation.NavController. I can't get it work with Mockito. I have to use TestNavHostController; ___ShoppingFragTest: launchFragmentInHiltContainer<S>{ setGraph+setViewNavController }; click(); assertThat (navController.currentDestination?.id). ___ Back press test: add launchFragmentInHiltContainer<A>{ setGraph+setViewNavController +navigate+popBackStack }; assertThat(current?.destination?.id. __ to_add_items_test: launchFragmentInHiltContainer <A> { setGraph+setViewNavController+navigate() } click; assertThat(navController.currentDestination?.id).___ blank_test_homework: goto video 14

Ответить
@akashdeepwadhwa5828
@akashdeepwadhwa5828 - 11.03.2021 12:49

thank you very much ... for tutorials learnt a lot from you .. i have question after finishing this series..which project from your website i should learn ..to atleast get the job ..

Ответить
@junecnol79
@junecnol79 - 09.03.2021 12:18

awesome tutorials. thank you again

Ответить
@dmytromarchuk3023
@dmytromarchuk3023 - 05.02.2021 00:52

thank you

Ответить
@dmytromarchuk3023
@dmytromarchuk3023 - 03.02.2021 21:09

Who is that man who is constantly putting a dislike on every video? :) It's gonna be your hater

Ответить
@IdaBagusTrisnaWidia
@IdaBagusTrisnaWidia - 28.01.2021 07:34

I tried but failed. Is that caused by using viewbinding? You're using syntetic which is going to be deprecated

Ответить
@ioannistzavaras6873
@ioannistzavaras6873 - 13.01.2021 02:31

Thank you so much, Philipp! Great job! Keep going!

Ответить
@chuka_obi5167
@chuka_obi5167 - 31.12.2020 02:14

Thanks for your video Phillip! I learnt a lot from it. How do you test navigation if you have nav args? Would anyvalue work in the navdirections action?

Ответить
@foivosstamopoulos9709
@foivosstamopoulos9709 - 01.12.2020 15:21

Great tutor!! Thank you!!

Ответить
@quangtruongpham4057
@quangtruongpham4057 - 20.10.2020 06:56

your tutorial is very helpful . Nice

Ответить
@panspost609
@panspost609 - 02.10.2020 16:41

since the android studio has the espresso recorder, why not use that recorder to do all those tests automatically?

Ответить
@tochukwuokey-munonye7884
@tochukwuokey-munonye7884 - 01.10.2020 11:41

I did the first test but the test for empty curImageUrl is difficult. Someone please help me

Ответить
@tochukwuokey-munonye7884
@tochukwuokey-munonye7884 - 01.10.2020 11:41

I did the first test but the test for empty curImageUrl is difficult. Someone please help me

Ответить
@hellosagar
@hellosagar - 27.09.2020 14:38

Awesome Video

Ответить
@antoniokomangyudistira4150
@antoniokomangyudistira4150 - 07.09.2020 16:05

Second

Ответить
@bhavyasharma3500
@bhavyasharma3500 - 07.09.2020 16:04

Thanks man

Ответить