private void StartFixture(HookBinding hook, string containerId) { if (hook.HookType.ToString().StartsWith("Before")) { allure.StartBeforeFixture(containerId, AllureHelper.NewId(), AllureHelper.GetFixtureResult(hook)); } else { allure.StartAfterFixture(containerId, AllureHelper.NewId(), AllureHelper.GetFixtureResult(hook)); } }
public override void SetUp() { TestResultId = Guid.NewGuid() + "_test"; TestContainerId = Guid.NewGuid() + "_tc"; _allure.StartTestContainer(RootContainerId, new TestResultContainer { uuid = TestContainerId }); _allure.StartBeforeFixture(TestContainerId, Guid.NewGuid().ToString(), new FixtureResult()); var step = new StepResult { name = "Starting browser", start = DateTimeOffset.Now.ToUnixTimeMilliseconds(), status = Status.passed }; var test = new TestResult { uuid = TestResultId, name = TestContext.CurrentContext.Test.Name, fullName = TestContext.CurrentContext.Test.FullName, descriptionHtml = $"<pre><code>{TestRunner.FeatureContext.FeatureInfo.Description}</pre></code>", labels = new List <Label> { Label.Thread(), Label.Host(), Label.TestMethod(TestContext.CurrentContext.Test.MethodName) } }; try { base.SetUp(); step.name = $"Starting {BrowserName}"; step.stage = Stage.finished; } catch (SpecFlowSeleniumException e) { step.status = Status.failed; step.statusDetails = PluginHelper.GetStatusDetails(e); step.stage = Stage.interrupted; test.status = Status.none; test.statusDetails = PluginHelper.GetStatusDetails(e); _allure.UpdateFixture(fixture => { fixture.status = Status.failed; }); Assert.Inconclusive(e.Message); } finally { test.parameters.AddRange(ParametersForBuild()); step.stop = DateTimeOffset.Now.ToUnixTimeMilliseconds(); _allure.StopFixture(result => { result.stage = Stage.finished; result.steps.Add(step); }); _allure.StartTestCase(TestContainerId, test); } }