Beispiel #1
0
        public static void CreateLocalAccount(KeyHubWebDriver site, string email, string password, Action <RemoteWebDriver> onFinish = null)
        {
            onFinish = onFinish ?? delegate(RemoteWebDriver browser)
            {
                WaitUntilUserIsLoggedIn(browser);
            };

            using (var browser = BrowserUtil.GetBrowser())
            {
                browser.Navigate().GoToUrl(site.UrlFor("Account/Register"));

                SubmitRegistrationForm(browser, email, password);

                onFinish(browser);
            }
        }
Beispiel #2
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);
            }
        }