public IEnumerable<JSTest> RunTests(string jsFilePath, BrowserSetUp browserSetUp) { var filesBeingTested = new List<string> {"*.htm", "*.html"}.SelectMany( filter => Directory.EnumerateFiles(jsFilePath, filter, SearchOption.AllDirectories)); foreach (string fileBeingTested in filesBeingTested) { string url = fileBeingTested; var actions = UITestRunner.InitializeWorkFlowContainer( b => b.ElementsOfType<ListItem>() .Where(x => x.InnerHtml.StartsWith("<strong>")) .ForEach(x => GetJSTestSummary(x, url))); var list = new List<Action<Browser>> { (b => b.GoTo(url)), (b => b.WaitForComplete()), }; if (actions != null) { list.AddRange(actions); } var notification = new TestRunner(new BrowserProvider(browserSetUp), browserSetUp).PassesTest(list) ?? new Notification(); Assert.True(notification.Success, notification.ToString()); } return _jSTests; }
public static void InitializeBrowsers(Action<BrowserSetUp> action) { var browserSetUp = new BrowserSetUp(); if (action != null) { action(browserSetUp); } if (!browserSetUp.CloseBrowserAfterEachTest && String.IsNullOrEmpty(browserSetUp.BaseUrl)) { throw new ArgumentException("Base Url cannot be empty if you are not closing your browser after each test"); } _runner = new TestRunner(new BrowserProvider(browserSetUp), browserSetUp); }
public static void InitializeBrowsers(Action <BrowserSetUp> action) { var browserSetUp = new BrowserSetUp(); if (action != null) { action(browserSetUp); } if (!browserSetUp.CloseBrowserAfterEachTest && String.IsNullOrEmpty(browserSetUp.BaseUrl)) { throw new ArgumentException("Base Url cannot be empty if you are not closing your browser after each test"); } _runner = new TestRunner(new BrowserProvider(browserSetUp), browserSetUp); }
public TestRunner(BrowserProvider browserProvider, BrowserSetUp browserSetUp) { _browserProvider = browserProvider; _browserSetUp = browserSetUp; }
public BrowserProvider(BrowserSetUp browserSetUp) { _browserSetUp = browserSetUp; }