public void SetCodeType(DiscountCodeType type) { switch (type) { case DiscountCodeType.DiscountCode: UIUtil.DefaultProvider.WaitForDisplayAndClick("ctl00_cphDialog_rblCodeTypes_0", LocateBy.Id); break; case DiscountCodeType.AccessCode: UIUtil.DefaultProvider.WaitForDisplayAndClick("ctl00_cphDialog_rblCodeTypes_1", LocateBy.Id); break; default: break; } }
public void VerifyCodeTypeAndName(DiscountCodeType codeType, string codeName) { string codeLinkLocator = ComposeCodeLinkLocator(codeName); //Get the code type title attribute locator string codeTypeTitleLocatorFormat = "{0}/../../td[1]"; string codeTypeTitleLocator = string.Format(codeTypeTitleLocatorFormat, codeLinkLocator); //Get the code type title attribute and verify whether it matches the right type string codeTypeTitle = UIUtil.DefaultProvider.GetAttribute(codeTypeTitleLocator, "title", LocateBy.XPath); if (codeType == DiscountCodeType.DiscountCode) { VerifyTool.VerifyValue("Discount code", codeTypeTitle, "The code type is : {0}"); } else { VerifyTool.VerifyValue("Access code", codeTypeTitle, "The code type is : {0}"); } VerifyTool.VerifyValue(codeName, UIUtil.DefaultProvider.GetText(codeLinkLocator, LocateBy.XPath), "The code name is : {0}"); }
public void SetCodeAndAddAnother(DiscountCodeType discountCodeType, string code, ChangePriceDirection changePriceDirection, ChangeType changeType, double discountPrice, int? limitNumber) { if (discountCodeType == DiscountCodeType.DiscountCode) { this.SetDiscountCodeAndAddAnother(code, changePriceDirection, changeType, discountPrice, limitNumber); } else { this.SetAccessCodeAndAddAnother(code, limitNumber); } }