Exemplo n.º 1
0
        public void Initialize(IDriverSession driverSession, string name)
        {
            DriverSession = driverSession ?? throw new ArgumentNullException(nameof(driverSession));
            Name          = name ?? throw new ArgumentNullException(nameof(name));

            Logger.Debug($"Initialize: Name={name}");
        }
Exemplo n.º 2
0
        public void SetupSeleniumTest()
        {
            DriverSession = Resolve <IDriverSession>();

            TestCaseReporter.Initialize(DriverSession, TestContext.TestName);

            NavigateToBaseUrl();
        }
Exemplo n.º 3
0
        public void Initialize(IDriverSession driverSession, string name)
        {
            if (_extentTest != null)
            {
                throw new InvalidOperationException($"The TestCaseReporter is already initialized. ");
            }

            Name          = name ?? throw new ArgumentNullException(nameof(name));
            DriverSession = driverSession ?? throw new ArgumentNullException(nameof(driverSession));

            _extentTest = ExtentTestRunReporter.ExtentReporter.CreateTest(name);
        }
Exemplo n.º 4
0
 private void ChooseDriverInstance(string browser)
 {
     if (Convert.ToBoolean(Utilities.GetRemoteFlag()) == false)
     {
         driverSession = DriverSessions.GetSessionType(browser);
         driver        = driverSession.GetDriver();
     }
     else
     {
         if (browser == "chrome")
         {
             var options = new ChromeOptions();
             options.PlatformName = Platform.CurrentPlatform.ToString();
             options.AcceptInsecureCertificates = true;
             //Marks the remote run of Chrome browsers to be headless
             options.AddArgument("--headless");
             options.AddArgument("--no-sandbox");
             //Sets resolution size for browser when headless
             options.AddArgument("window-size=1280,1024");
             driver = new RemoteWebDriver(new Uri("http://10.8.7.40:4444/wd/hub"), options.ToCapabilities(), TimeSpan.FromSeconds(600));
         }
         else if (browser == "firefox")
         {
             var options = new FirefoxOptions();
             options.PlatformName = Platform.CurrentPlatform.ToString();
             options.AcceptInsecureCertificates = true;
             options.AddArgument("--headless");
             driver = new RemoteWebDriver(new Uri("http://10.8.7.40:4444/wd/hub"), options.ToCapabilities(), TimeSpan.FromSeconds(600));
         }
         else if (browser == "ie")
         {
             var options = new InternetExplorerOptions();
             options.PlatformName = Platform.CurrentPlatform.ToString();
             options.AcceptInsecureCertificates = true;
             options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
             driver = new RemoteWebDriver(new Uri("http://10.8.7.40:4444/wd/hub"), options.ToCapabilities(), TimeSpan.FromSeconds(600));
         }
     }
 }
Exemplo n.º 5
0
 protected Navigator(IDriverSession driverSession)
 {
     DriverSession = driverSession;
 }
Exemplo n.º 6
0
 public GoTo(IDriverSession driverSession)
     : base(driverSession)
 {
 }
Exemplo n.º 7
0
 public void SetupTest()
 {
     inputParameters = MergeParameters.BuildParameters();
     driverSession   = DriverSessions.GetSessionType(inputParameters["browser"]);
     driver          = driverSession.GetDriver();
 }
Exemplo n.º 8
0
 public MoonpigSessionNavigatorGoTo(IDriverSession driverSession)
     : base(driverSession)
 {
 }
Exemplo n.º 9
0
 protected internal OnPage(IDriverSession driverSession)
     : base(driverSession)
 {
 }
 public MoonpigSession(IDriverSession driverSession)
     : base(driverSession)
 {
     OnPage = new MoonpigSessionNavigatorOnPage(driverSession);
     GoTo   = new MoonpigSessionNavigatorGoTo(driverSession);
 }
Exemplo n.º 11
0
 public Session(IDriverSession driverSession)
 {
     DriverSession = driverSession;
     OnPage        = new OnPage(driverSession);
     GoTo          = new GoTo(driverSession);
 }
Exemplo n.º 12
0
 public MoonpigSessionNavigatorOnPage(IDriverSession driverSession)
     : base(driverSession)
 {
 }