Esempio n. 1
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.constructObj = LuciObject()
     self.DracarysObj = DracarysObject()
     self.userId = constant.config['usersInfo'][0]['userId']
     self.tillId = constant.config['tillIds'][0]
     self.orgDefaultValue = LuciDBHelper.orgDefaultValues()
Esempio n. 2
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.constructObj = LuciObject()
     self.userId = constant.config['usersInfo'][0]['userId']
     self.tillId = constant.config['tillIds'][0]
     self.storeId = constant.config['storeIds'][0]
     self.billId = Utils.getTime(milliSeconds=True)
Esempio n. 3
0
 def setup_class(self):
     self.numberOfUsers = 20
     self.constructObj = LuciObject()
     self.DracarysObj = DracarysObject()
     self.DracraysConnObj = DracarysHelper.getConnObj(newConnection=True)
     self.campaigns = SocialHelper.createCampaignsForSocialThrift(
         testControlType=['ORG'])
     self.groupVersionid, self.groupName = SocialHelper.createListForSocial(
         self.campaigns,
         'ORG',
         numberOfUsers=self.numberOfUsers,
         newUser=True)
     self.remoteCampaignId = SocialHelper.createRemoteCampaignsForSocialThrift(
         self.campaigns['ORG'])
     SocialHelper.updateRemoteCampaignIdInCampaignsBase(
         self.campaigns['ORG'], self.remoteCampaignId)
     self.voucherSeriesId = coupons.createCoupons(
         campaignId=self.campaigns['ORG'],
         payloadData={
             'couponLimit': {
                 'limit': 0,
                 'type': 'UNLIMITED'
             },
             'discountOn': 'BILL',
             'discountType': 'ABS',
             'discountValue': 10
         })[0]['json']['entity']['voucherSeriesId']
     SocialHelper.couponConfigChange(
         {
             'client_handling_type': 'EXTERNAL_ISSUAL',
             'any_user': True
         }, self.campaigns['ORG'], self.voucherSeriesId)
Esempio n. 4
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     nsPort = constant.config['nsMasterPort']
     self.nsHelper = NSAdminHelper(constant.config['orgId'], 'SMS')
     luciPort = constant.config['luciPort'].next()
     self.luciObj = LuciThrift(luciPort)
     self.constructObj = LuciObject()
     constant.config['requestId'] = 'requestId_IRIS_LUCI'
     createListresponse, createListPayload, campaignId = campaignList.createList({'customTagCount':0, 'name':'IRIS_LIST_' + str(int(time.time() * 100000))}, campaignType=['LIVE', 'ORG', 'List', 'TAGS', 0])
     campaignList.assertCreateList(createListresponse, 200)
     groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls(createListresponse['json']['entity']['listId'], createListPayload, 'ORG')
     Logger.log('GroupVersionId : {}, bucketId : {}'.format(groupVersionDetailResult, bucketId))
     addRecipientResponse, addRecipientPayload = campaignList.addRecipient({}, campaignId, createListresponse['json']['entity']['listId'], 'mobile', 10, 0, newUser=False)
     campaignList.assertAddRecipient(addRecipientResponse, 200)
     campaignList.assertAddRecipientDbCalls(addRecipientResponse, addRecipientPayload, createListresponse, campaignId, bucketId, {'TEST':groupVersionDetailResult['TEST'], 'CONTROL':groupVersionDetailResult['CONTROL']}, 'mobile')
     self.bucketId = bucketId
     self.groupVersionResult = dbCallsList.getGroupVersionDetailsWithGroupId(createListresponse['json']['entity']['listId'])
     responseCoupon, payloadCoupon, campaignId = coupons.createCoupons(campaignId=campaignId)
     self.strategy = construct.constructStrategyIds()
     self.programeId = self.strategy['programeId']
     self.allocationStrategyId = self.strategy['allocationStrategyId']
     self.expiryStrategyId = self.strategy['expirationStrategyId']
     if 'errors' not in responseCoupon['json']:
         self.voucherId = responseCoupon['json']['entity']['voucherSeriesId']
     else:
         self.voucherId = dbCallsCoupons.getVoucherSeriesIdUsingCampaignId(campaignId)
     self.campaignId = campaignId
     self.listId = createListresponse['json']['entity']['listId']
     Logger.log('Using CampaignId : {} , listId : {} for Execution of Create Message'.format(self.campaignId, self.listId))
