Please excuse me if this is the wrong place to ask this question as im new to the Mac expereince.
I understand that VS for Mac is a totally different beast to VS in windows, but im struggling to run my NUnit Web Driver tests within the mac version. We recently developed both iOS and Android Apps for our company, so purchaced a Mac for dev and testing purposes. However we also have a web driver project in C# that i've brought over to the Mac (thinking I can work from home on one machine). This is where my problems have arisen.
The NUnit 3 Test Adapter allows you to run NUnit 3 tests inside Visual Studio. This is a new adapter, based partly on the code of the original NUnit Test Adapter, but modified to work with NUnit 3. It is not possible to run NUnit 2.x tests using this adapter. Use the original adapter for that purpose. There have been several significant improvements to the test experience that range across Visual Studio and Visual Studio Team Services. These efforts involved frameworks and tooling for both.NET and C++, but all had a common goal: make testing with our developer tools a great experience.
The project loaded fine, all the packages were installed and I can write the test fine. The issue is running them. I can run a test from the Unit Test window fine. The test will pass or fail but then thats it. The option to run is then greyed out for all tests. It's like the programme is waiting for me to do something. The windows version simply lets you right click and Run, test passes, test fails, you stop test, right click run. Rinse and repeat.
I've look everywhere and am hoping this is a noob question that someone laughs at but ultimatly can solve for me.
Thanks in advance
Stu
Stu
Answers
-
Are you using any 3rd party libraries or NuGet packages? Some of those may not be compatible with the Xamarin.Mac Mobile framework. If that is the case, then your only choice is to use the .NET 4.5 framework.
-
USForum Administrator, Xamarin TeamXamuraiYou can determine what assemblies as assembly depends on using monopmonop --refs -r:
-
Thanks Guys.
I'll confirm dependency with monop.I'd like to confirm.
1.MyLib with Xamarn.Mac.Mobile can use 3rd party lib with Xamarin.Mac.Mobile
2. MyLib with Xamarn.Mac.Mobile can NOT use 3rd party lib with Xamarin.Mac.Net45.
3. MyLib with Xamarin.Mac.Net45 can use 3rd party lib with Xamarin.Mac.Net45
I understand these.
And, In these cases, MyLib can test by NUnit test project.Are these correct?- MyLib with Xmarin.Mac.Net45 can use 3rd party lib with Xamarin.Mac.Mobile.
I'm not sure about 4th case.
Best regards. - MyLib with Xmarin.Mac.Net45 can use 3rd party lib with Xamarin.Mac.Mobile.
-
See Target Framework in the Mac guides for a complete discussion.
-
USForum Administrator, Xamarin TeamXamuraiSo a XM project targeting XM 4.5 can actually use many 'desktop' assemblies, as long as they don't depend on assemblies that we don't provide (say System.Drawing). That is actually it's primary use case, for projects with dependencies that don't provide XM Mobile builds.
-
Hello. I read your comment.
I build NUnit framework with Xamarin.Mac.Mobile.
And reference it.
I was able to test on Xamarin Studio with NUnit.Thank you. -
Hi Satoshi,I believe I am also facing the same problem i.e. want to run tests on macOS that uses Xamarin.Mac.Would it possible to share the steps of how you built NUnit. I download the 3.5 release source code but not able to see how I should build it using Xamarin Studio as even the option to provide Xamarin.Mac Mobile in the project is not appearingRegards & thanks
Kapil -
USForum Administrator, Xamarin TeamXamuraiSo the reason you don't see 'Xamarin.Mac Mobile' at least is that that only appears for Xamarin.Mac Library projects, not any generic desktop library.As I've said before, you may want to look into guiunit, https://github.com/mono/guiunit. It is what Xamarin.Mac uses internally for all of our automated testing, and it compatible with nunit attributes and such..You can use guiunit in 'nunit' form: https://github.com/xamarin/mac-samples/tree/master/guiunit-example
or 'test application' form: https://github.com/xamarin/xamarin-macios/blob/master/tests/common/mac/MacTestMain.csdepending on if easy debugging or integration with existing scripts is more important.In general, this is an area that we know needs better built in support from Xamarin.Mac. -
Hi, Kapli
Here is a minimum sample of NUnit on Mac