Ejemplo n.º 1
0
 public ResultTracker(AssertLevel assertLevel, SeleniumLogger logger)
 {
     _assertLevel = assertLevel;
     _logger      = logger;
     _hasFailed   = false;
     _hasPassed   = false;
 }
Ejemplo n.º 2
0
        public SeleniumDriver(Browser browser, string testName)
        {
            switch (browser)
            {
            case Browser.Chrome:
            {
                _driver = new ChromeDriver(ApplicationEnvironment.ApplicationBasePath);
                break;
            }

            case Browser.Firefox:
            {
                _driver = null;
                // Firefox temporary disabled as webdriver does not support specifying the path to the driver.
                throw new NotImplementedException("Firefox Driver not implemented as driver does not support .NetCore");
            }

            case Browser.InternetExplorer:
            {
                InternetExplorerOptions options = new InternetExplorerOptions()
                {
                    EnableNativeEvents = true,          // Required for Clicking, Dragging and Dropping to work.
                    RequireWindowFocus = true,          // Required for Clicking, Dragging and Dropping to work.
                    IgnoreZoomLevel    = true           // Required as ieDriver will otherwise only function at 100% zoom.
                };
                _driver = new InternetExplorerDriver(ApplicationEnvironment.ApplicationBasePath, options);
                break;
            }

            case Browser.PhantomJS:
            {
                _driver = new PhantomJSDriver(ApplicationEnvironment.ApplicationBasePath);
                break;
            }

            default:
            {
                _driver = null;
                throw new ArgumentOutOfRangeException($"No entry matching '{browser}' found in Enum 'Browser'");
            }
            }

            Log      = new SeleniumLogger(testName, NLog.LogLevel.Info, DateTime.Now, _driver);
            Navigate = new SeleniumNavigate(_driver, Log);
            Find     = new SeleniumFind(_driver, Log);
            Verify   = new SeleniumVerify(_driver, Log);
            Interact = new SeleniumInteract(_driver, Log);
        }
Ejemplo n.º 3
0
 public SeleniumVerify(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }
Ejemplo n.º 4
0
 public SeleniumInteract(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }
Ejemplo n.º 5
0
 public SeleniumNavigate(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }
Ejemplo n.º 6
0
 public SeleniumFind(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }