Ejemplo n.º 1
0
    def runTest(self):
        self.homePage = HomePage(self.driver)
        self.homePage.click(Locators.HOME_ACCOUNT_BUTTON)
        self.homePage.click(Locators.HOME_MYACCOUNT_LINK)

        self.loginPage = Login(self.driver)
        self.loginPage.enter_text(Locators.LOGIN_EMAIL,
                                  TestData.CREATEACCOUNT_EMAIL)
        self.loginPage.enter_text(Locators.LOGIN_PASSWORD,
                                  TestData.CREATEACCOUNT_PASSWORD)
        self.loginPage.click(Locators.LOGIN_LOGIN_BUTTON)

        self.account = Account(self.driver)
        self.account.click(Locators.ACCOUNT_REORDER_LINK)

        self.cart = Cart(self.driver)
        preGrandTotal = self.cart.getText(Locators.CART_GRANDTOTAL)
        self.cart.enter_text(Locators.CART_INPUT_QTY, TestData.CART_QTY)
        self.cart.click(Locators.CART_UPDATE_QTY)
        postGrandTotal = self.cart.getText(Locators.CART_GRANDTOTAL)
        self.assertNotEqual(preGrandTotal, postGrandTotal)
        self.cart.click(Locators.CART_PROCEEDTOCHECKOUT_BUTTON)

        self.checkout = Checkout(self.driver)
        self.checkout.click(Locators.CHECKOUT_BILLINGINFO_CONTINUEBUTTON)
        self.checkout.click(Locators.CHECKOUT_SHIPPINGMETHOD_CONTINUEBUTTON)
        self.checkout.click(Locators.CHECKOUT_CHECKMONEY_RADIO)
        self.checkout.click(
            Locators.CHECKOUT_PAYMENTINFORMATION_CONTINUEBUTTON)
        self.checkout.click(Locators.CHECKOUT_PLACEORDER)

        self.typ = ThankYouPage(self.driver)
        orderNumber = self.typ.getText(Locators.THANKYPAGE_ORDERNUMBER)
        self.assertIsNot(orderNumber, "")
Ejemplo n.º 2
0
    def runTest(self):
        self.homePage = HomePage(self.driver)
        self.homePage.click(Locators.HOME_ACCOUNT_BUTTON)
        self.homePage.click(Locators.HOME_MYACCOUNT_LINK)

        self.loginPage = Login(self.driver)
        self.loginPage.click(Locators.LOGIN_CREATEACCOUNT_BUTTON)

        self.createAccount = CreateAccount(self.driver)
        self.createAccount.enter_text(Locators.CREATEACCOUNT_FIRSTNAME, TestData.CREATEACCOUNT_FISTNAME)
        self.createAccount.enter_text(Locators.CREATEACCOUNT_MIDDLENAME, TestData.CREATEACCOUNT_MIDDLENAME)
        self.createAccount.enter_text(Locators.CREATEACCOUNT_LASTNAME, TestData.CREATEACCOUNT_LASTNAME)
        self.createAccount.enter_text(Locators.CREATEACCOUNT_EMAIL, TestData.CREATEACCOUNT_EMAIL)
        self.createAccount.enter_text(Locators.CREATEACCOUNT_PASSWORD, TestData.CREATEACCOUNT_PASSWORD)
        self.createAccount.enter_text(Locators.CREATEACCOUNT_CONFIRMPASSWORD, TestData.CREATEACCOUNT_PASSWORD)
        self.createAccount.click(Locators.CREATEACCOUNT_REGISTER_BUTTON)
        self.assertIn(self.createAccount.getText(Locators.ACCOUNT_MSG), TestData.ACCOUNT_MSG)

        self.account = Account(self.driver)
        self.account.click(Locators.ACCOUNT_TV_LINK)

        self.tv = Tv(self.driver)
        self.tv.click(Locators.TV_WISHLIST_LGLCD_LINK)

        self.mywishlist = MyWishlist(self.driver)
        self.mywishlist.click(Locators.MYWISHLIST_SHAREWISHLIST_BUTTON)

        self.sharemywishlist = ShareWishlist(self.driver)
        self.sharemywishlist.enter_text(Locators.SHAREWISHLIST_EMAIL, TestData.SHAREWISHLIST_EMAIL)
        self.sharemywishlist.click(Locators.SHAREWISHLIST_BUTTON)
        self.assertIn(self.mywishlist.getText(Locators.MYWISHLIST_MSG), TestData.SHAREWISHLIST_MSG)