Esempio n. 5
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.constructObj = LuciObject()
     self.DracarysObj = DracarysObject()
     self.uploadTypeList = ['USER_ID', 'MOBILE', 'EMAIL', 'EXTERNAL_ID']
     self.userId = constant.config['usersInfo'][0]['userId']
     self.userIds = list()
     self.tillId = constant.config['tillIds'][0]
Esempio n. 6
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.constructObj = LuciObject()
     self.userIds = []
     self.bulkUserIds = []
     self.DracarysObj = DracarysObject()
     for i in range(len(constant.config['usersInfo'])):
         self.userIds.append(constant.config['usersInfo'][i]['userId'])
     self.tillId = constant.config['tillIds'][0]
Esempio n. 7
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.connObj = LuciHelper.getConnObj(newConnection=True)
     self.constructObj = LuciObject()
     self.userId = constant.config['usersInfo'][0]['userId']
     self.tillId = constant.config['tillIds'][0]
     self.storeId = constant.config['storeIds'][0]
     self.billId = Utils.getTime(milliSeconds=True)
     self.couponConfig1, self.couponSeriesId1 = LuciHelper.saveCouponConfigAndAssertions(self, {'client_handling_type': 'DISC_CODE_PIN', 'created' : Utils.getTime(seconds=0, milliSeconds=True) ,'valid_till_date' : Utils.getTime(days=1, milliSeconds=True), 'alphaNumeric' : False, 'randomCodeLength' : 8})
     self.couponConfig2, self.couponSeriesId2 = LuciHelper.saveCouponConfigAndAssertions(self, {'client_handling_type': 'DISC_CODE_PIN','created' : Utils.getTime(seconds=1, milliSeconds=True) ,'valid_till_date' : Utils.getTime(days=1, milliSeconds=True), 'alphaNumeric' : False, 'randomCodeLength' : 8})
     self.couponConfig3, self.couponSeriesId3 = LuciHelper.saveCouponConfigAndAssertions(self, {'client_handling_type': 'DISC_CODE_PIN','created' : Utils.getTime(seconds=2, milliSeconds=True) ,'valid_till_date' : Utils.getTime(days=1, milliSeconds=True), 'alphaNumeric' : False, 'randomCodeLength' : 8})
     self.couponConfig4, self.couponSeriesId4 = LuciHelper.saveCouponConfigAndAssertions(self, {'client_handling_type': 'DISC_CODE_PIN','created' : Utils.getTime(seconds=3, milliSeconds=True) ,'valid_till_date' : Utils.getTime(days=1, milliSeconds=True), 'alphaNumeric' : False, 'randomCodeLength' : 8})
     self.couponConfig5, self.couponSeriesId5 = LuciHelper.saveCouponConfigAndAssertions(self, {'client_handling_type': 'DISC_CODE_PIN','created' : Utils.getTime(seconds=4, milliSeconds=True) ,'valid_till_date' : Utils.getTime(days=1, milliSeconds=True), 'alphaNumeric' : False, 'randomCodeLength' : 8})
Esempio n. 8
0
    def couponConfigChange(self, condition):
        Logger.log('Setting Voucher Resent Config to :{} for voucherId :{}'.format(condition, self.voucherId))
        constant.config['campaignId'] = self.campaignId
        port = constant.config['luciPort'].next()
        connObj = LuciThrift(port)
        constructObj = LuciObject()

        configRequest = LuciObject.getCouponConfigRequest({'couponSeriesId': self.voucherId})
        couponConfigList = connObj.getCouponConfiguration(configRequest)
        couponConfig = couponConfigList[0].__dict__
        couponConfig.update(condition)
        
        couponConfigObject = LuciObject.couponConfiguration(couponConfig)
        saveCouponConfigObject = LuciObject.saveCouponConfigRequest(couponConfigObject)
        connObj.saveCouponConfiguration(saveCouponConfigObject)