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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 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);
        }
예제 #5
0
        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)
     }
 }