示例#1
0
        public void Read_MultiStepScenario_ShouldReturnAsScenarioList()
        {
            string          excelFile = @"../../TestData/TestData.xlsx";
            IScenarioReader reader    = new ExcelScenarioReader(excelFile);
            string          sheetName = "MultiStepScenario";
            //string scenarioName = "SampleScenario";

            var scenarios = reader.Read(sheetName);

            Assert.IsInstanceOfType(scenarios, typeof(IEnumerable <Scenario>));
        }
示例#2
0
        public void CreateVat_CreateValidVAT_ShouldPass(string url, string fileName, string sheetName)
        {
            Boolean bResult = false;
            //try
            //{

            IBrowserAutomator browser = new SeleniumBrowserAutomator(DriverType.CHROME, null, "", null);

            string          excelFile = @"../../TestData/PIRA_VAT.xlsx"; //string.Concat(@"../",fileName);
            IScenarioReader reader    = new ExcelScenarioReader(excelFile);


            var scenarios = reader.Read(sheetName);
            //scenarios = scenarios.Where(s => s.Name == scenarioName);

            AutomatedTestProcedure Add = new AutomatedTestProcedure(url, browser, scenarios);

            bResult = Add.BeginTesting();
            Assert.IsTrue(bResult);
        }
示例#3
0
        public void _Filter()
        {
            XmlDocument webXml = new XmlDocument();

            webXml.Load(@"../../Web.xml");
            String url = Convert.ToString(webXml.SelectSingleNode("param").InnerText);

            Boolean           bResult = false;
            IBrowserAutomator browser = new SeleniumBrowserAutomator(DriverType.CHROME, url, null, null);

            string          excelFile = @"../../TestData/TestActions.xlsx";
            IScenarioReader reader    = new ExcelScenarioReader(excelFile);
            string          sheetName = "Filter";

            var scenarios = reader.Read(sheetName);

            AutomatedTestProcedure Add = new AutomatedTestProcedure(url, browser, scenarios);

            bResult = Add.BeginTesting();
            Assert.IsTrue(bResult);
        }
示例#4
0
        public void executeTest(String url, String excelFile, String sheetName, string path, string finalSubPath)
        {
            Boolean bResult = false;

            string root = ConfigurationManager.AppSettings["Root_Path"];

            string finalPath = System.IO.Path.Combine(root, path);

            string subPath = System.IO.Path.Combine(finalPath, finalSubPath);

            string timeStamp = System.IO.Path.Combine(subPath, DateTime.Now.ToString("yyyy-MM-dd-HH"));

            IBrowserAutomator browser = new SeleniumBrowserAutomator(DriverType.CHROME, finalPath, subPath, timeStamp);

            IScenarioReader reader = new ExcelScenarioReader(excelFile);

            var scenarios = reader.Read(sheetName);

            AutomatedTestProcedure Add = new AutomatedTestProcedure(url, browser, scenarios);

            bResult = Add.BeginTesting();
            Assert.IsTrue(bResult);
        }