public void DialogMustOpen(string dialogName) { if (HtmlModule.TelerikEditor.PopUpFrame != null) { WatiNAssert.AssertIsTrue(HtmlModule.TelerikEditor.PopUpFrame.Frame(Find.BySrc(s => s.Contains(dialogName))) != null, "DialogNotOpen.png"); } else { WatiNAssert.AssertIsTrue(IEInstance.Frame(Find.BySrc(s => s.Contains(dialogName))) != null, "DialogNotOpen.png"); } }
public void ThenTheLanguageIsAddedToTheLanguagePage(string languageName) { Span flagSpan = LanguagePage.GetLanguageFlagSpanByLocaleName(languageName); Thread.Sleep(5000); IEInstance.Refresh(); Thread.Sleep(1500); WatiNAssert.AssertIsTrue(flagSpan.Exists, "FlagSpanMissing.jpg"); WatiNAssert.AssertIsTrue(flagSpan.ClassName.Equals("Language"), "FlagSpanError.jpg"); IEInstance.GoTo(SiteUrl + "/logoff.aspx"); }
public void ThenAsAnAdminOnThePageICanSeeTheModuleAndItsContent(string pageName, string moduleName, string moduleContent) { Thread.Sleep(1500); IEInstance.GoTo(SiteUrl); Thread.Sleep(1500); LoginPage.LogoffUser(); Thread.Sleep(1500); LoginPage.LoginUser(TestUsers.Admin.UserName, TestUsers.Admin.Password); pageName = pageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/" + pageName + ".aspx"); WatiNAssert.AssertIsTrue(HomePage.HtmlModuleExistsOnPage(moduleName, moduleContent), "MissingModuleForAdmin.jpg"); }
private void AddPage(string pageName, string pageTemplate) { IEInstance.GoTo(SiteUrl); IEInstance.WaitForComplete(); _ribbonBar = GetPage <RibbonBar>(); _ribbonBar.NewPageLink.Click(); IEInstance.WaitForComplete(); var pageSettings = GetPage <PageSettingsPage>(); pageSettings.AddPageSelectTemplate(pageName, pageTemplate); IEInstance.WaitForComplete(); }
public void WhenIAddNewLanguage(string name) { if (LanguagesPage.LanguageTable.Image(Find.BySrc(s => s.Contains(name))).Exists) { return; } LanguagesPage.AddNewLanguage(name, "en-US"); LanguagesPage.UpdateLink.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); Thread.Sleep(1000); IEInstance.WaitForComplete(); }
public void CloseWindowAfterScenario() { var closeWindow = Convert.ToBoolean(ConfigurationManager.AppSettings["CloseWindow"]); if (closeWindow) { if (IEInstance != null) { IEInstance.ForceClose(); } } }
public void WhenISubscribeToAServiceWithAFee() { foreach (var link in UserProfilePage.ServicesTable.Links) { if (link.Text == "Subscribe") { link.Click(); break; } } IEInstance.WaitForComplete(); }
/// <summary> /// Finds the edit module content link for the module specified. /// </summary> /// <param name="moduleNum">The index of the module on the page. To find the action menu image for the first module on the page use 0.</param> /// <returns>The edit module link for the module.</returns> public Link GetEditModuleContentLink(int moduleNum) { //Returns the edit module content link for the module specified by moduleNum //0 being the first module on the page DivCollection actionMenu = IEInstance.Divs.Filter(Find.ByClass("dnnActionMenu")); if (actionMenu.Count > moduleNum) { return(actionMenu[moduleNum].Link(Find.ByText(s => s.Contains("Edit Content")))); } return(IEInstance.Link(Find.ByText(s => s.Contains("Edit Content")))); }
private void AddPage(string pageName, string pageTemplate) { IEInstance.GoTo(SiteUrl); Thread.Sleep(2500); _ribbonBar = GetPage <RibbonBar>(); _ribbonBar.NewPageLink.Click(); var pageSettings = GetPage <PageSettingsPage>(); Thread.Sleep(1500); pageSettings.AddPageSelectTemplate(pageName, pageTemplate); Thread.Sleep(1500); }
public void ThenThePageCalledTestPageIsDeleted(string pageName) { Thread.Sleep(2500); IEInstance.Refresh(); var menu = GetPage <SiteMenu>(); WatiNAssert.AssertIsFalse(menu.MainMenu.Link(Find.ByText(s => s.Contains(pageName))).Exists, pageName + "FoundInMenu.jpg", pageName + " found in main menu: " + menu.MainMenu.InnerHtml); IEInstance.GoTo(SiteUrl + "/Admin/RecycleBin.aspx"); var recycleBin = GetPage <RecycleBinPage>(); Thread.Sleep(1000); WatiNAssert.AssertIsTrue(recycleBin.PagesRecycleBin.InnerHtml.Contains(pageName), pageName + "NotFoundInRecycleBin.jpg", pageName + " not found in recycle bin: " + recycleBin.PagesRecycleBin.InnerHtml); }
public void CloseWindowAfterScenario() { var closeWindow = Convert.ToBoolean(ConfigurationManager.AppSettings["CloseWindow"]); if (closeWindow) { if (IEInstance != null) { IEInstance.GoTo(SiteUrl + "/logoff.aspx"); IEInstance.Close(); } } }
public void ThenAsAnAnonymousUserOnThePageICanSeeTheModuleAndItsContent(string pageName, string moduleName, string moduleContent) { IEInstance.GoTo(SiteUrl); Thread.Sleep(1500); if (HomePage.LoginLink.Text.ToLower() != "login") { LoginPage.LogoffUser(); Thread.Sleep(1500); } pageName = pageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/" + pageName + ".aspx"); WatiNAssert.AssertIsTrue(HomePage.HtmlModuleExistsOnPage(moduleName, moduleContent), "AnonUserCannotSeeModule.jpg"); }
public void WhenIEnableContentLocalizationOnThePortal() { if (!LanguagesPage.EnableLocalizedContentLink.Exists) { return; } LanguagesPage.EnableLocalizedContentLink.Click(); LanguagesPage.EnableLocalizedContentConfirmation.Click(); LanguagesPage.EnableLocalizedContentConfirmation.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); Thread.Sleep(1000); IEInstance.WaitForComplete(); }
/// <summary> /// Enters a username and password into the login module. /// Doesn't login the user after entering these values. /// </summary> /// <param name="name">The username.</param> /// <param name="password">The password.</param> public void EnterUserLogin(string name, string password) { if (LoginLink.Text == "Logoff") { LoginLink.ClickNoWait(); IEInstance.WaitForComplete(); } LoginLink.Click(); System.Threading.Thread.Sleep(1500); UserNameField.Value = name; PasswordField.Value = password; }
private void SelectTreeNode(string nodeName) { if (!IEInstance.Span(Find.ByTitle(nodeName)).Exists) { var expandImg = IEInstance.Image(Find.ById(i => i.Contains("DNNTreeexpcoldnn"))); expandImg.Click(); expandImg.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); } var node = IEInstance.Span(Find.ByTitle(nodeName)); node.Click(); node.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
public void GivenIHaveCreatedThePage(string pageName) { Thread.Sleep(1500); IEInstance.GoTo(SiteUrl + "/admin/pages.aspx"); Thread.Sleep(1500); _pagesPage = GetPage <AdminPagesPage>(); if (!_pagesPage.PagesPanel.InnerHtml.Contains(pageName)) { Thread.Sleep(2500); _pagesPage.AddPage(pageName); Thread.Sleep(1500); } Thread.Sleep(2500); }
public void WhenIClickButton(string type) { switch (type) { case "Next": SiteWizardPage.NextButtonLink.Click(); break; case "Finish": SiteWizardPage.FinishButtonLink.Click(); break; } SiteWizardPage.ContentPaneDiv.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
public void ThenAChildPortalShouldBeCreatedCorrectly(string portalAlias, string portalTitle) { IEInstance.NativeBrowser.NavigateTo(new Uri("http://" + SiteUrl + "/host/sitemanagement.aspx")); IEInstance.WaitForComplete(); WatiNAssert.AssertIsTrue(SiteManagementPage.PortalsTable.InnerHtml.Contains(portalTitle), portalTitle + "NotInSitesTable.jpg"); IEInstance.GoTo(SiteUrl + "/" + portalAlias); IEInstance.WaitForComplete(); WatiNAssert.AssertIsTrue(IEInstance.Image(Find.ById("dnn_dnnLogo_imgLogo")).Exists, "LogoNotFoundOnChildPortal.jpg"); WatiNAssert.AssertIsTrue(HomePage.LogoLink.Exists, "LogoLinkNotFoundOnChildPortal.jpg"); WatiNAssert.AssertIsTrue(HomePage.LoginLink.Exists, "LoginLinkNotFoundOnChildPortal.jpg"); WatiNAssert.AssertIsTrue(HomePage.RegisterLink.Exists, "RegisterLinkNotFoundOnChildPortal.jpg"); }
/// <summary> /// Enters a username and password into the login module. /// Doesn't login the user after entering these values. /// </summary> /// <param name="name">The username.</param> /// <param name="password">The password.</param> public void EnterUserLogin(string name, string password) { IEInstance.GoTo(SiteUrl); System.Threading.Thread.Sleep(1500); if (LoginLink.Text != "Login") { return; } LoginLink.Click(); System.Threading.Thread.Sleep(1500); UserNameField.Value = name; PasswordField.Value = password; }
public void WhenIClickAddUser() { IEInstance.WaitForComplete(); if (HomePage.PopUpFrame != null || HomePage.ModuleTitleSpan.InnerHtml.Contains("Edit User Accounts")) { Assert.IsTrue(UserPage.AddNewUserLink.Exists); UserPage.AddNewUserLink.Click(); } else { Assert.IsTrue(UserPage.AddNewUserStartLink.Exists); UserPage.AddNewUserStartLink.Click(); } IEInstance.WaitForComplete(); }
public void GivenIAddANewList(string listName) { if (ListPage.PageContentDiv.Span(Find.ByText(listName)).Exists) { return; } ListPage.AddListButton.Click(); ListPage.AddListButton.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); ListPage.ListEntryName.Value = listName; ListPage.ListEntryText.Value = listName + "Item"; ListPage.ListEntryValue.Value = listName + "Item"; ListPage.SaveButton.Click(); IEInstance.WaitForComplete(); }
public void WhenICreateANewChildPortal() { if (SiteManagementPage.GetPortalAliasCellByPortalName("Child") != null) { return; } SiteManagementPage.AddNewSiteLink.Click(); SiteManagementPage.ChildRadioButton.Checked = true; Thread.Sleep(1000); SiteManagementPage.SiteAliasField.Value += "Child"; SiteManagementPage.SiteNameField.Value = "Child"; SiteManagementPage.CreateSiteLink.Click(); SiteManagementPage.CreateSiteLink.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
/// <summary> /// Checks the role checkbox on the newsletters page for the role specified. /// </summary> /// <param name="roleName">The name of the role.</param> public void CheckRoleCheckBoxByName(string roleName) { //Returns the Edit Button for the user specified CheckBox roleCheckBox = null; TableRowCollection roleRows = IEInstance.Div(Find.ByClass("dnnRolesGrid")).Table(Find.Any).TableRows; foreach (TableRow row in roleRows) { if (row.TableCells[0].InnerHtml.Contains(roleName)) { roleCheckBox = row.TableCells[1].CheckBox(Find.Any); } continue; } roleCheckBox.Checked = true; }
public void ThenAsUserOnThePageICanSeeTheModuleAndItsContent(string userName, string password, string pageName, string moduleName, string moduleContent) { Thread.Sleep(1500); IEInstance.GoTo(SiteUrl); Thread.Sleep(1500); if (HomePage.LoginLink.Text.ToLower() == "logout") { LoginPage.LogoffUser(); Thread.Sleep(1500); } LoginPage.LoginUser(userName, password, true, 0); pageName = pageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/" + pageName + ".aspx"); Thread.Sleep(1500); WatiNAssert.AssertIsTrue(HomePage.HtmlModuleExistsOnPage(moduleName, moduleContent), "MissingModuleFor" + userName + ".jpg"); }
public void WhenIAddTheChildPortalToTheGroup() { if (!SiteGroupPage.AvailablePortalSelectList.Exists) { return; } if (SiteGroupPage.AvailablePortalSelectList.Options.Count == 0) { throw new Exception("No portals available in Portal Select list"); } SiteGroupPage.AvailablePortalSelectList.Option(Find.ByText("Child")).Select(); SiteGroupPage.AddSiteToGroupButton.Click(); SiteGroupPage.AddSiteToGroupButton.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
public void ThenIDeleteTheLanguage(string languageName) { LanguagePage.GetCheckBoxForLanguage(languageName).Click(); IEInstance.WaitForComplete(); LanguagePage.GetEditLanguageButtonForLanguage(languageName).Click(); IEInstance.WaitForComplete(); LanguagePage.GetEditLanguageButtonForLanguage(languageName).Click(); IEInstance.WaitForComplete(); var dialog = new ConfirmDialogHandler(); using (new UseDialogOnce(IEInstance.DialogWatcher, dialog)) { LanguagePage.DeleteLanguageLink.ClickNoWait(); dialog.WaitUntilExists(); dialog.OKButton.Click(); } }
public void GivenIAddNewItemToList(string itemName, string listName) { ListPage.PageContentDiv.Span(Find.ByText(listName)).Click(); ListPage.PageContentDiv.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); if (ListPage.GetHostListRow(itemName) != null) { return; } ListPage.AddEntryButton.Click(); ListPage.AddEntryButton.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); ListPage.ListEntryText.Value = itemName; ListPage.ListEntryValue.Value = itemName; ListPage.SaveButton.Click(); ListPage.SaveButton.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
/// <summary> /// Logs in a user. /// First navigates to the site home page, clicks on the login link, then enters the users username and password and clicks login. /// </summary> /// <param name="name">The username for the user.</param> /// <param name="password">The password for the user.</param> public void LoginUser(string name, string password) { IEInstance.GoTo(SiteUrl); System.Threading.Thread.Sleep(1500); if (LoginLink.Text != "Login") { return; } LoginLink.Click(); System.Threading.Thread.Sleep(1500); UserNameField.Value = name; PasswordField.Value = password; LoginButton.ClickNoWait(); System.Threading.Thread.Sleep(2500); }
public void WhenITryToCreateLanguagePack(string type, string name) { //delete the language pack file if exist var langDir = Path.Combine(PhysicalPath, "Install\\Language"); var packs = Directory.GetFiles(langDir, string.Format("*{0}*.zip", name)); if (packs.Length > 0) { Array.ForEach <string>(packs, File.Delete); } LanguagesPage.CreateLanguagePackLink.Click(); LanguagesPage.SelectLanguagePackType(type); LanguagesPage.CreateLink.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); LanguagesPage.SelectModuleCheckbox(name); LanguagesPage.CreateLink.Click(); LanguagesPage.CreateLink.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
/// <summary> /// Installs the extension at packagePath. /// Selects the package and completes the install extension wizard. /// </summary> /// <param name="packagePath">The path for the package that will be isntalled.</param> public void InstallExtension(string packagePath) { if (!ModuleTitleSpan.Text.Contains("Install Extension")) { InstallExtensionsWizardLink.Click(); } System.Threading.Thread.Sleep(1500); UploadExtensionsPackage(packagePath); WizardStartLink.ClickNoWait(); IEInstance.WaitForComplete(); WizardNextLink.ClickNoWait(); IEInstance.WaitForComplete(); WizardNextLink.ClickNoWait(); IEInstance.WaitForComplete(); AcceptLicenseCheckBox.ClickNoWait(); WizardNextLink.ClickNoWait(); IEInstance.WaitForComplete(); WizardFinishLink.Click(); }