public void ExecuteTest(TestEnvInfo testEnv) { //driver = testEnv.Driver;//This is going to be there in code. //loggerInfo.Instance.Message("Description of Test............"); // Start Coding here. // Example:'\ // open website CaqLib.OpenURL("https://www.lampsplus.com/"); // click chandelier CaqLib.ClickElement(LocatorType.Id, "aChandeliers", "click on chandeliers"); // click traditional // Click specific one. // click add to cart. // Click to checkout now // CLick Edit order // Click remove // click contniue shoppping. // verify Traditional Chandeliers // loggerInfo.Instance.Message("End statement of Test.........."); }
static void Main(string[] args) { TestEnvInfo t = new TestEnvInfo(); AutomationLogging.className = t.testClassName; AutomationLogging.currentGuid = t.guid; CaqLib nav = new CaqLib(t); string browser = string.Empty; Program p = new Program(); List <ITestCaseDefinition> input = new List <ITestCaseDefinition>(); List <string> inputBrowser = new List <string>(); string pattern = @"(\w+)(:)(\w+)"; //ArgData argData = new ArgData(); List <ArgData> listOfArg = new List <ArgData>(); ITestCaseDefinition[] testcaseList = WDTF.TestCaseList.TEST_CASES; int m = 0; t.guid = string.Format("{0:GUIDyyyyMMddmmss}", DateTime.Now); if (args.Length == 0) { foreach (ITestCaseDefinition item in testcaseList) { input.Add(item); inputBrowser.Add(t.parentBrowser); } //Browser = t.parentBrowser; } else { foreach (string arg in args) { string validReg = Regex.Match(arg, pattern).Value; if (validReg != "") { foreach (ITestCaseDefinition item in testcaseList) { string namespace_tc = item.ToString(); string tc = namespace_tc.Substring(namespace_tc.LastIndexOf('.') + 1); //if (tc == arg) if (tc == validReg.Split(':')[0]) { input.Add(item); inputBrowser.Add(validReg.Split(':')[1]); } else { if (arg.ToLower() == "firefox") { browser = arg.ToLower(); } else if (arg.ToLower() == "googlechrome") { browser = arg.ToLower(); } else if (arg.ToLower() == "iexplore") { browser = arg.ToLower(); } else { browser = t.parentBrowser; } // loggerInfo.Instance.Message("Mismatched argument:"+arg); //TODO: handle non matching argument. } } } } } if (input.Count == 0) { foreach (ITestCaseDefinition item in testcaseList) { input.Add(item); inputBrowser.Add(t.parentBrowser); } } foreach (ITestCaseDefinition item in input) { t.parentBrowser = inputBrowser[m].ToLower(); m++; if (t.parentBrowser == "googlechrome" || t.parentBrowser == "firefox" || t.parentBrowser == "iexplore") { AutomationLogging.className = item.ToString(); t.testClassName = AutomationLogging.className; nav.SetupTest(t); item.ExecuteTest(t); nav.TeardownTest(t); } } if (t.sendResult) { CaqLib.SendEmailUsingGmail(); } }