public void WhenINavigateToTheAdminPage(string adminPageName) { Thread.Sleep(2500); adminPageName = adminPageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/admin/" + adminPageName + ".aspx"); Thread.Sleep(2500); }
public void IAmOnTheHostPage(string hostPageName) { Thread.Sleep(2500); hostPageName = hostPageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/host/" + hostPageName + ".aspx"); Thread.Sleep(1500); }
public void GivenIAmOnTheHostProFeaturePagePage(string hostPEPageName) { Thread.Sleep(2500); hostPEPageName = hostPEPageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/host/professionalfeatures/" + hostPEPageName + ".aspx"); Thread.Sleep(1500); }
public void GivenThePageHasEditPermissionsSetForTheUserUser1(string pageName, string userName, string displayName) { IEInstance.GoTo(SiteUrl + "/admin/pages.aspx"); IEInstance.WaitForComplete(); PagesPage.EditPageGiveUserEditPermissions(pageName, userName, displayName); IEInstance.WaitForComplete(); }
public void WhenIClickTheRegisterLink() { if (HomePage.RegisterLink.Text != "Login") { IEInstance.GoTo(SiteUrl + "/logoff.aspx"); } HomePage.RegisterLink.Click(); }
public void GivenThePageHasEditPermissionsSetForTheUserUser1(string pageName, string userName, string displayName) { Thread.Sleep(1500); IEInstance.GoTo(SiteUrl + "/admin/pages.aspx"); Thread.Sleep(1500); PagesPage.EditPageGiveUserEditPermissions(pageName, userName, displayName); Thread.Sleep(1500); }
public void ILogOff() { if (IEInstance != null) { IEInstance.GoTo(SiteUrl + "/logoff.aspx"); } Thread.Sleep(2000); }
public void GivenThePageHasPermissionSetForRole(string pageName, string permission, string setting, string roleName) { IEInstance.GoTo(SiteUrl + "/admin/pages.aspx"); IEInstance.WaitForComplete(); var adminPagesPage = GetPage <AdminPagesPage>(); adminPagesPage.SetPagePermissionForRole(setting, permission, pageName, roleName); IEInstance.WaitForComplete(); }
public void ResetPageQuota() { IEInstance.GoTo(SiteUrl + "/logoff.aspx"); GetPage <LoginPage>().LoginUser(TestUsers.Host.UserName, TestUsers.Host.Password, true, -1); IEInstance.GoTo(string.Format("{0}/Admin/SiteSettings.aspx", SiteUrl)); SiteSettingsPage.PageQuotaField.Value = "0"; SiteSettingsPage.UpdateLink.Click(); SiteSettingsPage.UpdateLink.WaitUntil(p => !Convert.ToBoolean(IEInstance.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"))); }
/// <summary> /// Enters the old password, new password and confirmation password on the update password form. /// </summary> /// <param name="oldPassword">The users old password.</param> /// <param name="newPassword">The users new password.</param> /// <param name="confirmPassword">The users new password.</param> public void UpdatePassword(string oldPassword, string newPassword, string confirmPassword) { OldPasswordField.Value = oldPassword; NewPasswordField.Value = newPassword; ConfirmPasswordField.Value = confirmPassword; UpdateButton.ClickNoWait(); System.Threading.Thread.Sleep(1000); IEInstance.GoTo(SiteUrl); }
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 GivenIHaveCreatedThePage(string pageName) { IEInstance.GoTo(SiteUrl + "/admin/pages.aspx"); IEInstance.WaitForComplete(); _pagesPage = GetPage <AdminPagesPage>(); if (!_pagesPage.PagesPanel.InnerHtml.Contains(pageName)) { _pagesPage.AddPage(pageName); IEInstance.WaitForComplete(); } }
public void ThenAsAnAnonymousUserOnThePageICanSeeTheModuleAndItsContent(string pageName, string moduleName, string moduleContent) { Thread.Sleep(1500); IEInstance.GoTo(SiteUrl); Thread.Sleep(1500); LoginPage.LogoffUser(); Thread.Sleep(1500); pageName = pageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/" + pageName + ".aspx"); WatiNAssert.AssertIsTrue(HomePage.HtmlModuleExistsOnPage(moduleName, moduleContent), "AnonUserCannotSeeModule.jpg"); }
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); }
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 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"); }
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 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 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 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"); }
/// <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 ThenTheLanguageFrancaisCanadaIsAddedToTheSite(string languageName) { Span flagSpan = LanguagePage.GetLanguageFlagSpanByLocaleName(languageName); IEInstance.WaitForComplete(); IEInstance.Refresh(); WatiNAssert.AssertIsTrue(flagSpan.Exists, "FlagSpanMissing2.jpg"); WatiNAssert.AssertIsTrue(flagSpan.ClassName.Equals("Language"), "FlagSpanError2.jpg"); IEInstance.GoTo(SiteUrl + "/logoff.aspx"); IEInstance.WaitForComplete(); flagSpan.Link(Find.Any).ClickNoWait(); IEInstance.WaitForComplete(); if (languageName.Contains("français")) { WatiNAssert.AssertIsTrue(HomePage.LoginLink.Text.ToLower().Contains("connexion"), "LoginLinkTextIncorrect.jpg"); WatiNAssert.AssertIsTrue(HomePage.RegisterLink.Text.ToLower().Contains("inscription"), "RegisterLinkTextIncorrect.jpg"); } Span originalFlag = LanguagePage.GetLanguageFlagSpanByLocaleName("English (United States)"); originalFlag.Link(Find.Any).ClickNoWait(); IEInstance.WaitForComplete(); }
public void GivenTheFollowingNewUserHasBeenCreated(Table table) { string username = table.Rows[0]["Value"]; string firstName = table.Rows[1]["Value"]; string lastName = table.Rows[2]["Value"]; string email = table.Rows[3]["Value"]; string password = table.Rows[4]["Value"]; string displayName = firstName + " " + lastName; IEInstance.GoTo(SiteUrl + "/admin/useraccounts.aspx"); IEInstance.WaitForComplete(); UserPage.AddNewUserStartLink.Click(); IEInstance.WaitForComplete(); UserPage.UserNameField.Value = username; UserPage.FirstNameField.Value = firstName; UserPage.LastNameField.Value = lastName; UserPage.DisplayNameField.Value = displayName; UserPage.EmailField.Value = email; UserPage.PasswordField.Value = password; UserPage.ConfirmPasswordField.Value = password; UserPage.AddNewUserLink.Click(); IEInstance.WaitForComplete(); }
public void GivenIAmViewingThePage(string pageName) { Thread.Sleep(1500); pageName = pageName.Replace(" ", ""); IEInstance.GoTo(SiteUrl + "/" + pageName + ".aspx"); }
public void WhenIBrowseTo(string url) { IEInstance.GoTo("http://" + url); IEInstance.WaitForComplete(); }
public void WhenINavigateToHomePage() { IEInstance.GoTo(string.Format("http://{0}/Home.aspx", SiteUrl)); }
public void ThenIShouldNotBeLoggedIn() { IEInstance.GoTo(SiteUrl); WatiNAssert.AssertIsTrue(HomePage.LoginLink.Text.Equals("Login"), "UserLoggedIn.jpg"); }
public void WhenIBrowseTo(string url) { Thread.Sleep(2500); IEInstance.GoTo("http://" + url); Thread.Sleep(2500); }