Test events were not received in Android Studio after modifying coverage options - android-studio

I had no problems before running my tests, but then I clicked on edit configuration to hide Hilt classes from code coverage and suddenly tests stopped working and this message started appearing.
I have tried everything in the related questions, but none of them seem to talk about this problem with code coverage and tests stopping running after modifying configurations. I can run tests for each package separately but if I try to right click on my unit test folder and click on run, I get the message all the time.
I am not using any test plugin or anything, just the standard Android Studio tests with Mockk and Truth as frameworks.

Related

Android Studio Project is out of Date warning when running test with coverage

I keep getting this warning when running test with coverage.(Kotlin codebase)
Recompile will fail and this warning dialog will show again. However, the code coverage is available and updated. It's just really annoying to see the dialog every time I run the tests.
Does anyone know how to resolve this issue?

Xunit test does not run

I saw Xunit Unit Tests will not run that seems specific to VS 2017. I am having the same problem with VS 2019. I can try to run the test via the Test Explorer or run the tests by right clicking on the test. Either way the test never runs. I have tried Debug an setting a breakpoint at the first line of the test. The breakpoint never gets hit. Similaryly I have tried debugging the test from the Test Explorer. Even if I bypass debug and just run the test the result always shows as "Not Run". I am not sure why the test will not run. None of the steps for VS 2017 seem to make a difference for VS 2019. How can I get my test to run?
If you are compiling x64 there is an option to run tests with a specific platform in the test menu. Change selection from x86 to x64.

How can I follow Flutter UI Android Studio test execution on device?

I wrote a Flutter Widget plugin with user interface automated testing using Android Studio based on Flutter documentation.
Tests execute properly but are quite abstract to write without following what happens on the device UI. All I see is that the test executes properly and the duration. The device is plugged and works properly but shows nothing related to the tests.
Is there a way to execute the UI tests from Android Studio and follow the execution on the device UI to simplify the writing of UI tests?
I would like to avoid using a solution based on screenshots as it would not be convenient to have to continuously open an image to follow what is happening.
As explained in the Flutter documentation, there are 3 types of tests:
Unit
Widget
Integration
Integration testing is the one that allows following the test execution on a device or a simulator.

Invalid results file. result format of the file 'C:\vstsAgents\A6\_work\r1\a\TestResults\LODADE-20_09_30_50.trx' matches 'VSTest' results format

I'm setting azure pipeline release by selenium webdriver continous integration. I have added "Visual studio test platform installer" and "vstest- TestAssemblies" in release to get test result. But I'm getting this warning while "VStest-TestAsseblies run".
and after succesfull deployment I get this result in Test Tab
"No test runs are available for this build. Run tests and get rich
reports by using an appropriate built-in task such as the Visual
Studio Test task. Alternately, run tests using a runner of your choice
such as JUnit, xUnit, mocha, jest, pytest, rspec, etc. and use the
Publish Test Results task to get rich reports."
Even I have one test case which work fine on visual code locally.

WebTests in VS2012 not running

We use VS Ultimate for web tests and load tests, but since moving to VS 2012 from VS 2010, the web tests don't seem to run anymore. We used to be able to do ctrl-r ctrl-t to debug specific tests, but that doesn't work anymore. I then found out about the issue with running tests in context, so I just tried running all tests, but that didn't work either. VS2012 is acting like it doesn't see WebTest as real tests anymore.
Even when I try to view the tests in the test explorer, nothing shows up. I know my tests are correct because I can go back in to VS 2010, and everything still works like it should.
Is anyone else having this issue?
Visual Studio 2012 dropped the "Test View" window that we used to use to run tests in VS 2010. The new "Test Explorer" window only recognizes Unit Tests and Coded UI Tests, as you've discovered. This totally threw me off too.
To run web and load tests (besides the obvious but tedious method of actually opening them and clicking "Run" in the editor window) you have to select the tests you want to run in the Solution Explorer, then Load Test (menu) > Run > Selected Test. Or alternatively "All Tests in Solution".
You also have the option of running the individual Web Tests that are contained in any open Load Test. Right-click on the Test Mix node (in Scenario) or any of the tests in the Test Mix.
For completeness here is the authoritative source: http://msdn.microsoft.com/en-us/library/ms182541.aspx
By the way, here is another gotcha: although you still choose testsettings for a Load Test from the Load Test menu, you now set the testsettings for Web Test execution separately, under the Test menu:

Resources