コード例 #1
0
        public static bool login(this API_JPetStore jPetStore, string username, string password)
        {
            jPetStore.open("/shop/signonForm.do");
            var ie = jPetStore.ie;

            ie.field("username").value(username);
            ie.field("password").value(password);
            jPetStore.ie.buttons()[1].click();
            return(ie.IE.Html.contains("Invalid username or password. Signon failed."));
        }
コード例 #2
0
        public static API_JPetStore loginPlaceAnOrderAndGoToCheckout(this API_JPetStore jPetStore)
        {
            jPetStore.homePage();
            var ie = jPetStore.ie;

            ie.link("Enter the Store").click();
            var signOffLink = ie.links().where ((link) => link.url().contains("signonForm.do")).first();

            if (signOffLink.notNull())
            {
                signOffLink.click();
                ie.buttons()[1].click();
            }
            ie.links().where ((link) => link.url().contains("FISH"))[0].click();
            ie.link("FI-FW-01 ").click();
            ie.links().where ((link) => link.url().contains("addItemToCart"))[0].click();
            ie.links().where ((link) => link.url().contains("checkout.do"))[0].click();
            ie.links().where ((link) => link.url().contains("newOrder.do"))[0].click();
            return(jPetStore);
        }
コード例 #3
0
        public static API_JPetStore createAccount(this API_JPetStore jPetStore, string username, string password,
                                                  string firstName, string lastName, string address1,
                                                  string phone, string city, string state, string zip,
                                                  string country, string email)
        {
            jPetStore.open("/shop/newAccount.do");
            var ie = jPetStore.ie;

            ie.field("account.username").value(username);
            ie.field("account.password").value(password);
            ie.field("repeatedPassword").value(password);
            ie.field("account.firstName").value(firstName);
            ie.field("account.lastName").value(lastName);
            ie.field("account.address1").value(address1);
            ie.field("account.phone").value(phone);
            ie.field("account.city").value(city);
            ie.field("account.state").value(state);
            ie.field("account.zip").value(zip);
            ie.field("account.country").value(country);
            ie.field("account.email").value(email);
            ie.button("Save Account Information").click();
            return(jPetStore);
        }
コード例 #4
0
 public static API_JPetStore createAccount(this API_JPetStore jPetStore, string username, string password)
 {
     return(jPetStore.createAccount(username, password, username, 10.randomLetters(), 10.randomLetters(),
                                    10.randomLetters(), 10.randomLetters(), 10.randomLetters(),
                                    10.randomLetters(), 10.randomLetters(), 10.randomLetters()));
 }
コード例 #5
0
 public static API_JPetStore logout(this API_JPetStore jPetStore)
 {
     jPetStore.open("/shop/signoff.do");
     return(jPetStore);
 }
コード例 #6
0
 public static API_JPetStore login_DefaultValues(this API_JPetStore jPetStore)
 {
     jPetStore.open("/shop/signonForm.do");
     jPetStore.ie.buttons()[1].click();
     return(jPetStore);
 }
コード例 #7
0
 public static API_JPetStore homePage(this API_JPetStore jPetStore)
 {
     jPetStore.open("");
     return(jPetStore);
 }