class Test_itemCount(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.hp = HomePage(self.driver)
        self.lp = LoginPage(self.driver)
        self.pdp = ProductDetailsPage(self.driver)
        self.sp = ShoppingCartPage(self.driver)
        self.cp = CartPage(self.driver)

    @pytest.mark.run(order=1)
    def test_goToPDP(self):
        self.hp.goToLogin()
        credentials = json.loads(open('loginCredential.json').read())
        username = credentials.get('username')
        password = credentials.get('password')
        # l = [i for i in credentials.values()]
        self.lp.loginAmazon(username,password)
        self.hp.goToAmazonEcho()
        self.pdp.addToCart()
        self.sp.goToCart()
        before=self.cp.getTheQuantity()
        self.driver.back()
        self.driver.back()
        self.pdp.addToCart()
        self.sp.goToCart()
        after=self.cp.getTheQuantity()
        assert before<after,"Quantity is not incremented"
コード例 #2
0
class Test_productDetails(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.hp = HomePage(self.driver)
        self.lp = LoginPage(self.driver)
        self.pdp = ProductDetailsPage(self.driver)
        self.sp = ShoppingCartPage(self.driver)
        self.cp = CartPage(self.driver)
        self.dap = DeliveryAddressPage(self.driver)
        self.sop = ShippingOptionPage(self.driver)
        self.pp = PaymentPage(self.driver)

    @pytest.mark.run(order=1)
    def test_goToPDP(self):
        self.hp.goToLogin()
        credentials = json.loads(open('loginCredential.json').read())
        username = credentials.get('username')
        password = credentials.get('password')
        self.lp.loginAmazon(username, password)
        self.hp.goToAmazonEcho()
        self.pdp.addToCart()
        self.sp.goToCart()
        self.cp.proceedToCheckout()
        self.dap.goToAdress()
        self.sop.continueCheckout()
        self.pp.paymentDetails()
コード例 #3
0
 def classSetup(self, oneTimeSetUp):
     self.hp = HomePage(self.driver)
     self.lp = LoginPage(self.driver)
     self.pdp = ProductDetailsPage(self.driver)
     self.sp = ShoppingCartPage(self.driver)
     self.cp = CartPage(self.driver)
     self.dap = DeliveryAddressPage(self.driver)
     self.sop = ShippingOptionPage(self.driver)
     self.pp = PaymentPage(self.driver)
class Test_productDetails(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.hp = HomePage(self.driver)
        self.lp = LoginPage(self.driver)
        self.pdp = ProductDetailsPage(self.driver)
        self.sp = ShoppingCartPage(self.driver)
        self.cp = CartPage(self.driver)

    @pytest.mark.run(order=1)
    def test_goToPDP(self):
        self.hp.goToLogin()
        credentials = json.loads(open('loginCredential.json').read())
        username = credentials.get('username')
        password = credentials.get('password')
        self.lp.loginAmazon(username, password)
        self.hp.goToAmazonEcho()
        self.pdp.addToCart()
        self.sp.goToCart()
        before = self.cp.getTheTotalAmount()
        self.driver.close()
 def classSetup(self, oneTimeSetUp):
     self.hp = HomePage(self.driver)
     self.lp = LoginPage(self.driver)
     self.pdp = ProductDetailsPage(self.driver)
     self.sp = ShoppingCartPage(self.driver)
     self.cp = CartPage(self.driver)