public QATestLauncher(Form1 form1) { var form = form1; string extension = Regex.Match(form.testSetup.fileName, "\\.[0-9a-z]+$").Value; //Structs.TestPlan testPlan; DataTable dataTable; switch (extension) { case ".xlsx": dataTable = XlsxReader.ReadExcellSheet(form.testSetup); break; case ".csv": dataTable = CsvReader.ReadCsv(form.testSetup); break; default: dataTable = CsvReader.ReadCsv(form.testSetup); break; } if (TestPlanFromDataTable.IsValid(dataTable)) { testPlan = TestPlanFromDataTable.GetTestPlan(dataTable); qATest = new QATest(testPlan, form1.testSetup); qATest.RunFinishedEvent += OnRunFinished; qATest.StepFinishedEvent += OnStepFinished; } }
public static Structs.TestPlan GetTestPlan(DataTable testPlanTable) { Structs.TestStep step; List <Structs.TestStep> testSteps = new List <Structs.TestStep>(); for (int i = 0; i < testPlanTable.Rows.Count; i++) { DataRow row = testPlanTable.Rows[i]; step = new Structs.TestStep((i + 1).ToString() + ") " + row.ItemArray[0].ToString(), row.ItemArray[1].ToString(), row.ItemArray[2].ToString(), row.ItemArray[3].ToString()); testSteps.Add(step); } Structs.TestPlan testPlan = new Structs.TestPlan(testSteps); return(testPlan); }
public static Structs.TestPlan GetTestPlan(DataTable testPlanTable) { Structs.TestStep step; List <Structs.TestStep> testSteps = new List <Structs.TestStep>(); for (int i = 0; i < testPlanTable.Rows.Count; i++) { DataRow row = testPlanTable.Rows[i]; //pominięcie komentarzy if ((row[0].ToString()[0] == '[') && (row[0].ToString()[row[0].ToString().Length - 1] == ']')) { Console.WriteLine("TestPlanFromDataTable.GetTestPlan(): removed comment \"" + row[0].ToString() + "\""); continue; } step = new Structs.TestStep("(" + (i + 1).ToString() + ") " + row.ItemArray[0].ToString(), row.ItemArray[1].ToString(), row.ItemArray[2].ToString(), row.ItemArray[3].ToString()); testSteps.Add(step); } Structs.TestPlan testPlan = new Structs.TestPlan(testSteps); return(testPlan); }
public QATest(Structs.TestPlan testPlan1, QATestSetup testSetup1) { testPlan = testPlan1;//new Structs.TestPlan(testPlan1.testSteps); testSetup = testSetup1; }
public QATest(QATestStuff testStuff1) { testPlan = testStuff1.testPlan; testStuff = testStuff1; }