Can anyone explain AndroidX.Test Framework and how it affects my unit/robolectric/espresso tests?












-3














I have go through Test Android Apps in Android document. Google introduced AndroidX testing, but I am still very of confused of its implications.



I am using MVVM Android architecture components with ViewModel, LiveData.



Which parts of the Android X Framework do I need to use?



View(Activity.Fragments) --> Espresso?



ViewModel(with LiveData) --> RoboElectric?



Model --> JUnit or RoboElectric?



Why is Google still confusing us with lot of libraries, why can't they move all Local test, Instrumentation test, and everything under the same Framework(Espresso)?










share|improve this question
























  • Well, AndroidX is designed to follow years of lessons learned while writing apps and testing, and I'd guess integrates with the rest of the ecosystem... Your question would have to be asked to the actual Android testing team, though
    – cricket_007
    Nov 21 at 5:27












  • Have you tried anything yet with testing? if faced any problems then probably you can share them and may get some good solutions.
    – RamIndani
    Nov 21 at 19:14
















-3














I have go through Test Android Apps in Android document. Google introduced AndroidX testing, but I am still very of confused of its implications.



I am using MVVM Android architecture components with ViewModel, LiveData.



Which parts of the Android X Framework do I need to use?



View(Activity.Fragments) --> Espresso?



ViewModel(with LiveData) --> RoboElectric?



Model --> JUnit or RoboElectric?



Why is Google still confusing us with lot of libraries, why can't they move all Local test, Instrumentation test, and everything under the same Framework(Espresso)?










share|improve this question
























  • Well, AndroidX is designed to follow years of lessons learned while writing apps and testing, and I'd guess integrates with the rest of the ecosystem... Your question would have to be asked to the actual Android testing team, though
    – cricket_007
    Nov 21 at 5:27












  • Have you tried anything yet with testing? if faced any problems then probably you can share them and may get some good solutions.
    – RamIndani
    Nov 21 at 19:14














-3












-3








-3







I have go through Test Android Apps in Android document. Google introduced AndroidX testing, but I am still very of confused of its implications.



I am using MVVM Android architecture components with ViewModel, LiveData.



Which parts of the Android X Framework do I need to use?



View(Activity.Fragments) --> Espresso?



ViewModel(with LiveData) --> RoboElectric?



Model --> JUnit or RoboElectric?



Why is Google still confusing us with lot of libraries, why can't they move all Local test, Instrumentation test, and everything under the same Framework(Espresso)?










share|improve this question















I have go through Test Android Apps in Android document. Google introduced AndroidX testing, but I am still very of confused of its implications.



I am using MVVM Android architecture components with ViewModel, LiveData.



Which parts of the Android X Framework do I need to use?



View(Activity.Fragments) --> Espresso?



ViewModel(with LiveData) --> RoboElectric?



Model --> JUnit or RoboElectric?



Why is Google still confusing us with lot of libraries, why can't they move all Local test, Instrumentation test, and everything under the same Framework(Espresso)?







android android-espresso android-testing androidx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 0:35









Mark Han

1539




1539










asked Nov 21 at 5:20









Ramprasad

2,6281553109




2,6281553109












  • Well, AndroidX is designed to follow years of lessons learned while writing apps and testing, and I'd guess integrates with the rest of the ecosystem... Your question would have to be asked to the actual Android testing team, though
    – cricket_007
    Nov 21 at 5:27












  • Have you tried anything yet with testing? if faced any problems then probably you can share them and may get some good solutions.
    – RamIndani
    Nov 21 at 19:14


















  • Well, AndroidX is designed to follow years of lessons learned while writing apps and testing, and I'd guess integrates with the rest of the ecosystem... Your question would have to be asked to the actual Android testing team, though
    – cricket_007
    Nov 21 at 5:27












  • Have you tried anything yet with testing? if faced any problems then probably you can share them and may get some good solutions.
    – RamIndani
    Nov 21 at 19:14
















