What causes UI tests to run without getting a pass or fail?

When I run by UI tests I'm not getting any kind of useful error or output message as far as I can see. The output window for Tests gives me this:

[10/4/2018 10:34:56 AM Informational] ------ Run test started ------
[10/4/2018 10:34:57 AM Informational] ========== Run test finished: 0 run (0:00:00.4131011) ==========

Using Visual Studio 15.8.5, Xamarin 4.11.0.776

Tagged:

Best Answers

  • jmaurierjmaurier ✭✭
    edited October 2018 Accepted Answer

    Thanks guys!

    Tip: Turning on the Diagnostic logging is super useful and helped me notice this:

    If you know of a better way around this other than turning off this setting please let me know how to point to the correct adapter without having to turn this off.

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    @jmaurier - It would appear that the tests are not being found by the test runner.

    Does your build configuration build the project(s) containing the tests?
    How are you identifying tests, test fixtures/classes?
    Could you be confusing two different test runners (if I right-click on a source file containing tests, the popup menu contains both "Run Test(s)" and "Run Unit Tests")?

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @jmaurier What you see in the Test Explorer flyout? That should show which tests have passed or not, provided you have set the required attributes to the test methods as mentioned by @JohnHardman .

  • jmaurierjmaurier Member ✭✭

    Hi @JohnHaraldien and @ShantimohanElchuri!

    (Added screenshots but I'm "not allowed to post links until I've been around a little longer" sorry.)
    As you can see my unit tests are running correctly through the UnitTests.Runner. However the UITests just "run", go unchecked, and I always get the same output

    [10/4/2018 10:34:56 AM Informational] ------ Run test started ------
    [10/4/2018 10:34:57 AM Informational] ========== Run test finished: 0 run (0:00:00.4131011) ==========
    

    For the sake of adding information:
    My Forms.UITests project references NUnit, NUnitTestAdapter, and Xamarin.UITest

    Code:

        [TestFixture(Platform.Android)]
        [TestFixture(Platform.iOS)]
        public class Tests
        {
            IApp app;
            Platform platform;
            UITestHelper helper; 
    
            public Tests(Platform platform)
            {
                this.platform = platform;
                helper = new UITestHelper(platform);
            }
    
            [SetUp]
            public void BeforeEachTest()
            {
                app = AppInitializer.StartApp(platform);
            }
    
            [Test]
            public void TapHamburgerMenu()
            {
                helper.Login(app);
    ...
    

    Important note:
    The tests work in one of our developers environments but not for either me nor the other person I'm working with.

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @jmaurier Just describe what you are seeing in the TestExplorer if you can't post the images.

  • jmaurierjmaurier Member ✭✭

    When I run all the tests

    > Inform.Forms.UITests and everything under it keeps the exclamation point as though they did not run. The tests do finish with white, undimmed text.

    > Inform.Forms.UnitTests and everything under it keeps the exclamation and have dimmed text

    > Inform.Forms.UnitTests.Runner passes each test with check marks

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @JohnHardman said:
    @jmaurier

    If one person has the tests working and two don't...

    Has the person who has them working got the NUnit Test Adapter installed, and the other two don't (or have the wrong version installed)?

    Have you all got the same options checked in Tools/Options/Test/General?

    This is a good point. When I last checked at the end of last year, NUnit's latest version didn't work with XF. I can't check it now but I think the working version is 1.6 (correct me if I am wrong).

  • jmaurierjmaurier Member ✭✭
    edited October 2018 Accepted Answer

    Thanks guys!

    Tip: Turning on the Diagnostic logging is super useful and helped me notice this:

    If you know of a better way around this other than turning off this setting please let me know how to point to the correct adapter without having to turn this off.

Sign In or Register to comment.