コード例 #1
0
        public void GivenUserIsRegisteredInHabitatAndLoggedOut(Table table)
        {
            //Go to Register page
            this.commonLocators.NavigateToPage(BaseSettings.RegisterPageUrl);
            //Enter data to the fields
            var row = table.Rows.First();

            foreach (var key in row.Keys)
            {
                this.commonLocators.RegisterPageFields.GetField(key).SendKeys(row[key]);
            }
            //Following code will remove create user from DB after use case ends

            cleanupPool.Add(new TestCleanupAction
            {
                ActionType = ActionType.RemoveUser,
                Payload    = "extranet\\" + row["Email"]
            });
            //Click Register button
            this.commonLocators.SubmitButton.Click();
            //Actor selects user dialog
            this.commonLocators.UserIcon.Click();
            //Actor clicks Logout button
            var btn      = "Logout";
            var elements = this.commonLocators.UserIconButtons.First(el => el.Text.Equals(btn, StringComparison.InvariantCultureIgnoreCase));

            elements.Click();
        }
コード例 #2
0
        public void WhenActorEntersFollowingDataInToTheRegisterFields(Table table)
        {
            var row = table.Rows.First();

            foreach (var key in row.Keys)
            {
                SiteBase.RegisterPageFields.GetField(key).SendKeys(row[key]);
            }
            //Following code will remove create user from DB after use case ends
            cleanupPool.Add(new TestCleanupAction
            {
                ActionType = ActionType.RemoveUser,
                Payload    = "extranet\\" + row["Email"]
            });
        }
コード例 #3
0
        public void RolesSetup()
        {
            var templateId = ContextExtensions.UtfService.CreateItem("tempTemplate" + DateTime.Now.Millisecond, "/sitecore/templates", "/sitecore/templates/System/Templates/Template");

            //set base templates with applied habitat security
            ContextExtensions.UtfService.EditItem(templateId, "__base template", this.Settings.RolesTemplates);

            var itemId = ContextExtensions.UtfService.CreateItem("tmpItem" + DateTime.Now.Millisecond, "/sitecore/content/Habitat", templateId);

            //get all available field from base templates
            var fields = this.Settings.RolesTemplates.Split('|')
                         .SelectMany(x => ContextExtensions.UtfService
                                     .GetChildren(x, false)
                                     .SelectMany(child => ContextExtensions.UtfService.GetChildren(child, false)));

            this.scenarioContext.Set(fields, "fields");
            this.scenarioContext.Set(itemId, "item");


            cleanupPool.Add(new TestCleanupAction
            {
                ActionType = ActionType.DeleteItem,
                Payload    = new EditFieldPayload
                {
                    ItemIdOrPath = itemId
                }
            });
            cleanupPool.Add(new TestCleanupAction
            {
                ActionType = ActionType.DeleteItem,
                Payload    = new EditFieldPayload
                {
                    ItemIdOrPath = templateId
                }
            });
        }