private void SetPageObject(string PageName)
        {
            switch (PageName)
            {
            case "Strapi Data Dictionaries":
                _currentPage = StrapiDataDictionariesPage;
                break;

            case "Strapi Data Dictionary Entities":
                _currentPage = StrapiDataDictionaryEntitiesPage;
                break;

            case "Strapi Data Dictionary Fields":
                _currentPage = StrapiDataDictionaryFieldsPage;
                break;

            case "Strapi Intro":
                _currentPage = StrapiIntroPage;
                break;

            case "Strapi Release Schedule":
                _currentPage = StrapiReleaseSchedulePage;
                break;
            }
        }
Example #2
0
        public void ArrayChallenge_RecursiveSolution()
        {
            BasePageObject.Get <HomePageObject>()
            .RenderChallengeButtonElement
            .Click();

            int[] firstRowValues = BasePageObject.Get <ArrayChallengePageObject>()
                                   .FirstRowValues;

            int[] secondRowValues = BasePageObject.Get <ArrayChallengePageObject>()
                                    .SecondRowValues;

            int[] thirdRowValues = BasePageObject.Get <ArrayChallengePageObject>()
                                   .ThirdRowValues;

            int?firstRowAnswer  = ArrayIndexWhereLeftEqualsRightRecursively(firstRowValues);
            int?secondRowAnswer = ArrayIndexWhereLeftEqualsRightRecursively(secondRowValues);
            int?thirdRowAnswer  = ArrayIndexWhereLeftEqualsRightRecursively(thirdRowValues);

            BasePageObject.Get <ArrayChallengePageObject>()
            .PopulateAnswerForm(new DTOs.AnswerForm
            {
                FirstAnswer  = firstRowAnswer.ToString(),
                SecondAnswer = secondRowAnswer.ToString(),
                ThirdAnswer  = thirdRowAnswer.ToString(),
                Name         = "Thomas Shipley"
            })
            .SubmitAnswerForm()
            .Get <DialogPageObject>()
            .WaitForSuccessMessage()
            .CloseButtonElement
            .Click();
        }
 public MailBusinessObject(BasePageObject baseSetup)
 {
     layoutPageObject       = new GmailLayoutPageObject(baseSetup);
     composeModalPageObject = new ComposeModalPageObject(baseSetup);
     messageListPageObject  = new MessageListPageObject(baseSetup);
     messagePageObject      = new MessagePageObject(baseSetup);
 }
        public void StartWebDriver()
        {
            if (driver == null)
            {
                driver = InitializeChromeDriver.StartChromeDriver();
            }
            BasePageObject basePageObject = new BasePageObject();

            basePageObject.GoToHomePage();
            driver.WaitForPageToLoad();
        }
Example #5
0
 /// <summary>
 /// Construct a new BasicPageElement
 /// </summary>
 /// <param name="objBy">The By Locator.</param>
 /// <param name="webDriver">The WebDriver.</param>
 /// <param name="waitModel">Wait-Options for this element.</param>
 /// <param name="parentPageObject">The <see cref="BasePageObject"/> this <see cref="BasicPageElement"/> belongs to.</param>
 /// <param name="clickBehaviour">The ClickBehaviour.</param>
 public BasicPageElement(By byLocator, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default)
 {
     _waitAfterClick      = waitModel.WaitAfterAction == 0 ? TimeSpan.Zero : new TimeSpan(0, 0, 0, 0, waitModel.WaitAfterAction);
     _waitBeforeClick     = waitModel.WaitBeforeAction == 0 ? TimeSpan.Zero : new TimeSpan(0, 0, 0, 0, waitModel.WaitBeforeAction);
     _elementsBeforeClick = waitModel.WaitForElementsBeforeAction;
     _elementsAfterClick  = waitModel.WaitForElementsAfterAction;
     By               = byLocator;
     WebDriver        = webDriver;
     ParentPageObject = parentPageObject;
     ClickBehaviour   = TestContext.ClickBehaviourFactory.Create(clickBehaviour, this);
 }
        public AbstractPageSettings GetPageSettings(BasePageObject pageObject)
        {
            PagePropsAttribute pageAttributes = (PagePropsAttribute)pageObject.GetType().GetCustomAttribute(typeof(PagePropsAttribute), true);

            if (pageAttributes != null && pageAttributes.PageSettings != null)
            {
                return((AbstractPageSettings)Activator.CreateInstance(pageAttributes.PageSettings, pageObject));
            }

            return(new DefaultSettings(pageObject));
        }
