public void BuyOnlineGame() { try { #region TestData var _testCaseName = MethodBase.GetCurrentMethod().Name; var _worksheetName = GetType().Name; int x = 20; var _quntity = ExcelDataParser.GetValueOf(GameDetailsColumns.quantity, _testCaseName, _worksheetName); #endregion _test = _extent.CreateTest(TestContext.CurrentContext.Test.Name, "BuyOnlineGame"); _test.Log(Status.Info, "Konakart home page is loaded"); //Steps _homePage.ClickOnGamesBtn(); // _homePage.MoveRightSliderToSpecificPrice(x); _homePage.SelectLastGameIsListAndAddItToCart(); _homePage.HoverOnShoppingMenuItem(); if (!_homePage.VerifyGameIsAddedToShoppingBag()) { _test.Log(Status.Warning, "The item is not added to the shopping bag"); } _homePage.ClickOnLastGameInList(); if (!_gameDetailsPage.VerifyGameName()) { _test.Log(Status.Warning, "The name of the game in the details page isn't equal to the game in the home page"); } if (!_gameDetailsPage.VerifyTheGameHasFourDifferentScreenshots()) { _test.Log(Status.Warning, "The game doesn't have 4 different screenshots"); } _gameDetailsPage.SelectTwoItemsFromTheQuantityDdl(_quntity); _gameDetailsPage.ClickOnAddToCartBtn(); if (!_homePage.VerifyGameIsAddedToShoppingBag()) { _test.Log(Status.Warning, "The items are not added to the shopping bag"); } //if (_FindPage.GetVcRequestStatus().Equals(RequestStatus.VcSubmittedStatus)) //{ // _FindPage.OpenVcDetails(); // if (_FindPage.GetGsRequestStatus().Equals(RequestStatus.VcSubmittedStatus)) // { // _test.Pass(TestContext.CurrentContext.Test.Name + "is passed "); // Assert.IsTrue(true); // } //} //_MenuHeaderPage.Logout(); } catch (Exception e) { _test.Fail(TestContext.CurrentContext.Test.Name + " is failed "); _test.Log(Status.Fail, e.ToString()); Assert.Fail(e.ToString()); } }
}//end method ReadConfigs /// <summary> /// Initialize the test configurations /// </summary> public static void Init() { if (!IsTestConfigsInitialized) { string automationConf = PathOfCurrentContext + "automation.conf"; //Read the automated app configs ReadConfigs(automationConf); AutomatedLogger.Init(LogFile); AutomatedLogger.Log("Test that logging is working!"); AutomatedLogger.Log("WebPath: " + automationConf); //Initialize your configs: messages, test data, logger, ... ExcelDataParser.Init(TestConfigs.TestDataFile); //TODO: this should be json data object //data = JsonDataParser.ParseJsonData(TestConfigs.TestDataFile); //Initialize the report here //TestReport.Initialize(TestConfigs.ReportingDirectory); IsTestConfigsInitialized = true; } //endif } //end method
public void FillData(string sheetToGetDataFrom, string getDataFromRow) { address = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Address"); town = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Town"); surname = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Surname"); emailaddress = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "EmailAddress"); phoneNumber = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "PhoneNumber"); }
public void FillData(string sheetToGetDataFrom, string getDataFromRow) { dishOrder = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Dishes"); pizzaOrder = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Pizza"); drinkOrder = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Drinks"); mainDishDrink = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "MainDishDrink"); orderComment = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "OrderComment"); }
public void MapExcelResultToObjectIsSuccess() { ICollection <RowItem> outList = PrepareDataListFromExcelFile(filename).ToList(); var actName = "Conveyor assembly with sliderail and chain X45-X65-X85-XH-XK"; var firstItem = ExcelDataParser.RowsDataToWorkItemMapper(outList).First(); Assert.AreEqual(actName, firstItem.Name); }
}//end method public static string GetShortDummyText() { //Get the current method name and current class name string methodName = "ShortDummyText"; string sheetName = "Shared"; //Get the data from the excel sheet string text = ExcelDataParser.GetValueOf("Description", methodName, sheetName); return(text); } //end method
/// <summary> /// This functions gets text that exceeds max characters and creates a new protocol /// </summary> /// <returns></returns> public static string GetTextExceedingMaximumCharacters() { //Get the current method name and current class name string methodName = "TextArea_MaximumCharacters"; string sheetName = "Shared"; //Get the data from the excel sheet string text = ExcelDataParser.GetValueOf("Description", methodName, sheetName); return(text); }//end method
public void GetJsonObjectFromExcelFileIsSuccess() { try { var exp = ExcelDataParser.GetJsonFromExcelFile(filename); } catch (Exception ex) { Assert.Fail("Json Parsing Exception:", ex.Message); } }
public void Login() { LoginPage _LoginPage = new LoginPage(AutomatedBrowser.WebDriverInstance); //Prepare test data var _testCaseName = MethodBase.GetCurrentMethod().Name; var _worksheetName = "LoginTest"; var _username = ExcelDataParser.GetValueOf(LoginPageColumns._userName, _testCaseName, _worksheetName); var _password = ExcelDataParser.GetValueOf(LoginPageColumns._password, _testCaseName, _worksheetName); //Steps _LoginPage.Login(_username, _password); }
public void CreateWorkTypeObjectIsSuccess() { WorkType act = new WorkType { Name = "Conveyor assembly with sliderail and chain X45-X65-X85-XH-XK", UnitOfWorkTime = new MeasurementUnits(10, "m"), NeededQuantity = new MeasurementUnits(1, "cm"), WorkHours = new MeasurementUnits(0.1, "m") }; ICollection <RowItem> outList = PrepareDataListFromExcelFile(filename); WorkType exp = ExcelDataParser.ExcelDataToWorkTypeObjectMapper(outList.AsQueryable().First()); Assert.AreEqual(act.Name, exp.Name); }
}//end method ReadConfigs /// <summary> /// Initialize the test configurations /// </summary> public static void Init() { if (!IsTestConfigsInitialized) { //Read the automated app configs ReadConfigs(); //Initialize your configs: messages, test data, logger, ... ExcelDataParser.Init(TestConfigs.TestDataFile); AutomatedLogger.Init(LogFile); //Initialize the report here TestReport.Report_init(TestConfigs.ReportingDirectory); IsTestConfigsInitialized = true; } //endif } //end method
}//end method ReadConfigs /// <summary> /// Initialize the test configurations /// </summary> public static void Init() { if (!IsTestConfigsInitialized) { string configurationFile = AutomationDirectory + "\\automation.conf"; //Read the automated app configs ReadConfigs(configurationFile); //AutomatedLogger.Init(LogDirectory); //AutomatedLogger.Log("Automation Configuration file: " + configurationFile); //Initialize your configs: messages, test data, logger, ... ExcelDataParser.Init(TestConfigs.TestDataFile); //TODO: this should be json data object //data = JsonDataParser.ParseJsonData(TestConfigs.TestDataFile); IsTestConfigsInitialized = true; } //endif } //end method
} // this is the resturant or post code name public void FillData(string sheetToGetDataFrom, string getDataFromRow) { resturantName = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "ResturantName"); }
public void Init() { ExcelDataParser.Init(ConfigurationManager.AppSettings["AutomationDirectory"] + ConfigurationManager.AppSettings["TestDataFile"]); }
public void FillData(string sheetToGetDataFrom, string getDataFromRow) { emailAddress = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "EmailAddress"); password = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Password"); }
public void FillData(string sheetToGetDataFrom, string getDataFromRow) { recipient = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Recipient"); subject = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Subject"); body = ExcelDataParser.GetValueOf(sheetToGetDataFrom, getDataFromRow, "Body"); }
private ICollection <RowItem> PrepareDataListFromExcelFile(string fileName) { return(new List <RowItem>(ExcelDataParser.ParseDataToRowItemsFromExcelFile(filename))); }