Ejemplo n.º 3
0
    def runTest(self):
        self.homePage = HomePage(self.driver)
        self.homePage.click(Locators.HOME_ACCOUNT_BUTTON)
        self.homePage.click(Locators.HOME_MYACCOUNT_LINK)

        self.loginPage = Login(self.driver)
        self.loginPage.enter_text(Locators.CREATEACCOUNT_EMAIL)
        self.loginPage.enter_text(Locators.CREATEACCOUNT_PASSWORD)
        self.loginPage.click(Locators.LOGIN_LOGIN_BUTTON)

        self.account = Account(self.driver)
        self.account.click(Locators.ACCOUNT_MYWISHLIST_LINK)

        self.mywishlist = MyWishlist(self.driver)
        self.mywishlist.click(Locators.MYWISHLIST_ADDTOCART_BUTTON)

        self.cart = Cart(self.driver)
        self.cart.setSelectorVisibleText(Locators.CART_COUNTRY_SELECTOR,
                                         TestData.CART_COUNTRY_SELECTOR)
        self.cart.setSelectorVisibleText(Locators.CART_REGION_SELECTOR,
                                         TestData.CART_STATE_SELECTOR)
        self.cart.enter_text(Locators.CART_ZIPCODE_INPUT, TestData.CART_ZIP)
        self.cart.click(Locators.CART_ESTIMATE_LINK)
        self.assertIn(Locators.CART_SHIPPINGCOST, TestData.CART_FLAT_RATE)
        self.cart.click(Locators.CART_RATE_RADIO)
        self.cart.click(Locators.CART_UPDATETOTAL_BUTTON)
        self.cart.click(Locators.CART_PROCEEDTOCHECKOUT_BUTTON)

        self.checkout = Checkout(self.driver)
        self.checkout.enter_text(Locators.CHECKOUT_FIRSTNAME,
                                 TestData.CREATEACCOUNT_FISTNAME)
        self.checkout.enter_text(Locators.CHECKOUT_LASTNAME,
                                 TestData.CREATEACCOUNT_LASTNAME)
        self.checkout.enter_text(Locators.CHECKOUT_ADDRESS,
                                 TestData.CHECKOUT_ADDRESS)
        self.checkout.enter_text(Locators.CHECKOUT_CITY,
                                 TestData.CHECKOUT_CITY)
        self.checkout.setSelectorVisibleText(Locators.CART_REGION_SELECTOR,
                                             TestData.CART_STATE_SELECTOR)
        self.checkout.enter_text(Locators.CHECKOUT_ZIP, TestData.CART_ZIP)
        self.checkout.setSelectorVisibleText(Locators.CART_COUNTRY_SELECTOR,
                                             TestData.CART_COUNTRY_SELECTOR)
        self.checkout.enter_text(Locators.CHECKOUT_TELEPHONE,
                                 TestData.CHECKOUT_TELEPHONE)
        self.checkout.click(Locators.CHECKOUT_BILLINGINFO_CONTINUEBUTTON)
        self.checkout.click(Locators.CHECKOUT_SHIPPINGMETHOD_CONTINUEBUTTON)
        self.checkout.click(Locators.CHECKOUT_CHECKMONEY_RADIO)
        self.checkout.click(
            Locators.CHECKOUT_PAYMENTINFORMATION_CONTINUEBUTTONA)
        self.checkout.click(Locators.CHECKOUT_PLACEORDER)

        self.thankpage = ThankYouPage(self.driver)
        self.assertNotEqual(
            self.thankpage.getText(Locators.THANKYPAGE_ORDERNUMBER), "")
Ejemplo n.º 4
0
    def runTest(self):
        self.homePage = HomePage(self.driver)
        self.homePage.click(Locators.HOME_ACCOUNT_BUTTON)
        self.homePage.click(Locators.HOME_MYACCOUNT_LINK)

        self.loginPage = Login(self.driver)
        self.loginPage.enter_text(Locators.LOGIN_EMAIL, TestData.CREATEACCOUNT_EMAIL)
        self.loginPage.enter_text(Locators.LOGIN_PASSWORD, TestData.CREATEACCOUNT_PASSWORD)
        self.loginPage.click(Locators.LOGIN_LOGIN_BUTTON)

        self.account = Account(self.driver)
        self.account.click(Locators.ACCOUNT_MYORDERS_LINK)

        self.myorders = MyOrders(self.driver)
        self.assertIn(self.myorders.getText(Locators.MYORDERS_STATUSFIRSTORDER), TestData.MYORDERS_PENDING_STATUS)
        self.myorders.click(Locators.MYORDERS_VIEWORDER_LINK)
        self.myorders.click(Locators.MYORDERS_FIRSTORDER)