4

I wrote some tests with dotnet core 2. This tests drive some Selenium's browsers. I developed the first test in local (using dotnet core 2.0 and xunit) and it workes like a charm.

Then I moved the project into Azure DevOps pipeline and I get this error:

System.PlatformNotSupportedException : Operation is not supported on this platform.

The following constructor parameters did not have matching fixture data

It seemed like in local development (a simple VS Code editor) someone inject automatically a Fixture inside contructors like that:

public AConstructor(TestFixture tf)
{
    this.tf = tf;
}

so I roughly rewrite it as:

public AConstructor(TestFixture tf)
{
    this.tf = new TestFixture();
}

but the problem is still there and I have no idea of what the problem is. In local development we setted up Selenium Grid with Docker, using the same version of the real grid. In Azure DevOps pipeline we reused the sample command used in local environment.

Any idea?

1
  • Is the pipeline setup to be Interactive? Commented Dec 18, 2018 at 15:26

2 Answers 2

0

When I do this I normally structure it like this:

public class TestClass
{
    protected TestFixture testFixture { get; set; }

    public TestClass(TestFixture testFixture)
    {
        this.testFixture = testFixture;
    }
}

This allows you to create a local instance for use with your code.

Try this and let me know if it works for you.

Sign up to request clarification or add additional context in comments.

2 Comments

Check out this question. stackoverflow.com/questions/39440942/… It may shed some light on it possibly.
0

Give the parameter a default value will fix it.

public AConstructor(TestFixture tf = null)
{
    this.tf = tf;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.