コード例 #1
0
        private void RunTest(object steps, out Notification notification)
        {
            var testSteps = (IEnumerable <Action <Browser> >)steps;

            try
            {
                foreach (var browser in _browserProvider.GetOpenOrNewBrowsers())
                {
                    try
                    {
                        foreach (var step in testSteps)
                        {
                            Do(step, browser);
                        }
                    }
                    catch (Exception exception)
                    {
                        notification = new Notification
                        {
                            Success     = false,
                            Message     = exception.Message,
                            BrowserType = browser.GetType().Name
                        };
                        CloseBrowserAfterTest();
                        _monitor.Set();
                        return;
                    }
                }
            }
            catch (Exception exception)
            {
                notification = new Notification
                {
                    Success = false,
                    Message = "While getting browser: " + exception.Message
                };
                _monitor.Set();
                return;
            }
            notification = new Notification
            {
                Success = true
            };
            CloseBrowserAfterTest();
            _monitor.Set();
        }
コード例 #2
0
        public void Do(Action <IWebDriver> action)
        {
            var browser = _browserProvider.GetOpenOrNewBrowsers().First();

            Do(action, browser);
        }