Exemple #1
0
    def test_LUCI_GCD_016(self):
        # Save Coupon Config
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)

        couponConfigObj.update({'allow_multiple_vouchers_per_user': True, 'do_not_resend_existing_voucher': True,
                                'same_user_multiple_redeem': True, 'multiple_use': True})
        LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj)

        couponCode1 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0]
        couponCode2 = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0]

        redeemedDate1 = LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode1)['redemptionDate']
        time.sleep(2)
        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)})
        redemptionFiltersObj = {'redemptionFilters': redemptionFiltersObj}
        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], redemptionFiltersObj, [couponCode1])

        redemptionFiltersObj = LuciObject.redemptionFilters({'redemptionDateStart': (redeemedDate2 - 1000),'redemptionDateEnd': (redeemedDate2 + 1000)})
        redemptionFiltersObj = {'redemptionFilters': redemptionFiltersObj}
        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], redemptionFiltersObj, [couponCode2])

        redemptionFiltersObj = LuciObject.redemptionFilters({'redemptionDateStart': (redeemedDate1 - 1000),'redemptionDateEnd': (redeemedDate2 + 1000)})
        redemptionFiltersObj = {'redemptionFilters': redemptionFiltersObj}
        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], redemptionFiltersObj, [couponCode1, couponCode2])
Exemple #2
0
    def test_LUCI_GCD_015(self):
        # Save Coupon Config
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)

        couponConfigObj.update({'allow_multiple_vouchers_per_user' : True, 'do_not_resend_existing_voucher' : True,
                                'same_user_multiple_redeem' : True,'multiple_use' : True})
        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']

        time.sleep(1)
        # coupon Search and Assertion
        redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber' : [transNum1]})
        redemptionFiltersObj = {'redemptionFilters' : redemptionFiltersObj}
        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], redemptionFiltersObj, [couponCode1])

        redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber' : [transNum2]})
        redemptionFiltersObj = {'redemptionFilters' : redemptionFiltersObj}
        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], redemptionFiltersObj, [couponCode2])

        redemptionFiltersObj = LuciObject.redemptionFilters({'transactionNumber' : [transNum1,transNum2]})
        redemptionFiltersObj = {'redemptionFilters' : redemptionFiltersObj}
        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId], redemptionFiltersObj, [couponCode1, couponCode2])
 def test_LUCI_RC_DCP_019(self,description):
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self,)
     LuciHelper.queuePumpWait(self, couponSeriesId)
     LuciHelper.couponPumpAssertion(self, couponSeriesId)
     couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, isRedeem=False)
     LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 0)
    def test_LUCI_SCC_031_sanity(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self)
        LuciHelper.queuePumpWait(self, couponSeriesId)
        createdCouponCount = LuciDBHelper.getCouponsCreated_Count(
            couponSeriesId)
        Assertion.constructAssertion(createdCouponCount != 0,
                                     'Coupon Code Pumped to Queue')
        couponConfigObj.update(
            {'description': 'luci testing description changed'})
        couponConfigObj = LuciHelper.saveCouponConfigAndAssertions(
            self, couponConfigObj)[0]
        couponCode = LuciHelper.issueCouponAndAssertions(self,
                                                         couponSeriesId)[0]
        LuciHelper.redeemCouponAndAssertions(self, [couponSeriesId],
                                             [couponCode])
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 1)

        #Changing client-handling-type
        couponConfigObj.update({'client_handling_type': 'DISC_CODE_PIN'})
        LuciHelper.saveCouponConfigAndAssertions(self, couponConfigObj)
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 1)
        time.sleep(2)
        createdCouponCount = LuciDBHelper.getCouponsCreated_Count(
            couponSeriesId, 1)
        Assertion.constructAssertion(
            createdCouponCount == 0,
            'Config changed as DC to DCP and Coupon codes marked as invalid ')
 def test_LUCI_RC_DCP_018_sanity(self, description):
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self,
         couponConfigReq={
             'client_handling_type': 'DISC_CODE_PIN',
             'multiple_use': True,
             'same_user_multiple_redeem': True,
             'do_not_resend_existing_voucher': True,
             'allow_multiple_vouchers_per_user': True,
             'max_redemptions_in_series_per_user': 2
         })
     couponCode = LuciHelper.uploadCouponAndAssertions(
         self, couponSeriesId,
         self.constructObj.importType['NONE'])['coupons'][0]
     LuciHelper.issueCouponAndAssertions(self, couponSeriesId)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     couponDetails = LuciHelper.redeemCouponAndAssertions(self,
                                                          couponSeriesId,
                                                          couponCode,
                                                          isRedeem=False)
     CouponRedemptionCount = couponDetails['redemptionCountDetails'][
         0].__dict__
     Assertion.constructAssertion(
         CouponRedemptionCount['redemptionCount'] == 1,
         'Coupon Redemption Count Actual: {} and Expected: {}'.format(
             CouponRedemptionCount['redemptionCount'], 1))
     Assertion.constructAssertion(
         CouponRedemptionCount['userId'] == self.userId,
         'Redemption userId Actual: {} and Expected: {}'.format(
             CouponRedemptionCount['userId'], self.userId))
     LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 1)
Exemple #6
0
    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])
Exemple #7
0
    def test_LUCI_EI_013_02(self, description):
        config = {
            'client_handling_type': 'DISC_CODE_PIN',
            'any_user': False,
            'isExternalIssual': False
        }
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self, couponConfigReq=config)
        LuciHelper.uploadCouponAndAssertions(
            self,
            couponSeriesId,
            self.constructObj.importType['NONE'],
            noOfCouponsToBeUpload=10,
            dracraysUpload={'couponCodeCAPS': False})

        time.sleep(10)

        queueSize = LuciHelper.getQueueSize(self, couponSeriesId)
        Assertion.constructAssertion(
            queueSize == 10,
            'External Coupons not pumped to Queue Actual: {}'.format(
                queueSize))

        couponCode, _ = LuciHelper.issueCouponAndAssertions(
            self, couponSeriesId)
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
Exemple #8
0
    def test_downloadCoupon_Generic(self, description):
        try:
            couponCode = LuciHelper.generateCouponCode()
            couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
                self, {
                    'client_handling_type': 'GENERIC',
                    'genericCode': couponCode
                })

            couponCode1 = LuciHelper.issueCouponAndAssertions(
                self, couponSeriesId)[0]
            self.userId = constant.config['usersInfo'][1]['userId']
            couponCode2 = LuciHelper.issueCouponAndAssertions(
                self, couponSeriesId)[0]
            DracarysHelper.downloadCouponsRequestAndAssertion(
                self, couponSeriesId,
                self.DracarysObj.DownloadReportType['ISSUED'],
                [couponCode1, couponCode2])
            LuciHelper.redeemCouponAndAssertions(self, couponSeriesId,
                                                 couponCode)
            DracarysHelper.downloadCouponsRequestAndAssertion(
                self, couponSeriesId,
                self.DracarysObj.DownloadReportType['REDEEMED'], [couponCode])
        finally:
            self.userId = constant.config['usersInfo'][0]['userId']
 def test_LUCI_RC_DC_015(self,description, couponConfig, expectedError):
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self, couponConfigReq=couponConfig)
     LuciHelper.queuePumpWait(self, couponSeriesId)
     LuciHelper.couponPumpAssertion(self, couponSeriesId)
     couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
     #Coupon Redemption
     self.userId = constant.config['usersInfo'][1]['userId']
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, error=expectedError)
Exemple #10
0
    def test_LUCI_EI_013(self, description, config):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self, couponConfigReq=config)
        Assertion.constructAssertion(
            LuciDBHelper.isExternalCouponSeries(couponSeriesId),
            'Client handling type isExternal Enabled for coupon series id: {}'.
            format(couponSeriesId))
        Assertion.constructAssertion(
            couponConfigObj['client_handling_type'] == 'DISC_CODE_PIN',
            'External coupon series Client handling type Matched Actual: {} and Expected: {}'
            .format(couponConfigObj['client_handling_type'], 'DISC_CODE_PIN'))

        couponCodeList = LuciHelper.uploadCouponAndAssertions(
            self,
            couponSeriesId,
            self.constructObj.importType['NONE'],
            noOfCouponsToBeUpload=10,
            dracraysUpload={'couponCodeCAPS': False})['coupons']
        queueSize = LuciHelper.getQueueSize(self, couponSeriesId)
        Assertion.constructAssertion(
            queueSize == 0,
            'External Coupons not pumped to Queue Actual: {}'.format(
                queueSize))
        issuedCount = LuciDBHelper.getCouponsIssued_Count(couponSeriesId)
        Assertion.constructAssertion(
            issuedCount == 10,
            'Uploaded External Coupons & Issued DB count Matched Actual: {} and Expected: {}'
            .format(issuedCount, 10))
        LuciHelper.redeemCouponAndAssertions(self,
                                             couponSeriesId,
                                             couponCodeList[0],
                                             couponIssuedTo=[-1])
        couponConfigObj.update({'any_user': False, 'isExternalIssual': False})
        LuciHelper.saveCouponConfigAndAssertions(
            self, couponConfigReq=couponConfigObj)

        LuciHelper.uploadCouponAndAssertions(
            self,
            couponSeriesId,
            self.constructObj.importType['NONE'],
            noOfCouponsToBeUpload=10,
            dracraysUpload={'couponCodeCAPS': False})

        queueSize = LuciHelper.getQueueSize(self, couponSeriesId)
        Assertion.constructAssertion(
            queueSize == 10,
            'External Coupons not pumped to Queue Actual: {}'.format(
                queueSize))

        couponCode, _ = LuciHelper.issueCouponAndAssertions(
            self, couponSeriesId)
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
        queueSize = LuciHelper.getQueueSize(self, couponSeriesId)
        Assertion.constructAssertion(
            queueSize == 9,
            'External Coupons not pumped to Queue Actual: {}'.format(
                queueSize))
 def test_LUCI_RC_DC_016(self,description, couponConfig, expectedError):
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self, couponConfigReq=couponConfig)
     LuciHelper.queuePumpWait(self, couponSeriesId)
     LuciHelper.couponPumpAssertion(self, couponSeriesId)
     couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
     #Coupon Redemption
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, error=expectedError)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId)
 def test_LUCI_RC_DC_017(self,description, couponConfig, noOfRedeem):
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self, couponConfigReq=couponConfig)
     LuciHelper.queuePumpWait(self, couponSeriesId)
     LuciHelper.couponPumpAssertion(self, couponSeriesId)
     couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
     #Coupon Redemption
     for _ in range(noOfRedeem):
         LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId, noOfRedeem)
 def test_LUCI_RC_DC_020(self,description):
     #Save Coupon Config
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self,couponConfigReq={'redemption_valid_after_days' : 1, 'redemption_valid_from' : None})
     LuciHelper.queuePumpWait(self, couponSeriesId)
     couponCode, couponDetails = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)
     changeDate = Utils.getTime(days=-1, minutes=5,milliSeconds=True)
     self.connObj.changeCouponIssuedDate(couponDetails['id'], changeDate)
     #redeem Coupon and Assertion.constructAssertion(on)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId)
 def test_LUCI_RSD_001(self, description, couponConfig):
     couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, couponConfig)[1]
     couponCode = LuciHelper.issueCouponAndAssertions(self,
                                                      couponSeriesId)[0]
     LuciHelper.getCouponConfigAndAssertion(self,
                                            couponSeriesId,
                                            no_issued=1)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId, numRedeemed=1)
    def test_LUCI_RC_DCP_011_sanity_smoke(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self,
            couponConfigReq={
                'client_handling_type': 'DISC_CODE_PIN',
                'max_redeem': 10
            })

        #upload the coupon code
        couponCode = LuciHelper.uploadCouponAndAssertions(
            self, couponSeriesId,
            self.constructObj.importType['NONE'])['coupons'][0]
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 0, 0)

        #Check in issued table
        couponIssuedList = LuciDBHelper.getCouponsIssuedList(couponSeriesId)
        Assertion.constructAssertion(
            couponIssuedList == [], 'Issued Coupon recorded in coupons_issued')

        #Checking Queue count and coupons_created count once update DC -> DCP
        couponsCreatedList = LuciDBHelper.getCouponsCreated(couponSeriesId)
        Assertion.constructAssertion(
            couponsCreatedList != [],
            'Uploaded Coupons Added in Coupons_created table')
        Assertion.constructAssertion(
            len(couponsCreatedList) == 1,
            'Uploaded Coupon recorded in DB, Actual: {} and Expected : {}'.
            format(len(couponsCreatedList), 1))
        Assertion.constructAssertion(
            couponsCreatedList[0]['couponCode'] == couponCode,
            'Uploaded Coupon Code, Actual : {} and Expected : {}'.format(
                couponsCreatedList[0]['couponCode'], couponCode))

        #issueCode and Doing Assertion.constructAssertion(on)
        LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 0)
        # CouponDetails Request
        LuciHelper.getCouponDetailsAndAssertion(self,
                                                couponSeriesId,
                                                couponCode,
                                                couponDetailsRequest={
                                                    'onlyActive':
                                                    True,
                                                    'couponCodeFilter':
                                                    [couponCode]
                                                })
        #Coupon Redemption
        LuciHelper.redeemCouponAndAssertions(self,
                                             couponSeriesId,
                                             couponCode,
                                             isMaxRedeemSet=True)

        LuciHelper.redemptionDBAssertion(self, couponSeriesId)
        # Get Coupon Configuration
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 1)
Exemple #16
0
 def test_downloadCoupon_001_sanity(self, description):
     couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)[1]
     couponCode = LuciHelper.issueCouponAndAssertions(self,
                                                      couponSeriesId)[0]
     DracarysHelper.downloadCouponsRequestAndAssertion(
         self, couponSeriesId,
         self.DracarysObj.DownloadReportType['ISSUED'], [couponCode])
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     DracarysHelper.downloadCouponsRequestAndAssertion(
         self, couponSeriesId,
         self.DracarysObj.DownloadReportType['REDEEMED'], [couponCode])
    def test_LUCI_DC_013_sanity_smoke(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self,couponConfigReq={'client_handling_type' : 'DISC_CODE' , 'any_user' : True, 'min_bill_amount' : 1500 , 'max_bill_amount' : 999999999})
        time.sleep(2)
        couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
        couponCode = couponCode.lower()
        # CouponDetails Request
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, error=[900, 'bill amount less than the minimum limit set'])

        couponConfigObj.update({'min_bill_amount': 900})
        LuciHelper.saveCouponConfigAndAssertions(self, couponConfigReq=couponConfigObj)
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
 def test_LUCI_RSD_007(self, description, couponConfig):
     couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, couponConfig)[1]
     couponCode, couponDetails = LuciHelper.issueCouponAndAssertions(
         self, couponSeriesId)
     changeDate = Utils.getTime(days=-1, hours=-2, milliSeconds=True)
     self.connObj.changeCouponIssuedDate(couponDetails['id'], changeDate)
     LuciHelper.getCouponConfigAndAssertion(self,
                                            couponSeriesId,
                                            no_issued=1)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId, numRedeemed=1)
