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
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
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)
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
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