示例#1
0
 def getProducts_json(self):
     products = []
     data = Utility.read_json(Data.PRODUCTS_JSON_FILE)
     for item in data['products']:
         product = Product(item['name'], item['desc'], item['price'])
         products.append(product)
     return products
示例#2
0
 def read_products_from_json(sefl):
     products = []
     data = Utility.read_json(Data.PRODUCT_FILE)
     for item in data['products']:
         product = Product(item['name'], item['desc'], item['price'])
         products.append(product)
     return products
示例#3
0
    def get_product_info(self, index):
        name = self.get_text(CartPageLocators.LABEL_PRODUCT_NAME(index))
        desc = self.get_text(CartPageLocators.LABEL_PRODUCT_DESC(index))
        price = self.get_text(CartPageLocators.LABEL_PRODUCT_PRICE(index))
        quantity = self.get_text(CartPageLocators.LABEL_PRODUCT_QUANTITY(index))

        return Product(name, desc, price, quantity)
示例#4
0
    def get_product_info(self, index):
        name = self.get_text(ProductsPageLocators.LABEL_PRODUCT_NAME(index))
        desc = self.get_text(ProductsPageLocators.LABEL_PRODUCT_DESC(index))
        price = self.get_text(ProductsPageLocators.LABEL_PRODUCT_PRICE(index))

        product = Product(name, desc, price)
        print(product)
        return product
示例#5
0
 def get_product_info(self, index):
     name = self.get_text(CheckOutStepTwoLocators.LABEL_PRODUCT_NAME(index))
     desc = self.get_text(CheckOutStepTwoLocators.LABEL_PRODUCT_DESCRIPTION(index))
     price = self.get_text(CheckOutStepTwoLocators.LABEL_PRODUCT_PRICE(index))
     product = Product(name, desc, price)
     return product