Ejemplo n.º 1
0
    def test_e2e(self):
        log = self.getLogger()
        homePage = HomePage(self.driver)
        checkoutpage = homePage.shopItem()
        log.info("getting all the card titles")
        cards = checkoutpage.getCardTitles()
        i = -1
        for card in cards:
            i = i + 1
            cardText = card.text
            log.info(cardText)
            if cardText == "Blackberry":
                checkoutpage.getCardFooter()[i].click()
        #1
        checkIns = CheckOutPage.getcheckIn(self)
        checkIns.click()

        #2
        confirmPage = CheckOutPage.checkOutItems(self)

        log.info("Entering country name as ind")
        locationin = ConfirmPage.getlocation(self)
        locationin.send_keys("ind")
        self.driver.find_element_by_id("country")
        time.sleep(7)
        self.verifyLinkPresence("India")

        self.driver.find_element_by_link_text("India").click()
        self.driver.find_element_by_xpath("//div[@class='checkbox checkbox-primary']").click()
        self.driver.find_element_by_css_selector("[type='submit']").click()
        textMatch = self.driver.find_element_by_css_selector("[class*='alert-success']").text
        log.info("Text received from application is "+textMatch)

        assert ("Success! Thank you!" in textMatch)
    def shopItem(self):

        self.driver.find_element(*HomePage.shop).click()

        checkout = CheckOutPage(self.driver)

        return checkout
Ejemplo n.º 3
0
    def shopItems(self):
        # self.driver.find_element_by_link_text("Shop")
        # return driver.find_element(*HomePage.shop)

        # driver.find_element_by_css_selector("a[href*='shop']")
        self.driver.find_element(*HomePage.shop).click()
        checkOutPage = CheckOutPage(self.driver)
        return checkOutPage
Ejemplo n.º 4
0
    def test_e2e(self):
        log = self.getLogger()
        homePage = HomePage(self.driver)
        homePage.shopItems()
        log.info("E2E - Shop menu Page is correctly opened")

        checkoutPage = CheckOutPage(self.driver)
        checkoutPage.clickAddCart()  #Add Cart button is clicked
        checkoutPage.openCheckoutPage()  #Open Checkout Page Opened
        checkoutPage.clickCheckOutbutton()  #CheckOut button is clicked
        log.info("E2E - Product is add to cart")

        confirmationPage = ConfirmationPage(self.driver)
        confirmationPage.inputLocation().send_keys("IND")
        #time.sleep(3)
        self.verifyLinkPresence("India")
        self.driver.find_element_by_link_text("India").click()
        log.info("E2E - INDIA is selected for the delivery")

        confirmationPage.clickPurchaseButton()  #Purchase button is clicked
        log.info("testE2E - Order Placed")
        log.info("E2E - Order is placed successfully")

        self.driver.quit()
Ejemplo n.º 5
0
 def shopItems(self):
     self.driver.find_element(
         *HomePage.shop).click()  # * is used to treat this as tuple
     checkOutPage = CheckOutPage(self.driver)
     return checkOutPage
Ejemplo n.º 6
0
 def shopItems(self):
     #return self.driver.find_element(*HomePage.shop) #shop is class variable , so we have to call class variable as className.variable
     # and star is because to deseriaize tuple items
     self.driver.find_element(*HomePage.shop).click()
     checkoutPage = CheckOutPage(self.driver)
     return checkoutPage