private static ShareSkill ReadFromExcel(string key) { ExcelDataReaderUtil.LoadWorsheet(PathUtil.GetCurrentPath($"{TestContext.Parameters["TestDataPath"]}Mars.xlsx"), "ShareSkill"); ExcelData data = ExcelDataReaderUtil.FetchRowUsingKey(key); return(ObjectFactory.CreateInstance <ShareSkill>(data)); }
private static Credentials ReadFromExcel(string key) { ExcelDataReaderUtil.LoadWorsheet(PathUtil.GetCurrentPath($"{TestContext.Parameters["TestDataPath"]}Mars.xlsx"), "Login"); var data = ExcelDataReaderUtil.FetchRowUsingKey(key); return(ObjectFactory.CreateInstance <Credentials>(data)); }
public SearchShareSkillSteps(ScenarioContext context, Driver driver, DataSetUpHelper helper) { _context = context; _driver = driver; _helper = helper; ExcelDataReaderUtil.LoadWorsheet(PathUtil.GetCurrentPath($"{TestConfig.TestDataPath}Mars.xlsx"), "ShareSkill"); }
public static void BeforeTestRun() { new FrameworkContext().Initialise(); ExcelDataReaderUtil.LoadWorsheet(PathUtil.GetCurrentPath($"{TestConfig.TestDataPath}Mars.xlsx"), "Login"); ExcelData loginData = ExcelDataReaderUtil.FetchRowUsingKey("TestUser"); Credentials = ObjectFactory.CreateInstance <Credentials>(loginData); }
public void BeforeTestRun() { // init framework new FrameworkContext().Initialise(); /* * OneTimeSetUp methods run in the context of the TestFixture or SetUpFixture, which is separate from the context of any individual test cases. I */ ExcelDataReaderUtil.LoadWorsheet(PathUtil.GetCurrentPath($"{TestConfig.TestDataPath}Mars.xlsx"), "Login"); ExcelData loginData = ExcelDataReaderUtil.FetchRowUsingKey("TestUser"); ValidCredentials = ObjectFactory.CreateInstance <Credentials>(loginData); }
private static void TryLoadingWorkSheetWithFeatureName(string featureName) { // Pre-emptively trying to load data for a particular feature // As long as there is worksheet that matches the name of the feature, // this will try and load it, if it doesn't exist then move on try { ExcelDataReaderUtil.LoadWorsheet(PathUtil.GetCurrentPath($"{TestConfig.TestDataPath}Mars.xlsx"), featureName); } catch (NullReferenceException) { // this means any data loading needs to occur in appropriate step definitions (or just elsewhere) } }