Beispiel #1
0
 def test_mergeList_LiveCampaign_mobile(self, campaignAndListType, userType,
                                        numberOfUsers, customTagCount):
     mergeListresponse, mergeListPayload, campaignId = campaignList.mergeList(
         {},
         campaignType=campaignAndListType,
         userType=userType,
         numberOfUsers=numberOfUsers,
         numberOfCustomTags=customTagCount)
     campaignList.assertMergeList(mergeListresponse, 200)
     groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls(
         mergeListresponse.get('json').get('entity').get('listId'),
         mergeListPayload,
         campaignAndListType[1],
         expectedTestUsers=mergeListresponse.get('json').get('entity').get(
             'recipientsResponse').get('test'),
         expectedControlUsers=mergeListresponse.get('json').get(
             'entity').get('recipientsResponse').get('control'))
     Logger.log('GroupVersionId : {}, bucketId : {}'.format(
         groupVersionDetailResult, bucketId))
     addRecipientResponse = {
         'json': {
             'entity':
             mergeListresponse.get('json').get('entity').get(
                 'recipientsResponse')
         }
     }
     campaignList.assertAddRecipientDbCalls(
         addRecipientResponse, mergeListPayload.get('recipients'),
         mergeListresponse, campaignId, bucketId, {
             'TEST': groupVersionDetailResult.get('TEST'),
             'CONTROL': groupVersionDetailResult.get('CONTROL')
         }, userType)
Beispiel #2
0
 def test_pasteList_sameName_SequentialRequest(self):
     response, payload, campaignId = campaignList.createList({'name':'IRIS_SEQUENTIAL_REQUEST' + str(int(time.time() * 100000))})
     campaignList.assertCreateList(response, 200)
     groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls(response.get('json').get('entity').get('listId'), payload, 'ORG')
     Logger.log('First List Created with CampaignId : {} having GroupVersionId : {}, bucketId : {}'.format(campaignId, groupVersionDetailResult, bucketId))
     response, payload, campaignId = campaignList.createList({'name':payload.get('name')}, campaignId=campaignId)
     campaignList.assertCreateList(response, 400, 2006, 'List Name Exception : List Name already exists')
Beispiel #3
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))
Beispiel #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))
Beispiel #5
0
 def test_pasteList_lapsedOutboundCampaign(self, testControltype, customTagCount):
     response, payload, campaignId = campaignList.createList({'customTagCount':int(customTagCount), 'name':'IRIS_LIST_' + str(int(time.time() * 100000))}, campaignType=['LAPSED', testControltype, 'List', 'TAGS', customTagCount])
     campaignList.assertCreateList(response, 200)
     groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls(response.get('json').get('entity').get('listId'), payload, testControlType=testControltype)
     Logger.log('GroupVersionId : {}, bucketId : {}'.format(groupVersionDetailResult, bucketId))
Beispiel #6
0
 def test_pasteList_Sanity(self):
     response, payload, campaignId = campaignList.createList()
     campaignList.assertCreateList(response, 200)
     groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls(response.get('json').get('entity').get('listId'), payload, 'ORG')
     Logger.log('GroupVersionId : {}, bucketId : {}'.format(groupVersionDetailResult, bucketId))