Пример #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))
Пример #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')
Пример #3
0
 def test_pasteList_wrongOrgId(self):
     response, payload = campaigns.createCampaign(campaignTypeParams=['LIVE', 'ORG'])
     campaigns.assertCreateCampaign(response, 200)
     campaignId = response.get('json').get('entity').get('campaignId')
     previousOrgId = construct.updateOrgId(0)
     try:
         responseCreateList, payload, campaignId = campaignList.createList({}, campaignId=campaignId)  
         campaignList.assertCreateList(responseCreateList, 400, 2003, 'Invalid campaign  id : ' + str(campaignId)[:3] + ',' + str(campaignId)[3:])
     except AssertionError, exp:
         Logger.log('Assertioin Failed as :', exp)
Пример #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))
Пример #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))
Пример #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))
Пример #7
0
 def test_pasteList_wrongListNames(self, description, listName, errorCode, errorMessage):
     response, payload, campaignId = campaignList.createList({'name':listName})
     campaignList.assertCreateList(response, 400 , errorCode, errorMessage)
Пример #8
0
 def test_pasteList_wrongCampaignId(self, description, campaignId, errorCode, errorMessage):
     response, payload, campaignId = campaignList.createList({}, campaignId=int(campaignId))
     campaignList.assertCreateList(response, 400, errorCode, errorMessage)
Пример #9
0
 def test_pasteList_OutboundCampaign_MoreCustomTagCount(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, 400, 100, 'Invalid request : Maximum 5 Custom Tags can be given')