/// <summary>
        /// Helper Method which scans all possible active drivers.
        /// </summary>
        private void GetActiveDriverReporter()
        {
            List <object> drivers = new List <object>
            {
                BaseDriver.GetInstance(),
                          GenericDriver.GetInstance(),
                AndroidDriver <AppiumWebElement> .GetInstance(),
                IOSDriver <AppiumWebElement> .GetInstance(),
            };

            foreach (var driver in drivers)
            {
                if (driver != null)
                {
                    if (driver is IWebDriver currentDriver)
                    {
                        this.Reporter = currentDriver.Report();
                    }
                    else
                    {
                        this.Reporter = ((GenericDriver)driver).Report();
                    }

                    return;
                }
            }

            // If driver is null, there is no active driver session
            throw new SdkException("No active driver instance found for reporting");
        }
Ejemplo n.º 2
0
 public void StartDriver()
 {
     this.driver = new GenericDriver(projectName: "CI - C#");
 }
Ejemplo n.º 3
0
        public static void ResultadoSucesso(string mensagemEsperada)
        {
            var results = new GenericDriver().Wait.Until(d => d.FindElement((By.CssSelector("strong"))));

            Assert.AreEqual(mensagemEsperada, results.Text);
        }
Ejemplo n.º 4
0
        public static void ResultadoEmailIncorreto(string mensagemEsperada2)
        {
            var results = new GenericDriver().Wait.Until(d => d.FindElement((By.CssSelector("p.help-block.text-danger > ul > li"))));

            Assert.AreEqual(mensagemEsperada2, results.Text);
        }
Ejemplo n.º 5
0
 public void StartDriver()
 {
     this.driver = new GenericDriver();
 }