jediwhale / fitsharp

Functional testing tools for .NET
http://fitsharp.github.io
Other
152 stars 73 forks source link

Documentation issue - .NET core #159

Closed McTristan closed 5 years ago

McTristan commented 5 years ago

We've been using fitsharp for quite a while on Windows with the classic .NET framework and now want to use it on other platforms like Linux, Mac OS, Docker etc. as well. However we can't get it working.

So far we have:

!define COMMAND_PATTERN {%m Runner.dll -c suite.config.xml %p}
!define TEST_RUNNER {dotnet}

We have also tried different paths to the Runner.dll (fitnesse-standalone.jar and Runner.dll+Fit.dll+Fitslim.dll are in the same directory) but we can't get any tests to run.

From the documentation it is also not clear which options to put and which options to not put into the suite.config.xml for .NET core.

Can anyone enlighten me?

If I run dotnet runner.dll -c suite.config.xml from the commandline I get:

fitSharp.Machine.Exception.MemberMissingException: Member 'configurationfile' with 1 parameter(s) not found for type 'System.AppDomainSetup'. at fitSharp.Machine.Model.TypedValue.ThrowExceptionIfNotValid() at fitSharp.Machine.Engine.ProcessorExtension.InvokeWithThrow[T](Processor1 processor, TypedValue instance, MemberName memberName, Tree1 parameters) at fitSharp.Machine.Application.SuiteConfiguration.LoadNode(String typeName, XmlNode methodNode) at fitSharp.Machine.Application.SuiteConfiguration.LoadXml(String configurationXml) at fitSharp.Machine.Application.ShellArguments.<>c__DisplayClass3_0.b__0(String value) at fitSharp.Machine.Application.ArgumentParser.InvokeArgumentHandler(String switch, String argumentValue) at fitSharp.Machine.Application.ArgumentParser.Parse(IList`1 commandLineArguments) at fitSharp.Machine.Application.ShellArguments.LoadMemory() at fitSharp.Machine.Application.Shell.Run()

which might indicate something is wrong with the config file.

The config file contains:

<suiteConfig>
  <Culture>
    <Name>de-DE</Name>
  </Culture>
  <System.AppDomainSetup>
    <ConfigurationFile>.\bin\Debug\netstandard2.0\IntegrationTest.dll.config</ConfigurationFile>
  </System.AppDomainSetup>
  <ApplicationUnderTest>
    <AddAssembly>.\bin\Debug\netstandard2.0\IntegrationTest.dll</AddAssembly>
    <AddNamespace>IntegrationTest</AddNamespace>
  </ApplicationUnderTest>
  <Settings>
    <Behavior>std</Behavior>
    <CodePage>65001</CodePage>
    <Runner>fitSharp.Slim.Service.Runner</Runner>
  </Settings>  
</suiteConfig>

I've tried also different paths here ...

jediwhale commented 5 years ago

.NET Core does not support AppDomainSetUp so you can't use

  <System.AppDomainSetup>
    <ConfigurationFile>.\bin\Debug\netstandard2.0\IntegrationTest.dll.config</ConfigurationFile>
  </System.AppDomainSetup>

The error message is misleading, I'll look at it.

McTristan commented 5 years ago

I get the same error when I simply remove the corresponding section completely...

McTristan commented 5 years ago

Ok it seems I got it working by using these settings:

!define TEST_SYSTEM {slim} !define slim.port {0} !define COMMAND_PATTERN {%m Runner.dll -c suite.config.xml} !define TEST_RUNNER {dotnet}

and these things in the suite.config.xml:

`

de-DE bin\Debug\netstandard2.0\IntegrationTest.dll IntegrationTest std 65001 fitSharp.Slim.Service.Runner

`

At least it calls now my custom functions in my IntegrationTest.dll - the rest is still to test.