public static void AfterFeature() { ClassDriver.GetInstance().QuitDriver(); }
public static void BeforeFeature(FeatureInfo featureInfo) { ClassDriver.GetInstance().StartDriver(); }
public void FormControls() { PageFactory.InitElements(ClassDriver.GetInstance().Driver, this); }
public static void BeforeFeature(FeatureInfo featureInfo) { string typeBrowser = featureInfo.Title.Contains("-") ? featureInfo.Title.Split('-')[0] : null; ClassDriver.GetInstance().StartDriver(typeBrowser); }
public static void AfterStep() { string errorImage = ClassUtilities.PegarDataHora(); var stepType = ScenarioStepContext.Current.StepInfo.StepDefinitionType.ToString(); if (ScenarioContext.Current.ScenarioExecutionStatus.ToString() == "StepDefinitionPending") { if (stepType == "Given") { scenario.CreateNode <Given>(ScenarioStepContext.Current.StepInfo.Text).Skip("Step pendente"); } else if (stepType == "When") { scenario.CreateNode <When>(ScenarioStepContext.Current.StepInfo.Text).Skip("Step pendente"); } else if (stepType == "Then") { scenario.CreateNode <Then>(ScenarioStepContext.Current.StepInfo.Text).Skip("Step pendente"); } } else { if (ScenarioContext.Current.TestError == null) { if (stepType == "Given") { scenario.CreateNode <Given>(ScenarioStepContext.Current.StepInfo.Text); } else if (stepType == "When") { scenario.CreateNode <When>(ScenarioStepContext.Current.StepInfo.Text); } else if (stepType == "Then") { scenario.CreateNode <Then>(ScenarioStepContext.Current.StepInfo.Text); } else if (stepType == "And") { scenario.CreateNode <And>(ScenarioStepContext.Current.StepInfo.Text); } } else if (ScenarioContext.Current.TestError != null) { if (stepType == "Given") { scenario.CreateNode <Given>(ScenarioStepContext.Current.StepInfo.Text).Fail(ScenarioContext.Current.TestError.Message) .Fail("<br/>Screenshot <br/><br/>", MediaEntityBuilder.CreateScreenCaptureFromPath(GetScreenShot.Capture(ClassDriver.GetInstance().Driver, errorImage)).Build()); } else if (stepType == "When") { scenario.CreateNode <When>(ScenarioStepContext.Current.StepInfo.Text).Fail(ScenarioContext.Current.TestError.Message) .Fail("<br/>Screenshot <br/><br/>", MediaEntityBuilder.CreateScreenCaptureFromPath(GetScreenShot.Capture(ClassDriver.GetInstance().Driver, errorImage)).Build()); } else if (stepType == "Then") { scenario.CreateNode <Then>(ScenarioStepContext.Current.StepInfo.Text).Fail(ScenarioContext.Current.TestError.Message) .Fail("<br/>Screenshot <br/><br/>", MediaEntityBuilder.CreateScreenCaptureFromPath(GetScreenShot.Capture(ClassDriver.GetInstance().Driver, errorImage)).Build()); } } } }