public void WhenIFillTheVehicleDataDetailsAutomobile(Table AutomobileVehicledata) { var dataTableValues = AutomobileVehicledata.CreateInstance <DataTables>(); automobilePage.SetMake(dataTableValues.Make); automobilePage.SetDateOfManufacture(dataTableValues.DateOfManufacture); automobilePage.SetEnginePerformance(dataTableValues.EnginePerformance); automobilePage.SetNumberOfSeats(dataTableValues.NumberOfSeats); automobilePage.SetFuelType(dataTableValues.FuelType); automobilePage.SetListPrice(dataTableValues.ListPrice); automobilePage.SetLicensePlateNumber(dataTableValues.LicencePlateNumber); automobilePage.SetAnnualMileage(dataTableValues.AnualMilage); snapShot.TakeSnap(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); automobilePage.ClickNextButton(); }
public void WhenIFillTheInsuranceDataDetails(Table insuranceData) { var dataTableValues = insuranceData.CreateInstance <DataTables>(); isuranceData.SetFirstName(dataTableValues.FirstName); automobilePage.SetLastName(dataTableValues.LastName); automobilePage.SetDOB(dataTableValues.DOB); automobilePage.SetGenderMale(); automobilePage.SetStreetAdress(dataTableValues.StreetAddress); automobilePage.SetCountry(dataTableValues.Country); automobilePage.SetCity(dataTableValues.City); automobilePage.SetOccupation(dataTableValues.Occupation); automobilePage.SetHobbiesSkyDiving(); automobilePage.SetHobbiesSpeeding(); automobilePage.SetWebsite(dataTableValues.Website); automobilePage.SetZipCode(dataTableValues.ZipCode); snapShot.TakeSnap(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); automobilePage.ClickInsuranceDataNextButton(); }
public void AfterStep() { ScenarioBlock scenarioBlock = _scenarioContext.CurrentScenarioBlock; switch (scenarioBlock) { case ScenarioBlock.Given: if (_scenarioContext.TestError != null) { snapshot.TakeSnap(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); _scenario.CreateNode <Given>(_scenarioContext.StepContext.StepInfo.Text).Fail(_scenarioContext.TestError.Message + "\n" + _scenarioContext.TestError.StackTrace).AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } else { _scenario.CreateNode <Given>(_scenarioContext.StepContext.StepInfo.Text).Pass("Step is passed").AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } break; case ScenarioBlock.When: if (_scenarioContext.TestError != null) { string path = SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); snapshot.TakeSnap(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); _scenario.CreateNode <When>(_scenarioContext.StepContext.StepInfo.Text).Fail(_scenarioContext.TestError.Message + "\n" + _scenarioContext.TestError.StackTrace).AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } else { _scenario.CreateNode <When>(_scenarioContext.StepContext.StepInfo.Text).Pass("Step is Passed").AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } break; case ScenarioBlock.Then: if (_scenarioContext.TestError != null) { snapshot.TakeSnap(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); _scenario.CreateNode <Then>(_scenarioContext.StepContext.StepInfo.Text).Fail(_scenarioContext.TestError.Message + "\n" + _scenarioContext.TestError.StackTrace).AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } else { _scenario.CreateNode <Then>(_scenarioContext.StepContext.StepInfo.Text).Pass("Step is passed").AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } break; default: if (_scenarioContext.TestError != null) { _scenario.CreateNode <And>(_scenarioContext.StepContext.StepInfo.Text).Fail(_scenarioContext.TestError.Message + "\n" + _scenarioContext.TestError.StackTrace).AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } else { snapshot.TakeSnap(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "")); _scenario.CreateNode <And>(_scenarioContext.StepContext.StepInfo.Text).Pass("Step is passed").AddScreenCaptureFromPath(SnapShot.GetPath(_scenarioContext.StepContext.StepInfo.Text.Replace(" ", "") + ".jpeg")); } break; } }