Beispiel #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, "")
Beispiel #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.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), "")
Beispiel #3
0
    def runTest(self):
        self.homePage = HomePage(self.driver)
        self.homePage.click(Locators.HOME_MOBILE_LINK)

        self.mobile = Mobile(self.driver)
        self.mobile.click(Locators.MOBILE_ADDTOCART_IPHONE)

        self.cart = Cart(self.driver)
        pricebeforecoupon = self.cart.getText(Locators.CART_GRANDTOTAL)
        self.cart.enter_text(Locators.CART_COUPONCODE_INPUT,
                             TestData.CART_COUPONCODE)
        priceaftercoupon = self.cart.getText(Locators.CART_GRANDTOTAL)
        self.assertEqual(
            float(pricebeforecoupon[1:]) * (1 - TestData.CART_DISCOUNT),
            float(priceaftercoupon[1:]))
    def runTest(self):
        self.homePage = HomePage(self.driver)


        self.homePage.clickMobile();

        self.mobilePage = Mobile(self.driver)
        self.mobilePage.click(Locators.MOBILE_ADDTOCART_XPERIA)

        self.cartPage = Cart(self.driver)
        self.cartPage.enter_text(Locators.CART_INPUT_QTY,TestData.CART_QTY)
        self.cartPage.click(Locators.CART_UPDATE_QTY)
        self.assertIn(TestData.CART_MAXIMUMQTY_ALLOWED,self.cartPage.getText(Locators.CART_ERROR_MSG))
        
        self.cartPage.click(Locators.CART_EMPTYCART_BUTTON)
        self.assertIn(TestData.CART_CARTEMPTY,self.cartPage.getText(Locators.CART_EMPTYCART_MST))