Пример #1
0
 public static void CreateFeature(RemoteWebDriver browser, string featureName, string vendorName)
 {
     browser.FindElementByCssSelector("a[href='/Feature']").Click();
     browser.FindElementByCssSelector("a[href='/Feature/Create']").Click();
     browser.FindElementByCssSelector("input#Feature_FeatureName").SendKeys(featureName);
     SiteUtil.SetValueForChosenJQueryControl(browser, "#Feature_VendorId_chzn", vendorName);
     browser.FindElementByCssSelector("form[action='/Feature/Create'] input[type='submit']").Click();
     browser.FindElementByCssSelector(".success");
 }
Пример #2
0
        public static void CreateAccountRightsFor(RemoteWebDriver browser, string userEmail, ObjectTypes objectType, string objectName)
        {
            browser.FindElementByCssSelector("a[href='/Account']").Click();
            var vendorUserRow =
                browser.FindElementByLinkText(userEmail).FindElement(By.XPath("./ancestor::tr"));

            vendorUserRow.FindElement(By.CssSelector("a[href^='/Account/Edit']")).Click();

            browser.FindElementByCssSelector("a[href^='/AccountRights/Create'][href$='" + Enum.GetName(typeof(ObjectTypes), objectType) + "']").Click();

            SiteUtil.SetValueForChosenJQueryControl(browser, "#ObjectId_chzn", objectName);
            browser.FindElementByCssSelector("form[action^='/AccountRights/Create'] input[type='submit']").Click();
            browser.FindElementByCssSelector(".success");
        }
Пример #3
0
        public static void CreateLicense(RemoteWebDriver browser, string skuCode, string customerName)
        {
            browser.FindElementByCssSelector("a[href='/License']").Click();
            browser.FindElementByCssSelector("a[href='/License/Create']").Click();
            SiteUtil.SetValueForChosenJQueryControl(browser, "#License_SkuId_chzn", skuCode);
            SiteUtil.SetValueForChosenJQueryControl(browser, "#License_PurchasingCustomerId_chzn", customerName);
            browser.FindElementByCssSelector("input#License_OwnerName").SendKeys(customerName);
            SiteUtil.SetValueForChosenJQueryControl(browser, "#License_OwningCustomerId_chzn", customerName);

            SiteUtil.SetDateValueForJQueryDatepicker(browser, "input#License_LicenseIssued", DateTime.Now);
            SiteUtil.SetDateValueForJQueryDatepicker(browser, "input#License_LicenseExpires", DateTime.Now + TimeSpan.FromDays(100));

            browser.FindElementByCssSelector("input[type='submit'][value='Create License']").Click();
            browser.FindElementByCssSelector(".success");
        }
Пример #4
0
        public void Setup(KeyHubWebDriver site)
        {
            //  The vendor creates their user account
            SiteUtil.CreateLocalAccount(site, UserEmail, UserPassword);

            //  The admin makes that user account a vendor.
            using (var browser = BrowserUtil.GetBrowser())
            {
                browser.Navigate().GoToUrl(site.UrlFor("/"));
                SiteUtil.SubmitLoginForm(browser, "admin", "password");

                VendorName = AdminUtil.CreateVendor(browser);

                AdminUtil.CreateAccountRightsFor(browser, UserEmail, ObjectTypes.Vendor,
                                                 VendorName);
            }
        }
Пример #5
0
        public static void CreateSku(
            RemoteWebDriver browser,
            string skuCode,
            string vendorName,
            string featureName,
            bool canDeleteManualDomains = false)
        {
            browser.FindElementByCssSelector("a[href='/SKU']").Click();
            browser.FindElementByCssSelector("a[href='/SKU/Create']").Click();
            SiteUtil.SetValueForChosenJQueryControl(browser, "#SKU_VendorId_chzn", vendorName);
            browser.FindElementByCssSelector("input#SKU_SkuCode").SendKeys(skuCode);
            SiteUtil.SetValueForChosenJQueryControlMulti(browser, "#SKU_SelectedFeatureGUIDs_chzn", featureName);
            browser.FindElementByCssSelector("input#SKU_LicenseDuration").SendKeys("100");
            browser.FindElementByCssSelector("input#SKU_AutoDomainDuration").SendKeys("100");

            if (canDeleteManualDomains)
            {
                browser.FindElementByCssSelector("#cb_SKU_CanDeleteManualDomains").Click();
            }

            browser.FindElementByCssSelector("form[action='/SKU/Create'] input[type='submit']").Click();
            browser.FindElementByCssSelector(".success");
        }