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(); }
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"] }); }
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 } }); }