示例#1
0
 public void WhenINavigateToTheAdminPage(string adminPageName)
 {
     Thread.Sleep(2500);
     adminPageName = adminPageName.Replace(" ", "");
     IEInstance.GoTo(SiteUrl + "/admin/" + adminPageName + ".aspx");
     Thread.Sleep(2500);
 }
示例#2
0
 public void IAmOnTheHostPage(string hostPageName)
 {
     Thread.Sleep(2500);
     hostPageName = hostPageName.Replace(" ", "");
     IEInstance.GoTo(SiteUrl + "/host/" + hostPageName + ".aspx");
     Thread.Sleep(1500);
 }
示例#3
0
 public void GivenIAmOnTheHostProFeaturePagePage(string hostPEPageName)
 {
     Thread.Sleep(2500);
     hostPEPageName = hostPEPageName.Replace(" ", "");
     IEInstance.GoTo(SiteUrl + "/host/professionalfeatures/" + hostPEPageName + ".aspx");
     Thread.Sleep(1500);
 }
示例#4
0
 public void GivenThePageHasEditPermissionsSetForTheUserUser1(string pageName, string userName, string displayName)
 {
     IEInstance.GoTo(SiteUrl + "/admin/pages.aspx");
     IEInstance.WaitForComplete();
     PagesPage.EditPageGiveUserEditPermissions(pageName, userName, displayName);
     IEInstance.WaitForComplete();
 }
示例#5
0
 public void WhenIClickTheRegisterLink()
 {
     if (HomePage.RegisterLink.Text != "Login")
     {
         IEInstance.GoTo(SiteUrl + "/logoff.aspx");
     }
     HomePage.RegisterLink.Click();
 }
示例#6
0
 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);
 }
示例#7
0
 public void ILogOff()
 {
     if (IEInstance != null)
     {
         IEInstance.GoTo(SiteUrl + "/logoff.aspx");
     }
     Thread.Sleep(2000);
 }
示例#8
0
        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();
        }
示例#9
0
 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();")));
 }
示例#10
0
 /// <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);
 }
示例#11
0
        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");
        }
示例#12
0
 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();
     }
 }
示例#13
0
 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");
 }
示例#14
0
        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);
        }
示例#15
0
        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();
        }
示例#16
0
 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");
 }
示例#17
0
        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);
        }
示例#18
0
        public void CloseWindowAfterScenario()
        {
            var closeWindow = Convert.ToBoolean(ConfigurationManager.AppSettings["CloseWindow"]);

            if (closeWindow)
            {
                if (IEInstance != null)
                {
                    IEInstance.GoTo(SiteUrl + "/logoff.aspx");
                    IEInstance.Close();
                }
            }
        }
示例#19
0
 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);
 }
示例#20
0
        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");
        }
示例#21
0
        /// <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;
        }
示例#22
0
 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");
 }
示例#23
0
        /// <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);
        }
示例#24
0
        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();
        }
示例#25
0
        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();
        }
示例#26
0
 public void GivenIAmViewingThePage(string pageName)
 {
     Thread.Sleep(1500);
     pageName = pageName.Replace(" ", "");
     IEInstance.GoTo(SiteUrl + "/" + pageName + ".aspx");
 }
示例#27
0
 public void WhenIBrowseTo(string url)
 {
     IEInstance.GoTo("http://" + url);
     IEInstance.WaitForComplete();
 }
示例#28
0
 public void WhenINavigateToHomePage()
 {
     IEInstance.GoTo(string.Format("http://{0}/Home.aspx", SiteUrl));
 }
示例#29
0
 public void ThenIShouldNotBeLoggedIn()
 {
     IEInstance.GoTo(SiteUrl);
     WatiNAssert.AssertIsTrue(HomePage.LoginLink.Text.Equals("Login"), "UserLoggedIn.jpg");
 }
示例#30
0
 public void WhenIBrowseTo(string url)
 {
     Thread.Sleep(2500);
     IEInstance.GoTo("http://" + url);
     Thread.Sleep(2500);
 }