Example #7
0
        public void ThenIShouldBeDirectedToThePageInANewTab(string pageName)
        {
            switch (pageName)
            {
            case CoinCapPage:
                BasePageObject po = ((CoinCapPageObject)ScenarioContext.Current.Get <BasePageObject>());
                po.SwitchToNewTab();
                po.VerifyPageLoaded();
                break;

            default:
                Assert.Fail(string.Format("Page [{0}] not implemented; please add to CommonStepDefinitions.ThenIShouldBeDirectedToThePageInANewTab", pageName));
                break;
            }
        }
Example #8
0
 public DerivedLink(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default) : base(objBy, webDriver, waitModel, parentPageObject, clickBehaviour)
 {
 }
		public DerivedInput(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default, FillBehaviour fillBehaviour = FillBehaviour.Default) : base(objBy, webDriver, waitModel, parentPageObject, clickBehaviour, fillBehaviour)
		{
		}
 protected AbstractPageSettings(BasePageObject pageObject)
 {
     PageObject                = pageObject;
     PageUsesJquery            = false;
     HasEndlessJQueryAnimation = false;
 }
Example #11
0
 public DerivedBasicPageElement(By byLocator, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default) : base(byLocator, webDriver, waitModel, parentPageObject, clickBehaviour)
 {
 }
Example #12
0
 public Input(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default, FillBehaviour fillBehaviour = FillBehaviour.Default)
     : base(objBy, webDriver, waitModel, parentPageObject, clickBehaviour)
 {
     _fillBehaviour = TestContext.FillBehaviourFactory.Create(fillBehaviour, this);
 }
Example #13
0
 public GeneralSteps()
 {
     _basePageObject = new BasePageObject();
 }
Example #14
0
		public SelectBox(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ISelectable selectBehaviour = null)
			: base(objBy, webDriver, waitModel, parentPageObject, ClickBehaviours.Default)
		{
			_selectBehaviour = selectBehaviour ?? new DefaultSelectBehaviour(this);
		}
Example #15
0
 public TPageObjectType Navigate()
 {
     this.Element.Click();
     return(BasePageObject.CreatePageObject <TPageObjectType>(_driver));
 }
Example #16
0
 public DefaultSettings(BasePageObject pageObject) : base(pageObject)
 {
 }
Example #17
0
        public void TearDown()
        {
            var basePageObject = new BasePageObject();

            basePageObject.DisposeDriver();
        }
		public DerivedSelectBox(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ISelectable selectBehaviour = null) : base(objBy, webDriver, waitModel, parentPageObject, selectBehaviour)
		{
		}
 public BaseTest()
 {
     BasePageObject = new BasePageObject();
 }
Example #20
0
		public Input(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default, FillBehaviour fillBehaviour = FillBehaviour.Default)
			: base(objBy, webDriver, waitModel, parentPageObject, clickBehaviour)
		{
			_fillBehaviour = TestContext.FillBehaviourFactory.Create(fillBehaviour, this);
		}
Example #21
0
		public Link(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default)
			: base(objBy, webDriver, waitModel, parentPageObject, clickBehaviour)
		{
		}
Example #22
0
 public Button(By byLocator, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentBasePageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default)
     : base(byLocator, webDriver, waitModel, parentBasePageObject, clickBehaviour)
 {
 }
		public DerivedImage(By byLocator, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default) : base(byLocator, webDriver, waitModel, parentPageObject, clickBehaviour)
		{
		}
Example #24
0
 public DerivedInput(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default, FillBehaviour fillBehaviour = FillBehaviour.Default) : base(objBy, webDriver, waitModel, parentPageObject, clickBehaviour, fillBehaviour)
 {
 }
Example #25
0
 public SelectBox(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ISelectable selectBehaviour = null)
     : base(objBy, webDriver, waitModel, parentPageObject, ClickBehaviours.Default)
 {
     _selectBehaviour = selectBehaviour ?? new DefaultSelectBehaviour(this);
 }
Example #26
0
 public DerivedSelectBox(By objBy, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentPageObject, ISelectable selectBehaviour = null) : base(objBy, webDriver, waitModel, parentPageObject, selectBehaviour)
 {
 }