/// <summary> /// Click the login button. /// </summary> public void PressLoginButton() { HtmlButton loginBtn = this.EM.Identity.LoginFormFrontend.LoginButton.AssertIsPresent("Login button"); loginBtn.Click(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
public void AdminLogin() { RuntimeSettingsModificator.ExecuteWithClientTimeout(200000, () => BAT.Wrappers().Backend().Comments().ManageCommentsWrapper(ActiveBrowser).LogInUser(AdminUserName, AdminPassword)); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); BAT.Macros().User().EnsureAdminLoggedIn(); }
/// <summary> /// Performs logout action. /// </summary> public void Logout() { var logoutBtn = this.EM.Identity.LoginStatusFrontend.LogoutButton.AssertIsPresent("Logout button"); logoutBtn.Click(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
public void AdminLogin() { BAT.Wrappers().Backend().Comments().ManageCommentsWrapper().LogInUser(FeatherTestCase.AdminEmail, FeatherTestCase.AdminPassword); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); BAT.Macros().User().EnsureAdminLoggedIn(); }
public void VerifyCommentBackend() { BAT.Macros().NavigateTo().Modules().Comments(this.Culture); ActiveBrowser.WaitForAsyncJQueryRequests(); ManageCommentsWrapper manageComments = new ManageCommentsWrapper(ActiveBrowser); manageComments.VerifyCommentBackend(ReviewsStatus, this.reviewsToDynamicItem[0], this.reviewAuthor[0], DynamicTitle); }
public void VerifyCommentBackend() { BAT.Macros().NavigateTo().Modules().Comments(this.Culture); ActiveBrowser.WaitForAsyncJQueryRequests(); ManageCommentsWrapper manageComments = new ManageCommentsWrapper(ActiveBrowser); manageComments.VerifyCommentBackend(CommentStatus, this.commentToNews[0], this.commentAuthor[0], NewsTitle); }
/// <summary> /// Click search link /// </summary> /// <param name="resultPageUrl">results page URL</param> public void ClickSearchLink(string resultsPageUrl) { HtmlAnchor searchButton = this.EM.Search.SearchFrontend.SearchLink.AssertIsPresent("Search link"); searchButton.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForUrl(resultsPageUrl); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Click change password link /// </summary> public void ChangePasswordLink() { HtmlAnchor changePassworLink = EM.Identity.ProfileFrontend.ChangePasswordLink .AssertIsPresent("Change password link"); changePassworLink.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Clicks the submit button in the frontend of the form /// </summary> public void ClickSubmit() { HtmlButton submitButton = EM.Forms.FormsFrontend.SubmitButton; submitButton.MouseClick(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); }
/// <summary> /// Click login on top link /// </summary> public void ClickLoginLink() { HtmlAnchor loginLink = this.EM.CommentsAndReviews.CommentsFrontend.LoginLink .AssertIsPresent("Login link"); loginLink.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Press subscribe button /// </summary> public void ClickSubscribeButton() { HtmlButton subscribeButton = EM.EmailCampaigns.SubscribeFormFrontend.SubscribeButton .AssertIsPresent("Subscribe button"); subscribeButton.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Switch to Both mode only /// </summary> public void SwitchToBothMode() { HtmlInputRadioButton bothMode = EM.Identity.ProfileEditScreen.BothReadModeCanBeEditedMode .AssertIsPresent("Both mode only button"); bothMode.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Switch to Read mode only /// </summary> public void SwitchToReadMode() { HtmlInputRadioButton readMode = EM.Identity.ProfileEditScreen.ReadModeOnly .AssertIsPresent("Read mode only button"); readMode.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Switches to link file option. /// </summary> public void SwitchToLinkFileOption() { HtmlInputRadioButton linkToCssFile = EM.ScriptsAndStyles.ScriptsAndStylesEditScreen.LinkToFile .AssertIsPresent("Link to css file button"); linkToCssFile.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Press unsubscribe button not styled /// </summary> public void ClickUnsubscribeButtonNotStyled() { HtmlInputSubmit unsubscribeButton = EM.EmailCampaigns.UnsubscribeFrontend.UnsubscribeButtonHybridPage .AssertIsPresent("Unsubscribe button"); unsubscribeButton.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Press Register button /// </summary> public void RegisterButton() { HtmlButton registerButton = EM.Identity.RegistrationFrontend.RegisterButton .AssertIsPresent("register button"); registerButton.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Click edit profile link /// </summary> public void ClickEditProfileLink() { HtmlAnchor editProfileLink = EM.Identity.ProfileFrontend.EditProfileLink .AssertIsPresent("Edit profile link"); editProfileLink.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Click select image button /// </summary> public void ClickSelectImageButton() { HtmlButton selectImageButton = EM.Card.CardEditScreen.SelectImage .AssertIsPresent("Select image button"); selectImageButton.Click(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); }
/// <summary> /// Click submit button /// </summary> public void ClickSubmitButton() { HtmlButton submitButton = this.EM.CommentsAndReviews.CommentsFrontend.SubmitButton .AssertIsPresent("Submit button"); submitButton.Click(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); }
/// <summary> /// Press Enter to activate search /// </summary> public void PressEnter() { HtmlButton searchButton = this.EM.Search.SearchFrontend.SearchButton.AssertIsPresent("Search button"); searchButton.Focus(); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
public void VerifyCommentBackend() { BAT.Macros().User().EnsureAdminLoggedIn(); BAT.Macros().NavigateTo().Modules().Comments(this.Culture); ActiveBrowser.WaitForAsyncJQueryRequests(); ManageCommentsWrapper manageComments = new ManageCommentsWrapper(ActiveBrowser); manageComments.VerifyCommentBackend(CommentStatus, this.commentToPage[0], this.commentAuthor[0], PageName); }
/// <summary> /// Clicks the submit in the footer. /// </summary> public void ClickSubmitInTheFooter() { ActiveBrowser.Find.AllByExpression <HtmlButton>("TagName=button", "type=submit") .Last() .AssertIsVisible("Submit button in the footer") .Click(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); }
public void ImportFlatModuleAllFields() { RuntimeSettingsModificator.ExecuteWithClientTimeout(200000, () => BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().NavigateToModuleBuilderPage()); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().OpenModuleDashboard(ModuleName); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().OpenFieldsEditor(ModuleName, ContentTypeName); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().VerifyIfFieldExists(this.fieldNames); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().OpenEditFieldScreen(this.fieldNames[2]); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SelectLimitations(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().VerifyMinAndMaxLenght("1", "10"); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SetMaxLenght(15); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SaveField(); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().ClickFinishEditButton(); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().ConfirmWidgetTemplateUpdate(true); ActiveBrowser.WaitForAsyncJQueryRequests(); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().OpenFieldsEditor(ModuleName, ContentTypeName); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().OpenEditFieldScreen(this.fieldNames[2]); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SelectLimitations(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().VerifyMinAndMaxLenght("1", "15"); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().CancelFieldEditScreen(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().OpenEditFieldScreen(this.fieldNames[6]); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().AssertRequiredCheckboxIsSelected(true); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().CancelFieldEditScreen(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().OpenCreateFieldWizard(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SetFieldName(FieldName); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SelectFieldType(FieldTypeNames.LongText); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SelectInterfaceWidgetForEnteringData(WidgetNames.TextArea); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().ClickContinueButton(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().SaveField(); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().WaitForFieldPresent(FieldName); BAT.Wrappers().Backend().ModuleBuilder().FieldActionsWrapper().DeleteField(this.fieldNames[1]); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().ClickFinishEditButton(); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().ConfirmWidgetTemplateUpdate(true); BAT.Macros().NavigateTo().Dashboard(); BAT.Wrappers().Backend().ModuleBuilder().ModuleInitializerWrapper().AssertModulePresentInContentMenu(ModuleName, true); BAT.Macros().NavigateTo().Modules().ParticularModule(ModuleName, this.Culture); BAT.Wrappers().Backend().ModuleBuilder().ContentTypePageActionsWrapper().OpenCreateItemWizard(this.title); BAT.Wrappers().Backend().ModuleBuilderWrapper().ModuleBuilderItemsCreateScreenFrameWrapper().SetTitle(this.dynamicItemNameAllTypes); BAT.Wrappers().Backend().ModuleBuilderWrapper().ModuleBuilderItemsCreateScreenFrameWrapper().SetNumber(this.dynamicItemNumber); BAT.Wrappers().Backend().ModuleBuilderWrapper().ModuleBuilderItemsCreateScreenFrameWrapper().PublishItem(); BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddMvcWidgetHybridModePage(ContentTypeName); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); this.VerifyDynamicItemsOnFrontEnd(this.dynamicItemNameAllTypes); }
/// <summary> /// Select sorting option /// </summary> /// <param name="sortingOption">sorting option to select</param> public void SelectSortingOption(string sortingOption) { HtmlSelect sortingOptionsDropdown = this.EM.Search.SearchFrontend.SortingOptionsDropdown.AssertIsPresent("Sorting option dropdown"); sortingOptionsDropdown.SelectByText(sortingOption); sortingOptionsDropdown.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.click); sortingOptionsDropdown.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.change); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Asserts comments and reviews count /// </summary> public void AssertExpectedCount(string expectedCount) { ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitForAsyncJQueryRequests(); HtmlAnchor commentLink = this.EM.CommentsAndReviews.CommentsFrontend.LeaveAComment.AssertIsPresent("Comments count link"); bool isPresent = commentLink.InnerText.Contains(expectedCount); Assert.IsTrue(isPresent); }
/// <summary> /// Click search button /// </summary> /// <param name="resultPageUrl">results page URL</param> public void ClickSearchButton(string resultsPageUrl) { HtmlButton searchButton = this.EM.Search.SearchFrontend.SearchButton.AssertIsPresent("Search button"); searchButton.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.focus); searchButton.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.click); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForUrl(resultsPageUrl); ActiveBrowser.WaitForAsyncJQueryRequests(); }
public void EditField(string controlName) { HtmlDiv frontendPageMainDiv = BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent(); HtmlControl inlineEditingControl = frontendPageMainDiv.Find.ByExpression <HtmlControl>("class=sfFieldEditable", "name=" + controlName); inlineEditingControl.Focus(); inlineEditingControl.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.RefreshDomTree(); }
/// <summary> /// Asserts message and count on page /// </summary> public void AssertMessageAndCountOnPage(string commentCount) { ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitForAjax(10000); ActiveBrowser.WaitForAsyncJQueryRequests(); HtmlDiv commentLinkOnPage = this.EM.CommentsAndReviews.CommentsFrontend.MessageAndCountOnPage.AssertIsPresent("Comments count on page"); bool isPresent = commentLinkOnPage.InnerText.Contains(commentCount); Assert.IsTrue(isPresent); }
/// <summary> /// Press Save changes button /// </summary> public void SaveChangesButton() { HtmlButton saveChangesButton = EM.Identity.ProfileFrontend.SaveChanges .AssertIsPresent("Save changes button"); saveChangesButton.ScrollToVisible(); saveChangesButton.Focus(); saveChangesButton.MouseClick(); saveChangesButton.InvokeClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Create page with template /// </summary> /// <param name="pageName">Page name</param> /// <param name="templateName">Template name</param> public void CreatePageWithTemplate(string pageName, string templateName) { var createPageLink = BAT.Wrappers().Backend().Pages().PagesWrapper().GetCreatePageFromDecisionScreen(); createPageLink.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); BAT.Wrappers().Backend().Pages().CreatePageWrapper().SetPageTitle(pageName); BAT.Wrappers().Backend().Pages().CreatePageWrapper().ClickSelectAnotherTemplateButton(); BAT.Wrappers().Backend().Pages().SelectTemplateWrapper().SelectATemplate(templateName); BAT.Wrappers().Backend().Pages().SelectTemplateWrapper().ClickDoneButton(); BAT.Wrappers().Backend().Pages().PagesWrapper().SavePageDataAndContinue(); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().WaitUntilReady(); }