public CommonSteps(ScenarioContext scenarioContext)
        {
            if (scenarioContext == null)
            {
                throw new ArgumentNullException("scenarioContext");
            }

            this.scenarioContext = scenarioContext;

            this.driverContext = this.scenarioContext["DriverContext"] as DriverContext;
        }
Example #2
0
        /// <summary>
        /// Verify group of assets
        /// </summary>
        /// <param name="driverContext">Container for driver</param>
        /// <param name="enableScreenShot">Enable screenshot</param>
        /// <param name="enableSavePageSource">Enable save page source</param>
        /// <param name="myAsserts">Group asserts</param>
        /// <example>How to use it: <code>
        /// Verify.That(
        ///     this.DriverContext,
        ///     true,
        ///     false,
        ///     () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)),
        ///     () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword));
        /// </code></example>
        public static void That(DriverContext driverContext, bool enableScreenShot, bool enableSavePageSource, params Action[] myAsserts)
        {
            foreach (var myAssert in myAsserts)
            {
                That(driverContext, myAssert, false, false);
            }

            if (!driverContext.VerifyMessages.Count.Equals(0) && enableScreenShot)
            {
                driverContext.TakeAndSaveScreenshot();
            }

            if (!driverContext.VerifyMessages.Count.Equals(0) && enableSavePageSource)
            {
                driverContext.SavePageSource(driverContext.TestTitle);
            }
        }
 public JavaScriptAlertsPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public SlowResourcesPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
Example #5
0
 /// <summary>
 /// Verify assert conditions
 /// </summary>
 /// <param name="driverContext">Container for driver</param>
 /// <param name="myAssert">Assert condition</param>
 /// <example>How to use it: <code>
 /// Verify.That(this.DriverContext, () => Assert.AreEqual(parameters["number"], links.CountLinks()));
 /// </code></example>
 public static void That(DriverContext driverContext, Action myAssert)
 {
     That(driverContext, myAssert, false, false);
 }
 public HttpCode200Page(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public FormAuthenticationPage(DriverContext driverContext)
     : base(driverContext)
 {
     Logger.Info("Waiting for page to open");
     this.Driver.IsElementPresent(this.pageHeader, BaseConfiguration.ShortTimeout);
 }
Example #8
0
 /// <summary>
 /// Save Page Source
 /// </summary>
 /// <param name="driverContext">
 /// Driver context includes
 /// </param>
 /// <returns>Path to the page source</returns>
 public string SavePageSource(DriverContext driverContext)
 {
     return(driverContext.SavePageSource(driverContext.TestTitle));
 }
Example #9
0
 /// <summary>
 /// Verify group of assets
 /// </summary>
 /// <param name="driverContext">Container for driver</param>
 /// <param name="myAsserts">Group asserts</param>
 /// <example>How to use it: <code>
 /// Verify.That(
 ///     this.DriverContext,
 ///     () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)),
 ///     () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword));
 /// </code></example>
 public static void That(DriverContext driverContext, params Action[] myAsserts)
 {
     That(driverContext, false, false, myAsserts);
 }
Example #10
0
 /// <summary>
 /// Verify assert conditions
 /// </summary>
 /// <param name="driverContext">Container for driver</param>
 /// <param name="myAssert">Assert condition</param>
 /// <example>How to use it: <code>
 /// Verify.That(this.DriverContext, () => Assert.AreEqual(parameters["number"], links.CountLinks()));
 /// </code></example>
 public static void That(DriverContext driverContext, Action myAssert)
 {
     That(driverContext, myAssert, false, false);
 }
 public DisappearingElementsPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
Example #12
0
        public static void That(DriverContext driverContext, Action myAssert, bool enableScreenShot, bool enableSavePageSource)
        {
            try
            {
                myAssert();
            }
            catch (Exception e)
            {
                if (enableScreenShot)
                {
                    driverContext.TakeAndSaveScreenshot();
                }

                if (enableSavePageSource)
                {
                    driverContext.SavePageSource(driverContext.TestTitle);
                }

                driverContext.VerifyMessages.Add(new ErrorDetail(null, DateTime.Now, e));

                Logger.Error(CultureInfo.CurrentCulture, "<VERIFY FAILS>\n{0}\n</VERIFY FAILS>", e);
            }
        }
Example #13
0
 /// <summary>
 /// Verify group of assets
 /// </summary>
 /// <param name="driverContext">Container for driver</param>
 /// <param name="myAsserts">Group asserts</param>
 /// <example>How to use it: <code>
 /// Verify.That(
 ///     this.DriverContext,
 ///     () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)),
 ///     () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword));
 /// </code></example>
 public static void That(DriverContext driverContext, params Action[] myAsserts)
 {
     That(driverContext, false, false, myAsserts);
 }
 public AbTestingPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public KendoComboBoxPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public StatusCodesPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public KendoDropDownListPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public UploadPage(DriverContext driverContext)
     : base(driverContext)
 {
     Logger.Info("Waiting for File Upload page to open");
     this.Driver.IsElementPresent(this.uploadPageHeader, BaseConfiguration.ShortTimeout);
 }
 public ProjectPageBase(DriverContext driverContext)
 {
     this.DriverContext = driverContext;
     this.Driver = driverContext.Driver;
 }
 public DynamicControlsPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public KendoTreeViewPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public InternetPage(DriverContext driverContext)
     : base(driverContext)
 {
 }
 public KendoGridPage(DriverContext driverContext)
     : base(driverContext)
 {
 }