예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 public TestRunner(BrowserProvider browserProvider, BrowserSetUp browserSetUp)
 {
     _browserProvider = browserProvider;
     _browserSetUp    = browserSetUp;
 }
예제 #5
0
 public BrowserProvider(BrowserSetUp browserSetUp)
 {
     _browserSetUp = browserSetUp;
 }
예제 #6
0
 public TestRunner(BrowserProvider browserProvider, BrowserSetUp browserSetUp)
 {
     _browserProvider = browserProvider;
     _browserSetUp = browserSetUp;
 }