Comments (6)
@sbaid , @codito On second thought from the connect request isn't this something we would want in the test platform?
from testfx.
from testfx.
I think this would be super useful. There are several API like Launcher.LaunchUriForResultsAsync that require ASTA thread access. It would great to be able to call these from a unit test project -- the URI handler for a UWP app provides a good "test contract" and essentially allows UI automation of a UWP app without any additional framework. But it requires that the caller be on the UI thread, which is currently very hard to do with MSTest.
from testfx.
@mtaron : Could that be addressed via the UITestMethodAttribute tracked by #22?
@codito : Can this be a configuration of the test platform? I'm saying so because of this comment in the connect request:
"
You can change this default behavior by adding the below key under of vstest.executionengine.x86.exe.config file located in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow
from testfx.
Yeah, UITestMethodAttribute would address this for UWP test apps, but I think being able to control which thread tests are executed on is generally useful. For example, accessing a DependencyProperty from a non-UI thread in a WPF app causes an exception.
This might a niche case, but I've been using a non-UWP test project to do performance test automation for a UWP app. In general, I find that UWP test apps are a lot harder to get running under CI, are missing a lot features like code coverage, are a lot slower, and sometime debugging them just stops working. To work around this, I've made a non-UWP test app that uses the Launcher APIs to drive a UWP app. It works pretty well! I could send you the details if you are interested. However, I am restricted to using Launcher.LaunchUriAsync (as opposed to the LaunchUriForResults), since I can't control which thread my test is running on. This reduces how much verification I can do in my tests since I don't get data back from the app about the result of the command. All that said, I bet mine is a pretty niche use case, but I saw that other customers were asking for this and wanted to add my support. :)
from testfx.
There is now an extension built on top of MSTestV2 that helps get this done: https://github.com/saikrishnav/testfxSTAext
The nuget package for the same is at : https://www.nuget.org/packages/MSTest.STAExtensions
from testfx.
Related Issues (20)
- Add global using of "Microsoft.VisualStudio.TestTools.UnitTesting" into SDK
- Remove IsPackable from the DemoMSTestSdk HOT 1
- Adding Init/Cleanup timeouts change the threading of these methods HOT 5
- AssertInstanceOf overloads with out parameter HOT 3
- Ability to reference SDK without the version HOT 6
- Open source MSTest source generator and Native AOT engine
- Warning "TestClass attribute defined on generic non-abstract class" cannot be disabled/ignored HOT 2
- CS1591 on SourceGeneratedTestingPlatformBuilderHook.g.cs HOT 1
- Package References are added improperly from the SDK
- UnauthorizedAccessException thrown as MSTest.Sdk tries to create TestResults in .NET installation directory HOT 2
- Test methods should not be empty HOT 1
- Avoid conditionals inside assertions HOT 1
- Public methods should be test methods
- Prefer Assert.Fail over always failing conditions HOT 1
- Add support for AssemblyInitialize/AssemblyCleanup HOT 1
- Add support for ClassInitialize/ClassCleanup HOT 1
- Add support for TestInitialize/TestCleanup HOT 1
- asserting Assert.ThrowsException and failing creates an exception where the message include the message and stacktrace in it
- Improve performance of ID generation HOT 2
- Improve algorithm for reflection HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testfx.