Forum Discussion
Thanks Alex,
I know whats happening, when we add a TestLeft to our project it creates TestFixtureBase with NUnit hook attributes ([OneTimeSetUp], [OneTimeTearDown] ..etc) methods
[OneTimeSetUp]
public void InitializeFixture()
{
_driver.Log.OpenFolder(TestContext.CurrentContext.Test.FullName);
}
[OneTimeTearDown]
public void FinalizeFixture()
{
_driver.Log.CloseFolder();
_driver.Log.Save(TestContext.CurrentContext.TestDirectory + @"\TestResults", Log.Format.Html);
}
[SetUp]
public void TestSetUp()
{
_driver.Log.OpenFolder(TestContext.CurrentContext.Test.Name);
}
[TearDown]....
When running the NUnit tests, the logging and saving logs, works fine. But when we add SpecFlow on top of this, then these methods with NUnit hook attribute won't get run as SpecFlow has its own hook attributes [BeforeScenario], [BeforeTestRun], [AfterScenario]... etc.
So we would need to replace [OneTimeSetUp] to [BeforeTestRun] and [OneTimeTearDown] to [AfterTestRun] and make the binding methods static and add "[Binding]" on top of the class signature
Related Content
- 2 years ago
- 4 days ago
- 12 years ago
- 5 years ago
Recent Discussions
- 2 months ago
How to compare images?
Solved2 years ago- 5 months ago
- 10 months ago