Exemple #19
0
 def test_LUCI_GCC_007(self, description):
     couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)[1]
     couponCode, couponDetailsFirst = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)
     redeemDetailsFirst = LuciHelper.redeemCouponAndAssertions(self,couponSeriesId,couponCode)
     time.sleep(5)
     self.userId = constant.config['usersInfo'][1]['userId']
     couponCode, couponDetailsLatest = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)
     redeemDetailsLatest = LuciHelper.redeemCouponAndAssertions(self,couponSeriesId,couponCode)
     config = LuciHelper.getCouponConfigAndAssertion(self,couponSeriesId,2,2)
     Assertion.constructAssertion(couponDetailsFirst['issuedDate'] != config['latestIssualTime'], 'Latest issual time is mismatch ' )
     Assertion.constructAssertion(redeemDetailsFirst['redemptionDate'] != config['latestRedemptionTime'], 'Latest redemption time is mismatch' )
     Assertion.constructAssertion(couponDetailsLatest['issuedDate'] == config['latestIssualTime'], 'Latest issual time in getCouponConfig' )
     Assertion.constructAssertion(redeemDetailsLatest['redemptionDate'] == config['latestRedemptionTime'], 'Latest redemption time in getCouponConfig' )
 def test_LUCI_RC_DCP_016(self, description, couponConfig, noOfRedeem):
     couponConfig.update({'client_handling_type': 'DISC_CODE_PIN'})
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, couponConfigReq=couponConfig)
     couponCode = LuciHelper.uploadCouponAndAssertions(
         self, couponSeriesId,
         self.constructObj.importType['NONE'])['coupons'][0]
     LuciHelper.issueCouponAndAssertions(self, couponSeriesId)
     #Coupon Redemption
     for _ in range(noOfRedeem):
         LuciHelper.redeemCouponAndAssertions(self, couponSeriesId,
                                              couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId, noOfRedeem)
    def test_LUCI_MU_001(self, description):
        toUserId = randValues.randomInteger(digits=6)
        actualUserId = self.userId
        try:
            couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
                self)
            LuciHelper.queuePumpWait(self, couponSeriesId)
            couponCode = LuciHelper.issueCouponAndAssertions(
                self, couponSeriesId)[0]

            mergeUserResponse = self.connObj.mergeUsers(
                fromUserId=self.userId,
                toUserId=toUserId,
                mergedbyTillId=self.tillId).__dict__
            Assertion.constructAssertion(
                mergeUserResponse['fromUserId'] == self.userId,
                'Merge From userId is Matched Actual: {} & Expected: {}'.
                format(mergeUserResponse['fromUserId'], self.userId))
            Assertion.constructAssertion(
                mergeUserResponse['toUserId'] == toUserId,
                'Merge to userId is Matched Actual: {} & Expected: {}'.format(
                    mergeUserResponse['toUserId'], toUserId))
            mergeStatus = mergeUserResponse['status'].__dict__
            Assertion.constructAssertion(
                mergeStatus['message'] == 'customer merge was successfull',
                'Merge status Msg Actual: {} & Expected: {}'.format(
                    mergeStatus['message'], 'customer merge was successfull'))
            Assertion.constructAssertion(
                mergeStatus['statusCode'] == constant.MERGE_SUCCESSFUL,
                'Merge status code Actual: {} & Expected: {}'.format(
                    mergeStatus['statusCode'], constant.MERGE_SUCCESSFUL))
            mergeStatus = self.connObj.getMergeStatus(
                fromUserId=self.userId, toUserId=toUserId).__dict__
            Assertion.constructAssertion(
                mergeStatus['message'] == 'customer is already merged',
                'Merge status Msg Actual: {} & Expected: {}'.format(
                    mergeStatus['message'], 'customer is already merged'))
            Assertion.constructAssertion(
                mergeStatus['statusCode'] == constant.MERGED_ALREADY_DONE,
                'Merge status code Actual: {} & Expected: {}'.format(
                    mergeStatus['statusCode'], constant.MERGED_ALREADY_DONE))
            LuciHelper.redeemCouponAndAssertions(
                self, [couponSeriesId], [couponCode],
                error=[
                    625, 'coupon not issued to this user redemption failed'
                ])
            self.userId = toUserId
            LuciHelper.redeemCouponAndAssertions(self, [couponSeriesId],
                                                 [couponCode])
        finally:
            self.userId = actualUserId
