简体   繁体   中英

specflow+ example test on mac os (x64)

I am running specflow+ example test from here on mac catalina( x64) using Visual Studio for mac but I get this error

ExecutionThreadApartmentState option not supported for framework: .NETCoreApp,Version=v3.1.

Since apartmentState property is not supported on mac as mentioned here

I tried by removing apartmentState from <execution> element and also tried removing the whole <execution> element from Default.srprofile but still get same error in test results output. (test just keeps on running. Upon cancelling shows error in test output)

Tried x64 in platform settings in build but I get below when try to run test

Test run will use DLL(s) built for framework .NETCoreApp,Version=v3.1 and platform X86. Following DLL(s) do not match framework/platform settings. TestApplication.UiTests.dll is built for Framework .NETCoreApp,Version=v3.1 and Platform X64.

Is it that the example tests mentioned above can not be run on mac os (x64)? or am I missing some other thing?

EDIT I installed and targeted .net core 3.0 and the still get

ExecutionThreadApartmentState option not supported for framework: .NETCoreApp,Version=v3.0.

EDIT2 The error I see in the logs is below. I think the above error about ExecutionThreadApartmentState may be just a warning because I still see it in test output

2020-04-29T13:55:54.5764790-04:00:Executing test executor at '/usr/bin/dotnet' 'exec "/Users/../Desktop/../projects/specflow/SpecFlow.Plus.Examples-master/SeleniumWebTest/TestApplication.UiTests/bin/Debug/netcoreapp3.0/SpecFlowPlusRunner/netcoreapp3.0/TechTalk.SpecRun.Framework.Executor.anycpu.netcoreapp3_0.dll" --remoteRunnerPid 37116 --uniqueId "2020-04-29T135554" --outputFolder "/Users/../Desktop/../projects/specflow/SpecFlow.Plus.Examples-master/SeleniumWebTest/TestApplication.UiTests/obj/TestResults" --callbackPort 32770 --loggerPort 32771' in '/Users/../Desktop/../projects/specflow/SpecFlow.Plus.Examples-master/SeleniumWebTest/TestApplication.UiTests/bin/Debug/netcoreapp3.0'
2020-04-29T13:55:54.6057600-04:00:System.ComponentModel.Win32Exception (2): No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at TechTalk.SpecRun.Framework.Execution.OutOfProc.OutProcExecutorManager.StartProcess(ExecutorProcessInfo executorProcessInfo)
   at TechTalk.SpecRun.VisualStudio.TestAdapter.VsOutProcExecutorManager.StartProcess(ExecutorProcessInfo executorProcessInfo)
   at TechTalk.SpecRun.Framework.Execution.OutOfProc.StreamJsonRPC.OutOfProcessTestAssemblyExecutorHost.Initialize(Int32 threadId, ITestExecutionManager executionManager, IAssemblyReference testAssembly, ITestLogger currentLogger, String testAssemblyFullPath, String testAssemblyConfigFilePath, TestExecutionConfiguration testExecutionConfiguration, String target) 

I'm no expert, not yet;) but I got this error too. and I found that it happened because a Class variable I declared in the Test - in its constructor there was a call to a method of an object stored in a field of the class with I/O from the Console. when I removed the call from the constructor the tests (unit test) could run ok again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM