Esempio n. 1
0
 public ResultTracker(AssertLevel assertLevel, SeleniumLogger logger)
 {
     _assertLevel = assertLevel;
     _logger      = logger;
     _hasFailed   = false;
     _hasPassed   = false;
 }
Esempio 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);
        }
Esempio n. 3
0
 public SeleniumVerify(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }
Esempio n. 4
0
 public SeleniumInteract(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }
Esempio n. 5
0
 public SeleniumNavigate(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }
Esempio n. 6
0
 public SeleniumFind(IWebDriver driver, SeleniumLogger logger)
 {
     _driver = driver;
     _logger = logger;
 }