/// <summary> /// Updates the control panel style. /// </summary> /// <param name="style">The style to be used for the control panel.</param> public void UpdateControlPanelStyle(string style) { OtherSettingsTab.Click(); ControlPanelStyleSelectList.Select(style); UpdateLink.ClickNoWait(); System.Threading.Thread.Sleep(2000); }
/// <summary> /// Selects and updates the Default language for the site. /// This method will not work once content localization has been enabled. /// </summary> /// <param name="localeName">The name of the language as it will appear in the drop down.</param> /// <param name="selectListClass">The class to filter items by. /// The currently selected item will have the class "rcbHovered ", all others will have the class "rcbItem ".</param> public void SelectAndUpdateNewDefaultLanguage(string localeName, string selectListClass) { //Click the drop down Arrow DefaultLanguageDropDownLink.ClickNoWait(); //Find Item to Select //Find all List Item elements. ElementCollection SelectListElements = DefaultLanguageComboBoxDiv.Elements.Filter(Find.ByClass(selectListClass)); Element result = null; //Search for the desired Element foreach (Element e in SelectListElements) { if (e.InnerHtml.ToLower().Contains(localeName.ToLower())) { //Select the Element result = e; break; } continue; } result.FireEvent("onmouseover"); System.Threading.Thread.Sleep(1000); result.ClickNoWait(); UpdateLink.Click(); }
/// <summary> /// Creates a new role. /// Clicks the Add New Role link /// Enters the role name /// Clicks the update link /// </summary> /// <param name="roleName">The name for the new role.</param> public void AddRole(string roleName) { AddNewRoleLink.Click(); RoleNameField.Value = roleName; UpdateLink.ClickNoWait(); System.Threading.Thread.Sleep(1500); }
/// <summary> /// Creates a role group. /// Clicks the Add New Role Group link /// Enters the group name /// Clicks the update link /// </summary> /// <param name="groupName">The name for the role group.</param> public void AddRoleGroup(string groupName) { AddNewRoleGroupLink.Click(); RoleGroupNameField.Value = groupName; UpdateLink.Click(); System.Threading.Thread.Sleep(1000); }
/// <summary> /// Adds a new language from the language page (doesn't install any language pack). /// </summary> /// <param name="language">The name of the language. The name must match the text in the language drop down exactly.</param> /// <param name="fallbackLanguage">The name of the fallback language. The name must match the text in the language drop down exactly.</param> public void AddNewLanguage(string language, string fallbackLanguage) { AddNewLanguageLink.ClickNoWait(); System.Threading.Thread.Sleep(1000); SelectLanguage("Language", "rcbItem ", language); SelectLanguage("Fallback", "rcbItem ", fallbackLanguage); UpdateLink.Click(); }
/// <summary> /// Enters a valid email address for the host and then sets the schedular mode to Timer Method. /// </summary> /// <param name="hostEmail">A valid email address for the host.</param> public void SetSchedularToTimerMethod(string hostEmail) { HostEmailTextField.Value = "*****@*****.**"; //OtherSettingsExpandButton.Click(); AdvancedSettingsTab.Click(); SchedularModeSelectList.Select("Timer Method"); UpdateLink.Click(); }
/// <summary> /// Enters a valid email address for the host and then sets the SMTP server. /// All other SMTP settings will be set to the default. /// </summary> /// <param name="hostEmail">A valid email address for the host.</param> /// <param name="smtpServer">The SMTP server to test.</param> public void SetSMTPSettings(string hostEmail, string smtpServer) { HostEmailTextField.Value = hostEmail; //ExpandSMTPButton.ClickNoWait(); AdvancedSettingsTab.Click(); SMTPSettingsSectionLink.Click(); SMTPServerField.Value = smtpServer; UpdateLink.Click(); System.Threading.Thread.Sleep(2000); }
public IActionResult Webhook(int appId, [FromForm] PodioWebhook hook, [FromServices] VerifyWebhookCommand verifyCommand, [FromServices] CreateLink createLinkCommand, [FromServices] UpdateLink updateLinkCommand) { lock (PodioLock.Lock) { _syncService.HandlePodioHook(appId, hook, verifyCommand, createLinkCommand, updateLinkCommand).GetAwaiter().GetResult(); return(Ok()); } }
/// <summary> /// Adds a new vendor. /// Clicks the add new vendor link /// Fills in the new vendor field /// Clicks the update link /// The region field will be set to not required. /// </summary> /// <param name="vendorName">The company name.</param> /// <param name="vendorFName">The vendors first name.</param> /// <param name="vendorLname">The vendors last name.</param> /// <param name="vendorEmail">The vendors email.</param> /// <param name="vendorStreet">The vendors street address.</param> /// <param name="vendorCity">The vendors city.</param> /// <param name="vendorCountry">The vendors country.</param> /// <param name="vendorPostalCode">The vendors postal code.</param> /// <param name="vendorPhoneNumber">The vendors phone number. This number will be used for their Telephone, cell phone and fax numbers.</param> public void AddNewVendor(string vendorName, string vendorFName, string vendorLname, string vendorEmail, string vendorStreet, string vendorCity, string vendorCountry, string vendorPostalCode, string vendorPhoneNumber) { AddNewVendorLink.Click(); CompanyNameField.Value = vendorName; FirstNameField.Value = vendorFName; LastNameField.Value = vendorLname; EmailField.Value = vendorEmail; StreetField.Value = vendorStreet; CityField.Value = vendorCity; CountrySelectList.Select(vendorCountry); System.Threading.Thread.Sleep(1500); RegionRequiredCheckbox.Checked = false; System.Threading.Thread.Sleep(1000); PostalCodeField.Value = vendorPostalCode; TelephoneField.Value = vendorPhoneNumber; CellphoneField.Value = vendorPhoneNumber; FaxField.Value = vendorPhoneNumber; UpdateLink.ClickNoWait(); }
private void btnAddUpdateLink_Click(object sender, EventArgs e) { string txtBadlink = txtUpdateLink.Text; List <UpdateLink> linkList = BLL.UpdateLink.Instance.GetList(); //BLL.UpdateLink.Instance.GetAll(); if (linkList.Exists(lk => lk.PUrl == txtBadlink)) { MessageBox.Show("该网址已经存在!"); return; } int timespan = int.Parse(drpTimeSpanUpdate.SelectedItem.ToString()); if (!string.IsNullOrEmpty(txtBadlink)) { Entity.UpdateLink md = new UpdateLink(); md.PUrl = txtBadlink; md.LastTestDate = DateTime.Now; md.TimeSpan = timespan; BLL.UpdateLink.Instance.Add(md); BindUpdateLink(); } }
/// <summary> /// Updates the control panel style to Classic. /// </summary> public void UpdateControlPanelToClassic() { ControlPanelStyleSelectList.Select("CLASSIC"); UpdateLink.Click(); System.Threading.Thread.Sleep(2000); }
public async Task <IActionResult> Webhook(AzureItem item, [FromServices] CreateSyncEvent createSyncEvent, [FromServices] UpdateLink updateLink) { var link = _queryDb.Links.SingleOrDefault(x => x.AzureId == item.Resource.WorkItemId); if (link == null || link.AzureRevision >= item.Resource.Rev) { return(Ok()); } VssConnection connection = new VssConnection(new Uri(_options.AzureOptions.ProjectUrl), new VssBasicCredential(string.Empty, _options.AzureOptions.AccessToken));; WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>(); switch (item.EventType) { case "workitem.updated": if (item.Resource.Fields.Keys.Any(x => x == "System.State")) { var podio = new Podio(_options.PodioOptions.ClientId, _options.PodioOptions.ClientSecret); var app = _queryDb.PodioApps.SingleOrDefault(x => x.Id == link.PodioAppId); await podio.AuthenticateWithApp(app.PodioAppId, app.AppToken); var mapping = _queryDb.FieldMappings.Include(x => x.CategoryMappings).FirstOrDefault(x => x.AzureFieldName == "System.State"); var azureValue = ((JsonElement)item.Resource.Fields.GetOrAddValue("System.State")).GetProperty("newValue").GetString(); var catMapping = mapping.CategoryMappings.FirstOrDefault(x => x.AzureValue == azureValue); if (catMapping == null) { return(Ok()); } var podioItem = new Item(); podioItem.ItemId = link.PodioId; var catField = podioItem.Field <CategoryItemField>(mapping.PodioFieldName); if (catField == null) { return(Ok()); } catField.OptionId = catMapping.PodioValueId; // Update revisions var podioRev = await podio.ItemService.UpdateItem(podioItem, hook : false); link.PodioRevision = podioRev.Value; link.AzureRevision = item.Resource.Rev; updateLink.InputModel = link; // Create sync event createSyncEvent.InputModel = new SyncEvent { AzureRevision = link.AzureRevision, PodioRevision = link.PodioRevision, SyncDate = DateTime.UtcNow, PodioAzureItemLinkId = link.Id, Initiator = Initiator.AzureHook }; createSyncEvent.Run(); } break; } return(Ok()); }
/// <summary> /// Select the update link /// </summary> public void SelectUpdate() { UpdateLink.Wait(3).Click(); }