Comments (7)
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.
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.
@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);
}
}
}
from allure-nunit.
@unickq great feature, however, when trying implement it I get the following error when entering the method with the [AllureStep] above it:
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.
@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.
@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.
Wow, thank you
from allure-nunit.
Related Issues (20)
- Attribute AllureDisplayIgnored doesn't work with ignoring testcases HOT 6
- Test name is created as a step and steps inside the tests are substeps HOT 5
- How to add a screenshot to each test step HOT 5
- If test contains await, then [AllureStep] failed with System.ArgumentNullException : Value cannot be null. (Parameter 'key') HOT 7
- Add support to Include test class name in the report HOT 1
- MaxLimit attribute doesn't logged in allure HOT 4
- "System.MissingMethodException" error appears after update NUnit from 3.13.0 to 3.13.1 version HOT 2
- Changing the version of an assembly reference is not allowed during debugging HOT 3
- Value cannot be null. (Parameter 'key') async Task HOT 1
- Could not install package 'NUnit.Allure 1.0.14' HOT 3
- Cannot find "AllureNUnit" attribute after update of from
- Cannot find "AllureNUnit" attribute after update of "NUnite.Allure" nuget package from 1.0.14 to 1.2.0 HOT 4
- NullReferenceException in AllureStepAspect.WrapStep when some of the arguments are null HOT 3
- Get test result id HOT 1
- How to enable adding Screen Diff HOT 7
- AspectInjector.targets error in Rider HOT 5
- Steps do not show in Setup HOT 1
- Edit and continue does not work due to usage of AspectInjector 2.6 HOT 2
- Archive repo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from allure-nunit.