-
Notifications
You must be signed in to change notification settings - Fork 11
/
ExampleSteps.cs
44 lines (38 loc) · 1.09 KB
/
ExampleSteps.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.Threading.Tasks;
using Allure.XUnit;
using Allure.Xunit.Attributes;
using Allure.Xunit.StepAttribute;
using Xunit;
namespace Allure.Xunit.StepExtensions.Examples
{
public class ExampleSteps : IAsyncLifetime
{
[AllureBefore("Initialization")]
public Task InitializeAsync()
{
Steps.Step("Nested", () => { });
return Task.CompletedTask;
}
[AllureXunit]
public async Task Test()
{
WriteHello(42, 4242, "secret");
await AddAttachment();
}
[AllureStep("Write Hello")]
private void WriteHello(int parameter, [Name("value")] int renameMe, [Skip] string password)
{
AllureMessageBus.TestOutputHelper.Value.WriteLine("Hello from Step");
}
[AllureStep("AddAttachment")]
private async Task AddAttachment()
{
await AllureAttachments.Text("large json", "{}");
}
[AllureAfter("Cleanup")]
public Task DisposeAsync()
{
return Task.CompletedTask;
}
}
}