Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #6
0
 def test_LUCI_RC_DC_021(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)
     self.userId = constant.config['usersInfo'][1]['userId']
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, error=expectedError)
     self.userId = constant.config['usersInfo'][0]['userId']
     LuciHelper.redemptionDBAssertion(self, couponSeriesId)
 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)
 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_RC_DCP_013(self, description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
            self,
            couponConfigReq={
                'client_handling_type': 'DISC_CODE_PIN',
                'multiple_use': True,
                'any_user': True
            })
        couponCode = LuciHelper.uploadCouponAndAssertions(
            self, couponSeriesId,
            self.constructObj.importType['NONE'])['coupons'][0]

        #issueCode and Doing Assertion.constructAssertion(on)
        LuciHelper.issueCouponAndAssertions(self, couponSeriesId)
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 0)
        LuciHelper.getCouponDetailsAndAssertion(self,
                                                couponSeriesId,
                                                couponCode,
                                                couponDetailsRequest={
                                                    'onlyActive':
                                                    True,
                                                    'couponCodeFilter':
                                                    [couponCode]
                                                })
        #Coupon Redemption
        redeemedIds = [self.userId]
        LuciHelper.redeemCouponAndAssertions(
            self,
            couponSeriesId,
            couponCode,
            couponIssuedTo=[constant.config['usersInfo'][0]['userId']])
        self.userId = constant.config['usersInfo'][1]['userId']
        redeemedIds.append(self.userId)
        LuciHelper.redeemCouponAndAssertions(
            self,
            couponSeriesId,
            couponCode,
            couponIssuedTo=[constant.config['usersInfo'][0]['userId']])
        self.userId = constant.config['usersInfo'][2]['userId']
        redeemedIds.append(self.userId)
        LuciHelper.redeemCouponAndAssertions(
            self,
            couponSeriesId,
            couponCode,
            couponIssuedTo=[constant.config['usersInfo'][0]['userId']])
        LuciHelper.redemptionDBAssertion(self,
                                         couponSeriesId,
                                         numRedeemed=3,
                                         redeemedBy=redeemedIds)
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 3)
Пример #10
0
 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)
Пример #11
0
    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)
Пример #12
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)
Пример #13
0
    def test_LUCI_RC_DC_014(self,description):
        couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(self, couponConfigReq={'multiple_use' : True, 'any_user' : True})
        LuciHelper.queuePumpWait(self, couponSeriesId)
        LuciHelper.couponPumpAssertion(self, couponSeriesId)

        #issueCode and Doing Assertion.constructAssertion(on)
        couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0]
        LuciHelper.getCouponConfigAndAssertion(self, couponSeriesId, 1, 0)
        LuciHelper.getCouponDetailsAndAssertion(self,couponSeriesId,couponCode, couponDetailsRequest={'onlyActive': True, 'couponCodeFilter': [couponCode]})
        #Coupon Redemption
        redeemedIds = [self.userId]
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, couponIssuedTo=[constant.config['usersInfo'][0]['userId']])
        self.userId = constant.config['usersInfo'][1]['userId']
        redeemedIds.append(self.userId)
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, couponIssuedTo=[constant.config['usersInfo'][0]['userId']])
        self.userId = constant.config['usersInfo'][2]['userId']
        redeemedIds.append(self.userId)
        LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode, couponIssuedTo=[constant.config['usersInfo'][0]['userId']])
        LuciHelper.redemptionDBAssertion(self,couponSeriesId, numRedeemed=3, redeemedBy=redeemedIds)
        LuciHelper.getCouponConfigAndAssertion(self,couponSeriesId,1,3)
 def test_LUCI_RSD_003(self, description, createCouponConfig,
                       changeCouponConfig):
     couponConfig, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions(
         self, createCouponConfig)
     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'
         ])
     couponConfig.update(changeCouponConfig)
     LuciHelper.saveCouponConfigAndAssertions(self,
                                              couponConfigReq=couponConfig)
     LuciHelper.redeemCouponAndAssertions(self, couponSeriesId, couponCode)
     LuciHelper.redemptionDBAssertion(self, couponSeriesId, numRedeemed=1)