lundi 22 décembre 2014

Shared Methods Between Selenium And SpecFlow

I have a test project that holds all the Selenium scenarios that I want to test and I want to add a SpecFlow project to this solution that obviously will use some of the WebDriver methods. I don't want to duplicate my code but the SpecFlow is not working well with the Selenium (for example Selenium is using the [TestInitialize] attribute which is not allowed in SpecFlow). What is the best way to combine the two?


I want to do the same steps as in "SomeTestMethod" but with SpecFlow.


This is an example of the project:



public class SeleniumBaseTest : BaseTest
{
[AssemblyInitialize]
public static void Initialize(TestContext testContext)
{
}

Public SomeMethod()
{
}
}
[TestClass]
public class SeleniumFeature : SeleniumBaseTest
{
[TestInitialize]
public void SeleInitialize()
{
}

[TestMethod]
public void SomeTestMethod()
{
}
}

Aucun commentaire:

Enregistrer un commentaire