Ejemplo n.º 1
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))
Ejemplo n.º 2
0
    def setup_class(self):
        if 'storeType' in constant.payload['createmessage']:
            constant.payload['createmessage'].pop('storeType')

        campaignResponse, campaignPayload = campaigns.createCampaign({
            'name':
            'IRIS_' + str(int(time.time() * 100000)),
            'goalId':
            constant.irisGenericValues['goalId'],
            'objectiveId':
            constant.irisGenericValues['objectiveId'],
            'testControl': {
                'type': 'ORG',
                'test': 90
            }
        })
        listResponse, listPayload, campaignId = campaignList.createList(
            {
                'customTagCount': 1,
                'name': 'IRIS_LIST_' + str(int(time.time() * 100000))
            },
            campaignId=campaignResponse['json']['entity']['campaignId'])
        addRecipientResponse, addRecipientPayload = campaignList.addRecipient(
            {},
            campaignId,
            listResponse['json']['entity']['listId'],
            'mobile',
            10,
            1,
            newUser=False)
        responseCoupon, payloadCoupon, campaignId = coupons.createCoupons(
            campaignId=campaignId)

        self.campaignId = campaignId
        self.listId = listResponse['json']['entity']['listId']
        self.voucherId = responseCoupon['json']['entity']['voucherSeriesId']
        self.strategy = construct.constructStrategyIds()
        self.programeId = self.strategy['programeId']
        self.allocationStrategyId = self.strategy['allocationStrategyId']
        self.expiryStrategyId = self.strategy['expirationStrategyId']
        self.bucketId = dbCallsList.getGroupVersionDetailsWithGroupId(
            listResponse['json']['entity']['listId'])['TEST']['bucket_id']
        self.groupVersionResult = dbCallsList.getGroupVersionDetailsWithGroupId(
            listResponse['json']['entity']['listId'])
        Logger.log(
            'Veneno Setup Details --> campaignId:{} ,ListId:{} ,voucherId:{} ,strategy:{}, bucketId:{}, groupVersionDetail:{}'
            .format(self.campaignId, self.listId, self.voucherId,
                    self.strategy, self.bucketId, self.groupVersionResult))
Ejemplo n.º 3
0
    def preRequisitesForVeneno(testControlType='org'):
        if 'storeType' in constant.payload['createmessage']:
            constant.payload['createmessage'].pop('storeType')

        campaignResponse, campaignPayload = campaigns.createCampaign({
            'name':
            'IRIS_' + str(int(time.time() * 100000)),
            'goalId':
            constant.irisGenericValues['goalId'],
            'objectiveId':
            constant.irisGenericValues['objectiveId'],
            'testControl': {
                'type': testControlType.upper(),
                'test': 90
            }
        })
        listResponse, listPayload, campaignId = campaignList.createList(
            {
                'customTagCount': 1,
                'name': 'IRIS_LIST_' + str(int(time.time() * 100000))
            },
            campaignId=campaignResponse['json']['entity']['campaignId'])
        addRecipientResponse, addRecipientPayload = campaignList.addRecipient(
            {},
            campaignId,
            listResponse['json']['entity']['listId'],
            'mobile,email',
            10,
            1,
            newUser=False)
        responseCoupon, payloadCoupon, campaignId = coupons.createCoupons(
            campaignId=campaignId)
        strategyDict = construct.constructStrategyIds()
        groupVersionDict = dbCallsList.getGroupVersionDetailsWithGroupId(
            listResponse['json']['entity']['listId'])

        return {
            'campaignId': campaignId,
            'listId': listResponse['json']['entity']['listId'],
            'voucherId': responseCoupon['json']['entity']['voucherSeriesId'],
            'strategy': strategyDict,
            'programeId': strategyDict['programeId'],
            'allocationStrategyId': strategyDict['allocationStrategyId'],
            'expiryStrategyId': strategyDict['expirationStrategyId'],
            'bucketId': groupVersionDict['TEST']['bucket_id'],
            'groupVersionResult': groupVersionDict,
            'groupName': listPayload['name']
        }
Ejemplo n.º 4
0
 def setup_class(self):
     campaignMessage.getWeCRMTemplates()
     self.nonWechatOrgId = construct.updateOrgId(
         constant.config['wechat_org_id'])
     self.templateIdDict = campaignMessage.setupTemplateId()
     createListresponse, createListPayload, campaignId = campaignList.createList(
         {
             'customTagCount': 0,
             'name': 'IRIS_LIST_' + str(int(time.time() * 100000))
         },
         campaignId=Test_Wechat_CreateMessage.createCampaign())
     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(
         Test_Wechat_CreateMessage.addRecipientPayload(), campaignId,
         createListresponse['json']['entity']['listId'])
     campaignList.assertAddRecipient(addRecipientResponse, 200)
     responseCoupon, payloadCoupon, campaignId = coupons.createCoupons(
         campaignId=campaignId)
     self.groupVersionResult = dbCallsList.getGroupVersionDetailsWithGroupId(
         createListresponse['json']['entity']['listId'])
     self.bucketId = bucketId
     self.strategy = construct.constructStrategyIds()
     self.programeId = self.strategy['programeId']
     self.allocationStrategyId = self.strategy['allocationStrategyId']
     self.expiryStrategyId = self.strategy['expirationStrategyId']
     self.voucherId = responseCoupon['json']['entity']['voucherSeriesId']
     self.campaignId = campaignId
     self.listId = createListresponse['json']['entity']['listId']
     campaignMessage.updateDefaultMessageJson(self.campaignId, self.listId,
                                              self.voucherId, self.strategy,
                                              self.bucketId,
                                              self.groupVersionResult)
     constant.messagesDefault['updated'] = True
     Logger.log(
         'Using CampaignId : {} , listId : {} for Execution of Create Message'
         .format(self.campaignId, self.listId))