def test_LUCI_GCD_013(self): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponConfigObj.update({'allow_multiple_vouchers_per_user' : True, 'do_not_resend_existing_voucher' : True}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) couponCode1, detailsDict = LuciHelper.issueCouponAndAssertions(self,couponSeriesId) issualStartTime1 = detailsDict['issuedDate'] issualEndTime1 = issualStartTime1 + 4000 # coupon Search and Assertion issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime1 - 2000), 'issualDateEnd' : (issualEndTime1 + 2000)}) issualFilterObj = {'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], issualFilterObj, [couponCode1]) time.sleep(4) couponCode2, detailsDict = LuciHelper.issueCouponAndAssertions(self,couponSeriesId) issualStartTime2 = detailsDict['issuedDate'] issualEndTime2 = issualStartTime2 + 4000 # coupon Search and Assertion issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime2-2000), 'issualDateEnd' : (issualEndTime2 + 2000)}) issualFilterObj = {'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], issualFilterObj, [couponCode2]) # coupon Search and Assertion issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime1-2000), 'issualDateEnd' : (issualEndTime2 + 2000)}) issualFilterObj = {'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], issualFilterObj, [couponCode1,couponCode2])
def test_LUCI_GCD_025(self): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponConfigObj.update({'allow_multiple_vouchers_per_user': True, 'do_not_resend_existing_voucher': True, 'redeem_at_store' : str([self.tillId])}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) couponCode1 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0] couponCode2 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0] transNum1 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode1)['transactionNumber'] time.sleep(1) self.billId = Utils.getTime(milliSeconds=True) transNum2 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode2)['transactionNumber'] # coupon Search and Assertion redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber': [transNum1]}) issualFilterObj = LuciObject.issualFilters({'redeemableAtStoreId': [self.storeId]}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1]) redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber': [transNum2]}) issualFilterObj = LuciObject.issualFilters({'redeemableAtStoreId': [self.storeId]}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode2]) redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber': [transNum1, transNum2]}) issualFilterObj = LuciObject.issualFilters({'redeemableAtStoreId': [self.storeId]}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1, couponCode2])
def test_LUCI_GCD_038_sanity_smoke(self,description): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponCode = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0] # Added Issue Filter issualFilterObj = LuciObject.issualFilters({'redeemableAtStoreId': [self.storeId]}) issualFilterObj = {'issualFilters': issualFilterObj} #coupon Search and Assertion LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], issualFilterObj, [couponCode])
def test_LUCI_GCD_012(self): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponConfigObj.update({'redeem_at_store' : str([self.tillId])}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) couponCode = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0] # Added Issue Filter issualFilterObj = LuciObject.issualFilters({'redeemableAtStoreId': [self.storeId]}) issualFilterObj = {'issualFilters': issualFilterObj} #coupon Search and Assertion LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], issualFilterObj, [couponCode])
def test_LUCI_GCD_024(self): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponConfigObj.update({'allow_multiple_vouchers_per_user': True, 'do_not_resend_existing_voucher': True}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) transactionId1 = Utils.getTime(milliSeconds=True); time.sleep(2) transactionId2 = Utils.getTime(milliSeconds=True); # Construct Obj and Issue Coupon Code issueCouponObj = {'couponSeriesRequired': True, 'billId': transactionId1} couponCode1 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId, issueCouponObj)[0] # Change Issue obj billId and Issue one more coupon issueCouponObj = {'couponSeriesRequired': True, 'billId': transactionId2} couponCode2 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId, issueCouponObj)[0] tempBill1 = self.billId LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode1) tempBill2 = self.billId = Utils.getTime(milliSeconds=True) LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode2) # coupon Search and Assertion redemptionFiltersObj = LuciObject.redemptionFilters({'transactionId' : [tempBill1]}) issualFilterObj = LuciObject.issualFilters({'transactionId': [transactionId1]}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1]) redemptionFiltersObj = LuciObject.redemptionFilters({'transactionId' : [tempBill2]}) issualFilterObj = LuciObject.issualFilters({'transactionId': [transactionId2]}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode2]) redemptionFiltersObj = LuciObject.redemptionFilters({'transactionId' : [tempBill1,tempBill2]}) issualFilterObj = LuciObject.issualFilters({'transactionId': [transactionId1, transactionId2]}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1, couponCode2])
def test_LUCI_GCD_021(self): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponConfigObj.update({'allow_multiple_vouchers_per_user': True, 'do_not_resend_existing_voucher': True}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) couponCode1, detailsDict = LuciHelper.issueCouponAndAssertions(self,couponSeriesId) issualStartTime1 = detailsDict['issuedDate'] issualEndTime1 = issualStartTime1 + 4000 Logger.log('Issued Date and Time : {} , EndTime : {}'.format(issualStartTime1,issualEndTime1)) # coupon Search and Assertion time.sleep(4) couponCode2, detailsDict = LuciHelper.issueCouponAndAssertions(self,couponSeriesId) issualStartTime2 = detailsDict['issuedDate'] issualEndTime2 = issualStartTime2 + 4000 redeemedDate1 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode1)['redemptionDate'] time.sleep(4) self.billId = Utils.getTime(milliSeconds=True) redeemedDate2 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode2)['redemptionDate'] # coupon Search and Assertion redemptionFiltersObj = LuciObject.redemptionFilters({'redemptionDateStart': (redeemedDate1 - 1000),'redemptionDateEnd': (redeemedDate1 + 1000)}) issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime1 - 1000), 'issualDateEnd': (issualEndTime1 + 1000)}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1]) redemptionFiltersObj = LuciObject.redemptionFilters({'redemptionDateStart': (redeemedDate2 - 1000),'redemptionDateEnd': (redeemedDate2 + 1000)}) issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime2 - 1000), 'issualDateEnd': (issualEndTime2 + 1000)}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode2]) redemptionFiltersObj = LuciObject.redemptionFilters({'redemptionDateStart': (redeemedDate1 - 1000),'redemptionDateEnd': (redeemedDate2 + 1000)}) issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime1 - 1000), 'issualDateEnd': (issualEndTime2 + 1000)}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1, couponCode2])
def test_LUCI_GCD_011_sanity(self): #Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) #Checking Coupon Created Count LuciHelper.queuePumpWait(self,couponSeriesId) createdCouponCount = LuciDBHelper.getCouponsCreated_Count(couponSeriesId) Assertion.constructAssertion(createdCouponCount != 0, 'Coupon Code Pumped to Queue') # change the coupon config couponConfigObj.update({'do_not_resend_existing_voucher' : True, 'allow_multiple_vouchers_per_user' : True}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) transactionId1 = Utils.getTime(milliSeconds=True); time.sleep(1) transactionId2 = Utils.getTime(milliSeconds=True); #Construct Obj and Issue Coupon Code issueCouponObj ={'couponSeriesRequired': True, 'billId' : transactionId1} couponCode1 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId,issueCouponObj)[0] #Change Issue obj billId and Issue one more coupon issueCouponObj = {'couponSeriesRequired': True, 'billId': transactionId2} couponCode2 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId, issueCouponObj)[0] # Added Issue Filter & Search Coupon 1 issualFilterObj = LuciObject.issualFilters({'transactionId' : [transactionId1]}) issualFilterObj = {'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId],issualFilterObj ,[couponCode1]) #Added Issue Filter & Search Coupon 2 issualFilterObj = LuciObject.issualFilters({'transactionId': [transactionId2]}) issualFilterObj = {'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], issualFilterObj, [couponCode2]) # Added Issue Filter & Search Coupon 3 issualFilterObj = LuciObject.issualFilters({'transactionId': [transactionId1 , transactionId2]}) issualFilterObj = {'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId],issualFilterObj, [couponCode1,couponCode2])
def test_LUCI_GCD_022(self): # Save Coupon Config couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self) couponConfigObj.update({'allow_multiple_vouchers_per_user': True, 'do_not_resend_existing_voucher': True}) LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj) couponCode1, detailsDict = LuciHelper.issueCouponAndAssertions(self,couponSeriesId) issualStartTime1 = detailsDict['issuedDate'] issualEndTime1 = issualStartTime1 + 1000 # coupon Search and Assertion time.sleep(4) couponCode2, detailsDict = LuciHelper.issueCouponAndAssertions(self,couponSeriesId) issualStartTime2 = detailsDict['issuedDate'] issualEndTime2 = issualStartTime2 + 1000 transNum1 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode1)['transactionNumber'] self.billId = Utils.getTime(milliSeconds=True) transNum2 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode2)['transactionNumber'] # coupon Search and Assertion redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber' : [transNum1]}) issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime1), 'issualDateEnd': (issualEndTime1)}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1]) redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber' : [transNum2]}) issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime2), 'issualDateEnd': (issualEndTime2)}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode2]) redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber' : [transNum1,transNum2]}) issualFilterObj = LuciObject.issualFilters({'issualDateStart': (issualStartTime1), 'issualDateEnd': (issualEndTime2)}) couponSearchRequest = {'redemptionFilters': redemptionFiltersObj, 'issualFilters': issualFilterObj} LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], couponSearchRequest, [couponCode1, couponCode2])