Giter Site home page Giter Site logo

Comments (7)

unickq avatar unickq commented on May 30, 2024

Hi @IZaiarnyi

That won't work with [AllureStep]. But you can use

public BackgroundChecksSteps Login(string email, string pass)
{
    return AllureLifecycle.Instance.WrapInStep(() => { new LoginPage().login(email, pass); }, $"I login with email = {email} and  pass {pass} ");
}

from allure-nunit.

IZaiarnyi avatar IZaiarnyi commented on May 30, 2024

Thank you, for your response. This works, but the readability of code becomes worse( Probably, it makes sense to add this functionality into AllureStep attribute?

from allure-nunit.

unickq avatar unickq commented on May 30, 2024

@IZaiarnyi
added this feature in 1.0.9
parsing parameters values by indexes

namespace xxx
{
    [AllureNUnit]
    public class Tests
    {
        [Test]
        public void Test1()
        {
            StepSample("user", "pwd123");
        }

        [AllureStep("Login with user {0} and password {1}")]
        public void StepSample(string username, string password)
        {
            Console.WriteLine(username);
            Console.WriteLine(password);
        }
    }
}

image

from allure-nunit.

ProAntix avatar ProAntix commented on May 30, 2024

@unickq great feature, however, when trying implement it I get the following error when entering the method with the [AllureStep] above it:
image
Any idea how I can fix this?

Thanks.

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=NUnit.Allure.Steps
StackTrace:
at NUnit.Allure.Steps.AllureStepAspect.WrapStep(String name, MethodBase methodBase, Object[] arguments, Func`2 method)
at Fenergo.API.Tests.TestBase.__a$_around_CreateCobCase_100663395_w_0(Object[] )
at Fenergo.API.Tests.TestBase.CreateCobCase(String leName, String template, String formatValue, String leKey, String userKey)
at Fenergo.API.Tests.TestBase.d__80.MoveNext() in C:\git\Fenergo.API.Tests.2\Tests\TestBase.cs:line 760

from allure-nunit.

unickq avatar unickq commented on May 30, 2024

@ProAntix
Well, no idea. Such a complex async code 😃. It can be one of the dependencies, like allure-csharp, aspect, etc. Or my code, idk. I have never run async NUnit test with allure before.

But let's have a look.
Can you create a smaller example of the equal async code for me to debug?

from allure-nunit.

ProAntix avatar ProAntix commented on May 30, 2024

@unickq I'll try get that done tomorrow.

Where can I get a list of the full dependencies, don't think I've got all of those installed.

from allure-nunit.

IZaiarnyi avatar IZaiarnyi commented on May 30, 2024

Wow, thank you

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.