--
You received this message because you are subscribed to the Google Groups "SpecFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+unsubscribe@googlegroups.com.
it would be helpful to see the constructors of:
BHGBaseObjects.BHGBasePage
PhoenixAutomation.BHGLoanPreQualificationRequiredFieldsSteps
and to know if you have any [BeforeScenario] or [BeforeFeature] methods
- show quoted text -
namespace BHG.Test.MasterFramework.BHGBaseObjects
{
/// <summary>
/// BasePage abstract class that holds intitialization for all derived page objects.
/// </summary>
public abstract class BHGBasePage :BHGBase
{
/// <summary>
/// BasePage Constructor that initializes page elements for all child pages.
/// </summary>
protected BHGBasePage()
{
PageFactory.InitElements(DriverContext.Driver, this);
}
}
}
PhoenixAutomation.BHGLoanPreQualificationRequiredFieldsSteps
Is the step file for the specflow
namespace PhoenixAutomation
{
[Binding]
public class BHGLoanPreQualificationRequiredFieldsSteps : BHGBasePage
{
[Given(@"I have logged into Phoenix")]
public void GivenIHaveLoggedIntoPhoenix()
{
DriverContext.Driver.Navigate().GoToUrl(ConfigurationManager.AppSettings["seleniumBaseUrl"]);
// DriverContext.Driver.Navigate().GoToUrl("http://bhgdev/phoenix/#/login");
DriverContext.Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30));
DriverContext.Driver.Manage().Window.Maximize();
DriverWait.Wait = new WebDriverWait(DriverContext.Driver, TimeSpan.FromSeconds(30));
_CurrentPage = GetInstance<BHGLoginPage>();
_CurrentPage = _CurrentPage.As<BHGLoginPage>().LoginAs("******").WithPassword("******").LoginAndPressSubmit();
//Need to add login info or create login method??
}
In my Hook.cs File I have
Before testRun
[BeforeTestRun]
public static void BeforeTestRun()
{
var envVars = Environment.GetEnvironmentVariables();
if(envVars["test"].Equals("bvt"))
CreateTestRunBVT();
else if (envVars["test"].Equals("regression"))
CreateTestRunRegression();
else
throw new Exception("No matching categories!");
}
After
[AfterScenario()]
public void AfterScenario()
{
if (ScenarioContext.Current.TestError != null)
{
string fileNameBase = $"error_{ScenarioContext.Current.ScenarioInfo.Title.ToIdentifier()} {DateTime.Now.ToString("yyyyMMMMdd_HHmmss")}";
Screenshot file = ((ITakesScreenshot)DriverContext.Driver).GetScreenshot();
file.SaveAsFile(fileNameBase + "_screenshot.jpg", ImageFormat.Jpeg);
if (ScenarioContext.Current.ContainsKey("Name"))
MongoDBHelper.DeleteApplicationByFirstName(ScenarioContext.Current["Name"].ToString());
ClearBrowserCache();
DriverContext.Driver.Quit();
ReportTestResults();
}
else
{
if (ScenarioContext.Current.ContainsKey("MongoName"))
MongoDBHelper.DeleteApplicationByFirstName(ScenarioContext.Current["MongoName"].ToString());
ClearBrowserCache();
if (DriverContext.Driver != null)
DriverContext.Driver.Quit();
DriverWait.Wait = null;
ReportTestResults();
}
}
case "chrome": ChromeOptions options = new ChromeOptions(); options.AddArguments("--disable-extensions"); _webDriver = new ChromeDriver(Path.Combine(GetBasePath, @"Drivers\"), options); _wait = new WebDriverWait(_webDriver, TimeSpan.FromSeconds(10)); _webDriver.Manage().Window.Maximize(); break;--
You received this message because you are subscribed to the Google Groups "SpecFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+unsubscribe@googlegroups.com.