public void UninstallFeather_GridWidgetsInToolboxPurePageTemplate_VerifyBackend() { var moduleOperations = FeatherServerOperations.FeatherModule(); var templatesOperations = ServerOperations.Templates(); Guid templateId = Guid.Empty; moduleOperations.EnsureFeatherEnabled(); try { templateId = templatesOperations.CreatePureMVCPageTemplate(ModuleUnloadTests.PageTemplateTitle + Guid.NewGuid().ToString("N")); string templateUrl = UrlPath.ResolveAbsoluteUrl(ModuleUnloadTests.SitefinityTemplateRoutePrefix + templateId.ToString()); var templateContentBeforeDeactivate = this.ExecuteWebRequest(templateUrl + this.AppendUncacheUrl()); Assert.IsTrue(templateContentBeforeDeactivate.Contains(ModuleUnloadTests.FeatherGridToolboxItemMarkup)); moduleOperations.DeactivateFeather(); moduleOperations.UninstallFeather(); var templateContentAfterDeactivate = this.ExecuteWebRequest(templateUrl + this.AppendUncacheUrl()); Assert.IsFalse(templateContentAfterDeactivate.Contains(ModuleUnloadTests.FeatherGridToolboxItemMarkup)); } finally { moduleOperations.InstallFeather(); templatesOperations.DeletePageTemplate(templateId); } }
public void UninstallFeather_GridWidgetsInToolboxPurePage_VerifyBackend() { var moduleOperations = FeatherServerOperations.FeatherModule(); Guid pageId = Guid.Empty; moduleOperations.EnsureFeatherEnabled(); try { string pageUrl; pageId = this.CreatePage(PageTemplateFramework.Mvc, out pageUrl); var pageContentBeforeDeactivate = this.ExecuteWebRequest(pageUrl + this.AppendEditUrl()); Assert.IsTrue(pageContentBeforeDeactivate.Contains(ModuleUnloadTests.FeatherGridToolboxItemMarkup)); moduleOperations.DeactivateFeather(); moduleOperations.UninstallFeather(); var pageContentAfterDeactivate = this.ExecuteWebRequest(pageUrl + this.AppendEditUrl()); Assert.IsFalse(pageContentAfterDeactivate.Contains(ModuleUnloadTests.FeatherGridToolboxItemMarkup)); } finally { moduleOperations.InstallFeather(); ServerOperations.Pages().DeletePage(pageId); } }
public void DeactivateFeather_GridWidgetsOnHybridPage_VerifyBackend() { var moduleOperations = FeatherServerOperations.FeatherModule(); Guid pageId = Guid.Empty; moduleOperations.EnsureFeatherEnabled(); try { string pageUrl; pageId = this.CreatePage(PageTemplateFramework.Hybrid, out pageUrl); this.AddGridToPage(pageId, PageTemplateFramework.Hybrid); var pageContentBeforeDeactivate = this.ExecuteWebRequest(pageUrl + this.AppendEditUrl()); Assert.IsFalse(pageContentBeforeDeactivate.Contains(ModuleUnloadTests.GridUnavailableMessage)); moduleOperations.DeactivateFeather(); var pageContentAfterDeactivate = this.ExecuteWebRequest(pageUrl + this.AppendEditUrl()); Assert.IsTrue(pageContentAfterDeactivate.Contains(ModuleUnloadTests.GridUnavailableMessage)); } finally { ServerOperations.Pages().DeletePage(pageId); moduleOperations.ActivateFeather(); } }
public void UninstallFeather_GridWidgetsOnPurePageTemplate_VerifyBackend() { var moduleOperations = FeatherServerOperations.FeatherModule(); var templatesOperations = ServerOperations.Templates(); Guid templateId = Guid.Empty; moduleOperations.EnsureFeatherEnabled(); try { templateId = templatesOperations.CreatePureMVCPageTemplate(ModuleUnloadTests.PageTemplateTitle + Guid.NewGuid().ToString("N")); this.AddGridToPageTemplate(templateId, PageTemplateFramework.Mvc); string templateUrl = UrlPath.ResolveAbsoluteUrl(ModuleUnloadTests.SitefinityTemplateRoutePrefix + templateId.ToString()); var templateContentBeforeDeactivate = FeatherServerOperations.FeatherWebRequests().GetResponseContentFromAuthenticateGetRequest(templateUrl + this.AppendUncacheUrl()); Assert.IsFalse(templateContentBeforeDeactivate.Contains(ModuleUnloadTests.GridUnavailableMessage)); moduleOperations.DeactivateFeather(); moduleOperations.UninstallFeather(); var templateContentAfterDeactivate = FeatherServerOperations.FeatherWebRequests().GetResponseContentFromAuthenticateGetRequest(templateUrl + this.AppendUncacheUrl()); Assert.IsTrue(templateContentAfterDeactivate.Contains(ModuleUnloadTests.GridUnavailableMessage)); } finally { moduleOperations.InstallFeather(); templatesOperations.DeletePageTemplate(templateId); } }
public void CreatePage_Bootstrap_CheckFormTagNotExistPreviewMode() { Guid bootstrapPageId = Guid.Empty; FeatherServerOperations.FeatherModule().EnsureFeatherEnabled(); try { var suffix = Guid.NewGuid().ToString("N"); var bootstrapTemplate = this.GetDefaultBootstrapTemplate(); var bootstrapPageName = "PageBootstrap"; var previewFormTagPattern = "<form[\\s].*[\\s]?id=\"aspnetForm\".*>.*"; // page preview bootstrap bootstrapPageId = FeatherServerOperations.Pages().CreatePageWithTemplate(bootstrapTemplate, bootstrapPageName + suffix, bootstrapPageName + suffix); var bootstrapPagePreviewFormTagsCount = this.PagePreviewFormTags(bootstrapPageId, previewFormTagPattern); // template preview bootstrap var bootstrapTemplatePreviewFormTagsCount = this.TemplatePreviewFormTags(bootstrapTemplate, previewFormTagPattern); Assert.IsFalse(bootstrapPagePreviewFormTagsCount == 1, "Default ASP.Net form tag exist in Bootstrap package in page preview mode"); Assert.IsFalse(bootstrapTemplatePreviewFormTagsCount == 1, "Default ASP.Net form tag exist for Bootstrap package in template preview mode"); } finally { if (bootstrapPageId != Guid.Empty) { ServerOperations.Pages().DeletePage(bootstrapPageId); } } }
public void UninstallFeather_PurePage_Verify() { Guid pageId = Guid.Empty; FeatherServerOperations.FeatherModule().EnsureFeatherEnabled(); var featherActivated = true; try { string pageUrl; pageId = this.CreatePageWithWidget(PageTemplateFramework.Mvc, new DummyController(), out pageUrl); var backendPageContentBeforeUninstall = this.GetContent(pageUrl, openInEdit: true); Assert.IsTrue(backendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(backendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var frontendPageContentBeforeUninstall = this.GetContent(pageUrl); Assert.IsTrue(frontendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(frontendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); FeatherServerOperations.FeatherModule().UninstallFeather(); featherActivated = false; FeatherServerOperations.FeatherModule().UninstallFeather(); var backendPageContentAfterUninstall = this.GetContent(pageUrl, openInEdit: true); Assert.IsFalse(backendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsTrue(backendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var frontendPageContentAfterUninstall = this.GetContent(pageUrl); Assert.IsFalse(frontendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(frontendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); FeatherServerOperations.FeatherModule().InstallFeather(); featherActivated = true; var backendPageContentAfterInstall = this.GetContent(pageUrl, openInEdit: true); Assert.IsTrue(backendPageContentAfterInstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(backendPageContentAfterInstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var frontendPageContentAfterInstall = this.GetContent(pageUrl); Assert.IsTrue(frontendPageContentAfterInstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(frontendPageContentAfterInstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); } finally { if (!featherActivated) { FeatherServerOperations.FeatherModule().ActivateFeather(); } ServerOperations.Pages().DeletePage(pageId); } }
public void DeactivatingFeatherShouldRestoreAppStateToPreFeatherActivation() { FeatherServerOperations.FeatherModule().EnsureFeatherEnabled(); try { FeatherServerOperations.FeatherModule().DeactivateFeather(); this.CheckDeactivatingFeatherShouldRestoreAppStateToPreFeatherActivation(); } finally { FeatherServerOperations.FeatherModule().ActivateFeather(); } }
public void UninstallFeather_GridWidgetsInToolboxHybridPage_VerifyBackend() { var moduleOperations = FeatherServerOperations.FeatherModule(); Guid pageId = Guid.Empty; moduleOperations.EnsureFeatherEnabled(); try { string pageUrl; pageId = this.CreatePage(PageTemplateFramework.Hybrid, out pageUrl); var pageContentBeforeDeactivate = this.ExecuteWebRequest(pageUrl + this.AppendEditUrl()); Assert.IsTrue(pageContentBeforeDeactivate.Contains(ModuleUnloadTests.FeatherGridToolboxItemMarkup)); moduleOperations.DeactivateFeather(); moduleOperations.UninstallFeather(); var pageContentAfterDeactivate = this.ExecuteWebRequest(pageUrl + this.AppendEditUrl()); Assert.IsFalse(pageContentAfterDeactivate.Contains(ModuleUnloadTests.FeatherGridToolboxItemMarkup)); var configManager = ConfigManager.GetManager(); var toolboxesConfig = configManager.GetSection <ToolboxesConfig>(); foreach (var toolbox in toolboxesConfig.Toolboxes.Values) { foreach (var section in toolbox.Sections) { var existsFeatherWidgets = ((ICollection <ToolboxItem>)section.Tools) .Any(i => i.ControlType.StartsWith("Telerik.Sitefinity.Frontend", StringComparison.Ordinal)); Assert.IsFalse(existsFeatherWidgets, "Feather widget still exists in section " + section.Name); } } } finally { moduleOperations.InstallFeather(); ServerOperations.Pages().DeletePage(pageId); } }
public void NavigationWidgetOnPageTemplate_JQueryExist_Navigation_Pills() { Guid templateId = default(Guid); Guid pageId = Guid.Empty; FeatherServerOperations.FeatherModule().EnsureFeatherEnabled(); try { templateId = this.templateOperation.DuplicatePageTemplate(OldTemplateName, TemplateName); string url = UrlPath.ResolveAbsoluteUrl("~/" + UrlNamePrefix); var mvcProxy = CreateNavigationController(); this.templateOperation.AddControlToTemplate(templateId, mvcProxy, PlaceHolder, CaptionNavigation); pageId = this.locationGenerator.CreatePage(PageNamePrefix, PageTitlePrefix, UrlNamePrefix, null, null); Telerik.Sitefinity.TestUtilities.CommonOperations.ServerOperations.Templates().SetTemplateToPage(pageId, templateId); string responseContent = WebRequestHelper.GetPageWebContent(url); var httpContextWrapper = GetHttpContextWrapper(url); var htmlHelper = GetHtmlHelper(httpContextWrapper); var scriptHtml = ResourceHelper.Script(htmlHelper, ScriptRef.JQuery, "top", true).ToHtmlString(); Assert.IsFalse(!responseContent.Contains(scriptHtml), "The jquery not found!"); } finally { if (pageId != Guid.Empty) { Telerik.Sitefinity.TestUtilities.CommonOperations.ServerOperations.Pages().DeletePage(pageId); } if (templateId != Guid.Empty) { Telerik.Sitefinity.TestUtilities.CommonOperations.ServerOperations.Templates().DeletePageTemplate(templateId); } } }
public void UninstallFeather_HybridPageTemplate_Verify() { Guid pageId = Guid.Empty; Guid templateId = Guid.Empty; FeatherServerOperations.FeatherModule().EnsureFeatherEnabled(); var featherActivated = true; try { string pageUrl; templateId = this.CreateTemplateWithWidgetAndBasePageOnIt(PageTemplateFramework.Hybrid, new DummyController(), out pageId, out pageUrl); string templateUrl = UrlPath.ResolveAbsoluteUrl(FrontendModuleFilterTests.SitefinityTemplateRoutePrefix + templateId.ToString()); var templateContentBeforeUninstall = this.GetContent(templateUrl); Assert.IsTrue(templateContentBeforeUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(templateContentBeforeUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var backendPageContentBeforeUninstall = this.GetContent(pageUrl, openInEdit: true); Assert.IsTrue(backendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(backendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var frontendPageContentBeforeUninstall = this.GetContent(pageUrl); Assert.IsTrue(frontendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(frontendPageContentBeforeUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); FeatherServerOperations.FeatherModule().DeactivateFeather(); featherActivated = false; FeatherServerOperations.FeatherModule().UninstallFeather(); var templateContentAfterUninstall = this.GetContent(templateUrl); Assert.IsFalse(templateContentAfterUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsTrue(templateContentAfterUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var backendPageContentAfterUninstall = this.GetContent(pageUrl, openInEdit: true); Assert.IsFalse(backendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsTrue(backendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var frontendPageContentAfterUninstall = this.GetContent(pageUrl); Assert.IsFalse(frontendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(frontendPageContentAfterUninstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); FeatherServerOperations.FeatherModule().InstallFeather(); featherActivated = true; var templateContentAfterInstall = this.GetContent(templateUrl); Assert.IsTrue(templateContentAfterInstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(templateContentAfterInstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var backendPageContentAfterInstall = this.GetContent(pageUrl, openInEdit: true); Assert.IsTrue(backendPageContentAfterInstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(backendPageContentAfterInstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); var frontendPageContentAfterInstall = this.GetContent(pageUrl); Assert.IsTrue(frontendPageContentAfterInstall.Contains(FrontendModuleFilterTests.DummyController.ResponseString)); Assert.IsFalse(frontendPageContentAfterInstall.Contains(FrontendModuleFilterTests.FeatherModuleUnavailableMessage)); } finally { if (!featherActivated) { FeatherServerOperations.FeatherModule().ActivateFeather(); } ServerOperations.Pages().DeletePage(pageId); ServerOperations.Templates().DeletePageTemplate(templateId); } }