Well, AndroidX is designed to follow years of lessons learned while writing apps and testing, and I'd guess integrates with the rest of the ecosystem... Your question would have to be asked to the actual Android testing team, though
– cricket_007
Nov 21 at 5:27






Well, AndroidX is designed to follow years of lessons learned while writing apps and testing, and I'd guess integrates with the rest of the ecosystem... Your question would have to be asked to the actual Android testing team, though
– cricket_007
Nov 21 at 5:27














Have you tried anything yet with testing? if faced any problems then probably you can share them and may get some good solutions.
– RamIndani
Nov 21 at 19:14




Have you tried anything yet with testing? if faced any problems then probably you can share them and may get some good solutions.
– RamIndani
Nov 21 at 19:14












1 Answer
1






active

oldest

votes


















3














The Google Testing team has made many improvements to their testing framework AndroidX.




Why Google still confusing with lot of libraries, why cant they move all Local test, Instrumentation test everything under same Framework(Espresso)?




With AndroidX Test, they are actually attempting to solve this!



First off, regular "Junit" unit Tests are unchanged. You should test your java code on the JVM the same way you were doing.



But now, with AndroidX, they have made the Robolectric 4.0 API the same as Espresso's so it is now possible to run your Espresso Tests as Robolectric tests. This means when developing locally, you can iterate more quickly because the Instrumentation Tests can run so much faster instead of having to run on emulators. It also makes it a lot easier to learn Robolectric, because you are able to use the same API as espresso.



When you get to the PR or CI phase, you can then submit those same tests that ran on Robolectric JVM to run on your CI on real devices using Espresso.