Exemple #22
0
    def test_LUCI_GCD_019(self):
        # Save Coupon Config
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)

        couponConfigObj.update({'allow_multiple_vouchers_per_user': True, 'do_not_resend_existing_voucher': True,
                                'same_user_multiple_redeem': True, 'multiple_use': True, })
        LuciHelper.saveCouponConfigAndAssertions(self,couponConfigObj)

        #issue and redeem the coupon code
        couponCode = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0]
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)

        LuciHelper.couponSearchAndAssertion(self, [couponSeriesId],{'couponStatus': [self.constructObj.couponStatus['REDEEMED']],
                                          'sort': self.constructObj.sort['DESC']}, [couponCode])
 def test_LUCI_RC_DCP_014(self, description, couponConfig, expectedError):
     couponConfig.update({'client_handling_type': 'DISC_CODE_PIN'})
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, couponConfigReq=couponConfig)
     couponCode = LuciHelper.uploadCouponAndAssertions(
         self, couponSeriesId,
         self.constructObj.importType['NONE'])['coupons'][0]
     LuciHelper.issueCouponAndAssertions(self, couponSeriesId)
     #Coupon Redemption
     self.userId = constant.config['usersInfo'][1]['userId']
     LuciHelper.redeemCouponAndAssertions(self,
                                          couponSeriesId,
                                          couponCode,
                                          error=expectedError)
 def test_LUCI_RSD_002(self, description, couponConfig):
     couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, couponConfig)[1]
     couponCode = LuciHelper.issueCouponAndAssertions(self,
                                                      couponSeriesId)[0]
     LuciHelper.getCouponConfigAndAssertion(self,
                                            couponSeriesId,
                                            no_issued=1)
     LuciHelper.redeemCouponAndAssertions(
         self,
         couponSeriesId,
         couponCode,
         error=[
             constant.REDEMPTION_VALIDITY_DATE_NOT_REACHED,
             'event date is lesser than redemption validity date'
         ])
 def test_LUCI_RC_DC_012_sanity(self,description):
     #Save Coupon Config
     couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)
     LuciHelper.queuePumpWait(self, couponSeriesId)
     LuciHelper.couponPumpAssertion(self, couponSeriesId)
     # issue coupon Code
     couponCode = LuciHelper.issueCouponAndAssertions(self,couponSeriesId)[0]
     # CouponConfigAssertion
     LuciHelper.getCouponConfigAndAssertion(self,couponSeriesId, 1, 0)
     # redeem Coupon and Assertion.constructAssertion(on)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId)
     LuciHelper.getCouponConfigAndAssertion(self,couponSeriesId, 1, 1)
     # GetCoupon Details and Assertion.constructAssertion(on)
     couponDetailsRequest = {'onlyActive': True, 'couponCodeFilter': [couponCode]}
     LuciHelper.getCouponDetailsAndAssertion(self,couponSeriesId,couponCode,couponDetailsRequest)
    def test_LUCI_RC_DC_011_sanity(self, description, uploadType):
        #Save Coupon Config
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self)
        time.sleep(2)
        createdCouponCount = LuciDBHelper.getCouponsCreated_Count(couponSeriesId)
        Assertion.constructAssertion(createdCouponCount != 0, 'Coupon Code Pumped to Queue')

        couponCode = LuciHelper.uploadCouponAndAssertions(self,couponSeriesId,self.constructObj.importType[uploadType],dracraysUpload={'userOnly' : True})['coupons'][0]
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 0)

        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
        LuciHelper.redemptionDBAssertion(self, couponSeriesId)

        couponDetailsRequest = {'onlyActive': True, 'couponCodeFilter': [couponCode]}
        LuciHelper.getCouponDetailsAndAssertion(self,couponSeriesId,couponCode,couponDetailsRequest)
        couponDetailsRequest.update({'couponSeriesRequired' : True})
        LuciHelper.getCouponDetailsAndAssertion(self,couponSeriesId,couponCode,couponDetailsRequest)
