Giter Site home page Giter Site logo

Comments (5)

facusantillo avatar facusantillo commented on May 30, 2024

I found this in the Nunit Console Log:

System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List1.System.Collections.IList.get_Item(Int32 index)
at NUnit.Allure.Core.AllureNUnitHelper.<>c__DisplayClass21_2.b__2(TestResult x)
at Allure.Commons.AllureLifecycle.UpdateTestCase(String uuid, Action1 update) at Allure.Commons.AllureLifecycle.UpdateTestCase(Action1 update)
at NUnit.Allure.Core.AllureNUnitHelper.UpdateTestDataFromAttributes()
at NUnit.Allure.Core.AllureNUnitHelper.StopTestCase()
at NUnit.Allure.Core.AllureNUnitHelper.StopAll(Boolean isWrapedIntoStep)
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context) in C:\src\nunit\nunit\src\NUnitFramework\framework\Internal\Commands\BeforeAndAfterTestCommand.cs:line 73
at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork() in C:\src\nunit\nunit\src\NUnitFramework\framework\Internal\Execution\SimpleWorkItem.cs:line 59`

from allure-nunit.

unickq avatar unickq commented on May 30, 2024

Hi,

I’m sorry to hear that - the entire approach of allure getation changed a little bit 😕

Wrapper for Action methods should work everywhere between setup and teardown.

Can you please share an example of code or what/where exactly you are trying to create step

from allure-nunit.

facusantillo avatar facusantillo commented on May 30, 2024

We have a custom method in charge of starting the allureStep and stop it. The code is the following:

public string StartStep(string name)
{
var x = TestContext.CurrentContext.Result;
string uuid = Guid.NewGuid().ToString();
StepResult step = new StepResult()
{
name = name,
stage = Stage.finished,
status = Status.passed
};
AllureLifecycle.Instance.StartStep(uuid, step);
return uuid;
}

Then we call a custom method called StopStep() with the uuid of the step we started previously:

public void StopStep(string uuid)
{
AllureLifecycle.Instance.StopStep(uuid);
}

This was working just fine until the new version. The instance of the AllureLifecycle is throwing exceptions everywhere. We remove the custom methods and try the example you have in the project with the AllureNUnitHelper.WrapInStep() method.

The thing is when the test finishes in the Nunit console, it's throwing an exception.

I really need to fix this, otherwise i can't update to new version and stick in the previous one :(

from allure-nunit.

unickq avatar unickq commented on May 30, 2024

I see the code how you start and stop steps, but I don’t know where you call it. I mean I don’t understand where you use steps - before/after/in test.

@facusantillo can you provide more details? AllureNUnitHelper.WrapInStep does exactly the same your methods do. Are you trying to execute steps after Allure testcase stopped?

from allure-nunit.

unickq avatar unickq commented on May 30, 2024

@facusantillo , any updates?

from allure-nunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.