I suggested checking out Testing Rebooted (with AndroidX Test) (Android Dev Summit '18) for more context.



In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when



In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when. For clarity, you would want to run it as Robolectric when you are doing local development especially with TDD. When ready to submit a PR, you can then run the same test on CI with emulator or real device.



So, while AndroidX.test can be confusing, I suggest watching this video to get a bit more of a grasp on Google's intent with the framework.



Also, I agree they can be providing more examples and guidance on using the new Androidx.Test!






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405681%2fcan-anyone-explain-androidx-test-framework-and-how-it-affects-my-unit-robolectri%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The Google Testing team has made many improvements to their testing framework AndroidX.




    Why Google still confusing with lot of libraries, why cant they move all Local test, Instrumentation test everything under same Framework(Espresso)?




    With AndroidX Test, they are actually attempting to solve this!



    First off, regular "Junit" unit Tests are unchanged. You should test your java code on the JVM the same way you were doing.



    But now, with AndroidX, they have made the Robolectric 4.0 API the same as Espresso's so it is now possible to run your Espresso Tests as Robolectric tests. This means when developing locally, you can iterate more quickly because the Instrumentation Tests can run so much faster instead of having to run on emulators. It also makes it a lot easier to learn Robolectric, because you are able to use the same API as espresso.



    When you get to the PR or CI phase, you can then submit those same tests that ran on Robolectric JVM to run on your CI on real devices using Espresso.



    I suggested checking out Testing Rebooted (with AndroidX Test) (Android Dev Summit '18) for more context.



    In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when



    In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when. For clarity, you would want to run it as Robolectric when you are doing local development especially with TDD. When ready to submit a PR, you can then run the same test on CI with emulator or real device.



    So, while AndroidX.test can be confusing, I suggest watching this video to get a bit more of a grasp on Google's intent with the framework.



    Also, I agree they can be providing more examples and guidance on using the new Androidx.Test!






    share|improve this answer




























      3














      The Google Testing team has made many improvements to their testing framework AndroidX.




      Why Google still confusing with lot of libraries, why cant they move all Local test, Instrumentation test everything under same Framework(Espresso)?




      With AndroidX Test, they are actually attempting to solve this!



      First off, regular "Junit" unit Tests are unchanged. You should test your java code on the JVM the same way you were doing.



      But now, with AndroidX, they have made the Robolectric 4.0 API the same as Espresso's so it is now possible to run your Espresso Tests as Robolectric tests. This means when developing locally, you can iterate more quickly because the Instrumentation Tests can run so much faster instead of having to run on emulators. It also makes it a lot easier to learn Robolectric, because you are able to use the same API as espresso.



      When you get to the PR or CI phase, you can then submit those same tests that ran on Robolectric JVM to run on your CI on real devices using Espresso.



      I suggested checking out Testing Rebooted (with AndroidX Test) (Android Dev Summit '18) for more context.



      In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when



      In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when. For clarity, you would want to run it as Robolectric when you are doing local development especially with TDD. When ready to submit a PR, you can then run the same test on CI with emulator or real device.



      So, while AndroidX.test can be confusing, I suggest watching this video to get a bit more of a grasp on Google's intent with the framework.



      Also, I agree they can be providing more examples and guidance on using the new Androidx.Test!






      share|improve this answer


























        3












        3








        3






        The Google Testing team has made many improvements to their testing framework AndroidX.




        Why Google still confusing with lot of libraries, why cant they move all Local test, Instrumentation test everything under same Framework(Espresso)?




        With AndroidX Test, they are actually attempting to solve this!



        First off, regular "Junit" unit Tests are unchanged. You should test your java code on the JVM the same way you were doing.



        But now, with AndroidX, they have made the Robolectric 4.0 API the same as Espresso's so it is now possible to run your Espresso Tests as Robolectric tests. This means when developing locally, you can iterate more quickly because the Instrumentation Tests can run so much faster instead of having to run on emulators. It also makes it a lot easier to learn Robolectric, because you are able to use the same API as espresso.



        When you get to the PR or CI phase, you can then submit those same tests that ran on Robolectric JVM to run on your CI on real devices using Espresso.



        I suggested checking out Testing Rebooted (with AndroidX Test) (Android Dev Summit '18) for more context.



        In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when



        In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when. For clarity, you would want to run it as Robolectric when you are doing local development especially with TDD. When ready to submit a PR, you can then run the same test on CI with emulator or real device.



        So, while AndroidX.test can be confusing, I suggest watching this video to get a bit more of a grasp on Google's intent with the framework.



        Also, I agree they can be providing more examples and guidance on using the new Androidx.Test!






        share|improve this answer














        The Google Testing team has made many improvements to their testing framework AndroidX.




        Why Google still confusing with lot of libraries, why cant they move all Local test, Instrumentation test everything under same Framework(Espresso)?




        With AndroidX Test, they are actually attempting to solve this!



        First off, regular "Junit" unit Tests are unchanged. You should test your java code on the JVM the same way you were doing.



        But now, with AndroidX, they have made the Robolectric 4.0 API the same as Espresso's so it is now possible to run your Espresso Tests as Robolectric tests. This means when developing locally, you can iterate more quickly because the Instrumentation Tests can run so much faster instead of having to run on emulators. It also makes it a lot easier to learn Robolectric, because you are able to use the same API as espresso.



        When you get to the PR or CI phase, you can then submit those same tests that ran on Robolectric JVM to run on your CI on real devices using Espresso.



        I suggested checking out Testing Rebooted (with AndroidX Test) (Android Dev Summit '18) for more context.



        In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when



        In this picture, the failing UI and Unit tests would represent the same test but represented as Espresso/Robolectric Instrumentation Test depending on what you want to run and when. For clarity, you would want to run it as Robolectric when you are doing local development especially with TDD. When ready to submit a PR, you can then run the same test on CI with emulator or real device.



        So, while AndroidX.test can be confusing, I suggest watching this video to get a bit more of a grasp on Google's intent with the framework.



        Also, I agree they can be providing more examples and guidance on using the new Androidx.Test!







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 21 at 19:18

























        answered Nov 21 at 19:09









        Mark Han

        1539




        1539






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405681%2fcan-anyone-explain-androidx-test-framework-and-how-it-affects-my-unit-robolectri%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            TypeError: fit_transform() missing 1 required positional argument: 'X'