Exemple #27
0
    def test_downloadCoupon_DCP(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self, {'client_handling_type': 'DISC_CODE_PIN'})

        LuciHelper.uploadCouponAndAssertions(self,
                                             couponSeriesId,
                                             2,
                                             noOfCouponsToBeUpload=2)
        # Issue Coupon Code
        couponCode = LuciHelper.issueCouponAndAssertions(self,
                                                         couponSeriesId)[0]
        DracarysHelper.downloadCouponsRequestAndAssertion(
            self, couponSeriesId,
            self.DracarysObj.DownloadReportType['ISSUED'], [couponCode])
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
        DracarysHelper.downloadCouponsRequestAndAssertion(
            self, couponSeriesId,
            self.DracarysObj.DownloadReportType['REDEEMED'], [couponCode])
Exemple #28
0
    def test_LUCI_EI_011_sanity_smoke(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self,
            couponConfigReq={
                'client_handling_type': 'DISC_CODE_PIN',
                'any_user': True,
                'isExternalIssual': True
            })
        Assertion.constructAssertion(
            LuciDBHelper.isExternalCouponSeries(couponSeriesId),
            'Client handling type isExternal Enabled for coupon series id: {}'.
            format(couponSeriesId))
        #Checking Queue Count
        Assertion.constructAssertion(
            self.connObj.getQueueSize(constant.config['orgId'], couponSeriesId,
                                      constant.config['requestId']) == 0,
            'Coupon codes are cleared from queue')

        couponCode = LuciHelper.uploadCouponAndAssertions(
            self, couponSeriesId,
            self.constructObj.importType['NONE'])['coupons'][0]

        #CouponDetails Request
        couponDetailsRequest = {
            'onlyActive': True,
            'couponCodeFilter': [couponCode]
        }
        self.userId = -1
        LuciHelper.getCouponDetailsAndAssertion(self, couponSeriesId,
                                                couponCode,
                                                couponDetailsRequest)
        LuciHelper.issuedCouponsDBAssertion(self, couponSeriesId, couponCode)

        self.userId = constant.config['usersInfo'][0]['userId']

        LuciHelper.redeemCouponAndAssertions(self,
                                             couponSeriesId,
                                             couponCode,
                                             couponIssuedTo=[-1])
        LuciHelper.redemptionDBAssertion(self, couponSeriesId)
        #Get Coupon Configuration
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 1)
Exemple #29
0
    def test_downloadCoupon_issued_24HR(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self, {'client_handling_type': 'DISC_CODE_PIN'})

        LuciHelper.uploadCouponAndAssertions(self,
                                             couponSeriesId,
                                             2,
                                             noOfCouponsToBeUpload=2)
        # Issue Coupon Code
        couponCode, couponDetails = LuciHelper.issueCouponAndAssertions(
            self, couponSeriesId)
        changeDate = Utils.getTime(days=-1, minutes=-5, milliSeconds=True)
        self.connObj.changeCouponIssuedDate(couponDetails['id'], changeDate)
        DracarysHelper.downloadCouponsRequestAndAssertion(
            self, couponSeriesId,
            self.DracarysObj.DownloadReportType['ISSUED'], [])
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
        DracarysHelper.downloadCouponsRequestAndAssertion(
            self, couponSeriesId,
            self.DracarysObj.DownloadReportType['REDEEMED'], [couponCode])
 def test_LUCI_RSD_006(self, description, createCouponConfig,
                       changeCouponConfig, expectedError):
     couponConfig, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, createCouponConfig)
     couponCode = LuciHelper.issueCouponAndAssertions(self,
                                                      couponSeriesId)[0]
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     couponConfig.update(changeCouponConfig)
     LuciHelper.saveCouponConfigAndAssertions(self,
                                              couponConfigReq=couponConfig)
     self.userId = constant.config['usersInfo'][1]['userId']
     luciExp = LuciHelper.issueCouponAndAssertions(self,
                                                   couponSeriesId,
                                                   expectException=True)
     Assertion.constructAssertion(
         luciExp['errorCode'] == expectedError[0],
         'Luci Exception error code Actual: {} and Expected: {}'.format(
             luciExp['errorCode'], expectedError[0]))
     Assertion.constructAssertion(
         luciExp['errorMsg'] == expectedError[1],
         'Luci Exception Error Msg Actual : {}'.format(luciExp['errorMsg']))