def test_campaignShardThrfit_AudienceGroupUserInfoRequest_nonFilterBased(
         self, campaignType, audienceType):
     testList = constant.thiriftCampaignShardTestReferenceObject[
         campaignType]['campaign']['lists'][audienceType][0]
     groupId = testList['groupDetails']['id']
     Logger.log(
         'Checking for All Test Users in groupId : {}'.format(groupId))
     listOfTestResponse = []
     listOfControlResponse = []
     for eachuser in testList['campaignGroupRecipients']['TEST']:
         AudienceGroupBoolRes = self.connObj.isUserInGroup(
             self.campaignShardObject.AudienceGroupUserInfoRequest(
                 eachuser, groupId))
         listOfTestResponse.append((eachuser, AudienceGroupBoolRes.success))
     if 'CONTROL' in testList['campaignGroupRecipients']:
         Logger.log('Checking for All Control Users in groupId : {}'.format(
             groupId))
         for eachuser in testList['campaignGroupRecipients']['CONTROL']:
             AudienceGroupBoolRes = self.connObj.isUserInGroup(
                 self.campaignShardObject.AudienceGroupUserInfoRequest(
                     eachuser, groupId))
             listOfControlResponse.append(
                 (eachuser, AudienceGroupBoolRes.success))
     CampaignShardHelper.validateAudienceGroupBoolRes({
         'TEST':
         listOfTestResponse,
         'CONTROL':
         listOfControlResponse
     })
Ejemplo n.º 2
0
 def test_campaignShardThrfit_splitList_filterBased(self, campaignType,
                                                    audienceType, listType):
     existingList = constant.thiriftCampaignShardTestReferenceObject[
         campaignType]['campaign']['lists'][audienceType][0]
     splitA = self.campaignShardObject.SplitGroup(
         'splitA_{}'.format(existingList['groupLabel']), 50)
     splitB = self.campaignShardObject.SplitGroup(
         'splitB_{}'.format(existingList['groupLabel']), 50)
     listOfSplit = [splitA, splitB]
     userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
     groupIdsOfListCreated = self.connObj.createList(
         constant.thiriftCampaignShardTestReferenceObject[campaignType]
         ['campaign']['id'], self.campaignShardObject.ListType[listType],
         self.campaignShardObject.ListInfo(
             listType.lower(), {
                 'oldGroupId': existingList['groupDetails']['id'],
                 'splitGroupsList': listOfSplit
             }))
     groupIndex = 0
     for eachCreatedListData in CampaignShardHelper.splitListUsers(
             campaignType, userPayloadInfo):
         CampaignShardDBAssertion(
             constant.thiriftCampaignShardTestReferenceObject[campaignType]
             ['campaign']['id'],
             campaignType,
             'loyalty',
             listOfSplit[groupIndex].newGroupName,
             groupIdsOfListCreated[groupIndex],
             'firstName,lastName,mobile',
             eachCreatedListData,
             derived=True).check()
         groupIndex = groupIndex + 1
 def test_campaignShardThrift_AudienceGroup_Async_CreateAudienceGroup_Sanity(
         self, audienceType):
     createAudienceRequest = campaignShardObject.createAudienceRequest(
         audienceType=audienceType)
     audiencecGroupEntity = self.connObj.createAudienceGroup(
         createAudienceRequest).__dict__
     CampaignShardHelper.validateGroupStatusAsync(audiencecGroupEntity,
                                                  'PREPARE', audienceType)
    def test_campaignShardThrift_AudienceGroup_Async_CreateAudience_Reload_Sanity(
            self, audienceType):
        createAudienceRequest = campaignShardObject.createAudienceRequest(
            audienceType=audienceType)
        audiencecGroupEntity = self.connObj.createAudienceGroup(
            createAudienceRequest).__dict__
        createAudienceWithGroupId = campaignShardObject.createAudienceRequest(
            {'groupId': audiencecGroupEntity['id']}, audienceType=audienceType)
        createAudienceResponse = self.connObj.createAudience(
            createAudienceWithGroupId).__dict__

        groupDetailsVersionInfo = dbCallsList.getGroupVersionDetailsWithGroupId(
            audiencecGroupEntity['id'])
        s3InfoForUsedList = CampaignShardHelper.getS3Info(
            createAudienceResponse['uuId'])
        thriftCampaignGroup = lambda campaignTargetType: campaignShardObject(
        ).CampaignGroup({
            'groupId':
            audiencecGroupEntity['id'],
            'groupLabel':
            createAudienceResponse['label'],
            'params':
            str(),
            'campaignGroupType':
            'FILTER_BASED',
            'campaignTargetType':
            'TEST',
            'customerCount':
            groupDetailsVersionInfo['TEST']['customer_count'],
            'uuId':
            createAudienceResponse['uuId'],
            'versionNumber':
            1,
            's3Path':
            s3InfoForUsedList['response']['data']['s3Path'],
            's3Headers':
            s3InfoForUsedList['response']['data']['s3Header'],
            's3BucketTag':
            s3InfoForUsedList['response']['data']['s3Path'].split('/')[2]
        })

        for eachTargetType in ['TEST']:
            if not self.connObj.reloadGroup(
                    thriftCampaignGroup(eachTargetType)):
                Logger.log(
                    'For TargetType :{} , reload was unsuccesfull'.format(
                        eachTargetType))
        userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
        CampaignShardDBAssertion(99999,
                                 'org',
                                 'FILTER_BASED',
                                 createAudienceResponse['label'],
                                 audiencecGroupEntity['id'],
                                 'firstName,lastName,mobile',
                                 userPayloadInfo,
                                 newFlow=True).check()
Ejemplo n.º 5
0
    def test_campaignShardThrift_reloadFilterBasedList_newBucket_partiallyDistributedBucket(
            self, campaignType, audienceType):
        self.bucketDetails = CampaignShardHelper.updateBucketIdRowCount(
            rows_count=14999990)
        existingList = constant.thiriftCampaignShardTestReferenceObject[
            campaignType]['campaign']['lists'][audienceType][1]
        userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
        s3InfoForUsedList = CampaignShardHelper.getS3Info(existingList['uuid'])

        thriftCampaignGroup = lambda campaignTargetType: self.campaignShardObject.CampaignGroup(
            {
                'campaignId':
                constant.thiriftCampaignShardTestReferenceObject[campaignType][
                    'campaign']['id'],
                'groupId':
                existingList['groupDetails']['id'],
                'groupLabel':
                existingList['groupLabel'],
                'params':
                str(),
                'campaignGroupType':
                'LOYALTY',
                'campaignTargetType':
                'TEST',
                'customerCount':
                existingList['groupVersionDetails'][campaignTargetType][
                    'customer_count'],
                'uuId':
                existingList['uuid'],
                'versionNumber':
                1,
                's3Path':
                s3InfoForUsedList['response']['data']['s3Path'],
                's3Headers':
                s3InfoForUsedList['response']['data']['s3Header'],
                's3BucketTag':
                s3InfoForUsedList['response']['data']['s3Path'].split('/')[2]
            })

        for eachTargetType in ['TEST']:
            if not self.connObj.reloadGroup(
                    thriftCampaignGroup(eachTargetType)):
                Logger.log(
                    'For TargetType :{} , reload was unsuccesfull'.format(
                        eachTargetType))

        CampaignShardHelper.validateBucketIdWhenBucketUpdated(
            existingList['groupDetails']['id'],
            self.bucketDetails['oldBucket'])

        CampaignShardDBAssertion(
            constant.thiriftCampaignShardTestReferenceObject[campaignType]
            ['campaign']['id'], campaignType, 'loyalty',
            existingList['groupLabel'], existingList['groupDetails']['id'],
            'firstName,lastName,mobile', userPayloadInfo).check()
Ejemplo n.º 6
0
 def setup_class(self):
     testControlTypeSupported = ['org', 'skip', 'custom']
     listSupported = ['filter', 'upload']
     Logger.logSuiteName(str(self).split('.')[-1])
     self.campaignShardObject = campaignShardObject()
     self.intialUsedObject = copy.deepcopy(
         constant.thiriftCampaignShardTestReferenceObject)
     CampaignShardHelper.setupCampaignsInThriftReference(
         typesOfCampaign=testControlTypeSupported)
     CampaignShardHelper.setupListInThriftReference(
         listSupported, typesOfCampaign=testControlTypeSupported)
Ejemplo n.º 7
0
 def test_campaignShard_loyalty_generic(self, campaignType):
     detailsOfFilterListCreated = CampaignShardHelper.createFilterList(
         self.campaignId[campaignType],
         'test_list_{}_{}'.format(campaignType, int(time.time())))
     userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
     CampaignShardDBAssertion(
         self.campaignId[campaignType], campaignType,
         detailsOfFilterListCreated['listType'],
         detailsOfFilterListCreated['groupLabel'],
         detailsOfFilterListCreated['groupDetails']['id'],
         'firstName,lastName,mobile', userPayloadInfo).check()
Ejemplo n.º 8
0
 def test_campaignShardThrift_searchAudienceGroup_filterBased(
         self, audienceType):
     listOfAudienceType = []
     for eachAudienceType in audienceType:
         listOfAudienceType.append(
             self.campaignShardObject.AudienceGroupType[eachAudienceType])
     listOfAudienceGroup = self.connObj.searchAudienceGroup(
         listOfAudienceType)
     CampaignShardHelper.validateSearchAudienceGroup(audienceType,
                                                     listOfAudienceGroup,
                                                     campaignType=['org'])
 def test_campaignShardThrift_AudienceGroup_Async_CreateAudience_markError_Sanity(
         self, audienceType):
     createAudienceRequest = campaignShardObject.createAudienceRequest(
         audienceType=audienceType)
     audiencecGroupEntity = self.connObj.createAudienceGroup(
         createAudienceRequest).__dict__
     createAudienceWithGroupId = campaignShardObject.createAudienceRequest(
         {'groupId': audiencecGroupEntity['id']}, audienceType=audienceType)
     self.connObj.createAudience(createAudienceWithGroupId)
     self.connObj.updateErrorStatusForAudienceGroup(
         audiencecGroupEntity['id'])
     CampaignShardHelper.validateErrorStatusAsync(
         audiencecGroupEntity['id'])
Ejemplo n.º 10
0
 def test_campaignShardThrift_newSearchAudienceGroup(
         self, campaignType, audienceType, testPercentage):
     audienceSearchRequest = self.campaignShardObject.AudienceSearchRequest(
         searchText="",
         audienceGroupTypes=[
             self.campaignShardObject.AudienceGroupType[audienceType]
         ],
         testControl=self.campaignShardObject.TestControl(
             campaignType, testPercentage))
     listOfAudienceGroup = self.connObj.newSearchAudienceGroup(
         audienceSearchRequest)
     CampaignShardHelper.validateSearchAudienceGroup(
         [audienceType], listOfAudienceGroup, campaignType=[campaignType])
 def test_campaignShardThrfit_getAudienceGroupWithDataSourceInfo(
         self, campaignType, audienceType):
     groupId = constant.thiriftCampaignShardTestReferenceObject[
         campaignType]['campaign']['lists'][audienceType][0][
             'groupDetails']['id']
     Logger.log(
         'Making getAudienceGroupWithDataSourceInfo Thrift Call for campaignType :{} , audienceType :{} with  groupId :{}'
         .format(campaignType, audienceType, groupId))
     AudienceGroup = self.connObj.getAudienceGroupWithDataSourceInfo(
         self.campaignShardObject.AudienceGroupDataSourceInfoRequest(
             groupId))
     CampaignShardHelper.validateGetAudienceGroupWithDataSourceInfo(
         campaignType, audienceType, AudienceGroup)
Ejemplo n.º 12
0
    def test_campaignShardThrift_searchAudienceGroupByLabel_filterBased(
            self, campaignType, audienceType):
        listOfAudienceType = [
            self.campaignShardObject.AudienceGroupType[audienceType]
        ]
        listOfAudienceGroup = self.connObj.searchAudienceGroup(
            listOfAudienceType)

        groupLabel = constant.thiriftCampaignShardTestReferenceObject[
            campaignType]['campaign']['lists'][audienceType][0]['groupLabel']
        listOfAudienceGroup = self.connObj.searchAudienceGroupByLabel(
            groupLabel, listOfAudienceType)
        CampaignShardHelper.validateGetAudienceGroupWithDataSourceInfo(
            campaignType, audienceType, listOfAudienceGroup[0], checkS3=False)
Ejemplo n.º 13
0
 def test_campaignShardThrift_newSearchAudienceGroupByLabel(
         self, campaignType, audienceType, testPercentage):
     audienceSearchRequest = self.campaignShardObject.AudienceSearchRequest(
         searchText=constant.
         thiriftCampaignShardTestReferenceObject[campaignType]['campaign']
         ['lists'][audienceType][0]['groupLabel'],
         audienceGroupTypes=[
             self.campaignShardObject.AudienceGroupType[audienceType]
         ],
         testControl=self.campaignShardObject.TestControl(
             campaignType, testPercentage))
     listOfAudienceGroup = self.connObj.newSearchAudienceGroupByLabel(
         audienceSearchRequest)
     CampaignShardHelper.validateGetAudienceGroupWithDataSourceInfo(
         campaignType, audienceType, listOfAudienceGroup[0], checkS3=False)
Ejemplo n.º 14
0
    def test_campaignShardThrfit_getAudienceGroupWithDataSourceInfo_filter_zeroUsers(
            self, campaignType, audienceType):
        campaignId = constant.thiriftCampaignShardTestReferenceObject[
            campaignType.lower()]['campaign']['id']
        groupId = CampaignShardHelper.getGroupIdForFilterBasedListWithZeroRecords(
            campaignType, campaignId)['groupDetails']['id']

        Logger.log(
            'Making getAudienceGroupWithDataSourceInfo Thrift Call for campaignType :{} , audienceType :{} with  groupId :{}'
            .format(campaignType, audienceType, groupId))
        AudienceGroup = self.connObj.getAudienceGroupWithDataSourceInfo(
            self.campaignShardObject.AudienceGroupDataSourceInfoRequest(
                groupId))
        CampaignShardHelper.validateGetAudienceGroupWithDataSourceInfo(
            campaignType, audienceType, AudienceGroup)
Ejemplo n.º 15
0
 def test_campaignShardThrift_mergeList_upload_filterBased(
         self, campaignType, audienceTypeFirst, audienceTypeSecond,
         listType):
     existingListFirst = constant.thiriftCampaignShardTestReferenceObject[
         campaignType]['campaign']['lists'][audienceTypeFirst][0]
     existingListSecond = constant.thiriftCampaignShardTestReferenceObject[
         campaignType]['campaign']['lists'][audienceTypeSecond][0]
     userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
     groupIdsOfListCreated = self.connObj.createList(
         constant.thiriftCampaignShardTestReferenceObject[campaignType]
         ['campaign']['id'], self.campaignShardObject.ListType[listType],
         self.campaignShardObject.ListInfo(
             listType.lower(), {
                 'newGroupName':
                 'Merge_' + existingListFirst['groupLabel'] + '_And_' +
                 existingListSecond['groupLabel'],
                 'oldGroupIdList': [
                     existingListFirst['groupDetails']['id'],
                     existingListSecond['groupDetails']['id']
                 ]
             }))
     CampaignShardDBAssertion(
         constant.thiriftCampaignShardTestReferenceObject[campaignType]
         ['campaign']['id'],
         campaignType,
         'upload',
         'Merge_' + existingListFirst['groupLabel'] + '_And_' +
         existingListSecond['groupLabel'],
         groupIdsOfListCreated[0],
         existingListFirst['addRecipientPayload']['schema'],
         list(
             set(existingListFirst['addRecipientPayload']['data'] +
                 userPayloadInfo)),
         derived=True).check()
Ejemplo n.º 16
0
    def test_veneno_recurring(self, description, messageInfo):
        detailsOfFilterListCreated = CampaignShardHelper.createFilterList(
            self.campaignId, 'test_list_{}'.format(int(time.time())))
        self.listId = detailsOfFilterListCreated['groupDetails']['id']
        authorizeResult = authorize.authorizeCampaign(self, messageInfo, False)
        authorize.assertAuthorize(authorizeResult['authorizeResponse'], 200)

        self.node.append(
            [self.listId, detailsOfFilterListCreated, authorizeResult])
Ejemplo n.º 17
0
    def test_campaignShardThrift_dedupList_multipleList_newVersion(
            self, campaignType, audienceTypeFirst, audienceTypeSecond,
            audienceTypeThird, listType):
        existingListFirst = constant.thiriftCampaignShardTestReferenceObject[
            campaignType]['campaign']['lists'][audienceTypeFirst][0]
        existingListSecond = constant.thiriftCampaignShardTestReferenceObject[
            campaignType]['campaign']['lists'][audienceTypeSecond][0]
        existingListThird = constant.thiriftCampaignShardTestReferenceObject[
            campaignType]['campaign']['lists'][audienceTypeThird][1]
        userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
        listOfGroupIdNamePair = [
            self.campaignShardObject.GroupIdNamePair(
                existingListFirst['groupDetails']['id'],
                existingListFirst['groupLabel']),
            self.campaignShardObject.GroupIdNamePair(
                existingListSecond['groupDetails']['id'],
                existingListSecond['groupLabel']),
            self.campaignShardObject.GroupIdNamePair(
                existingListThird['groupDetails']['id'],
                existingListThird['groupLabel'])
        ]

        groupIdsOfListCreated = self.connObj.createList(
            constant.thiriftCampaignShardTestReferenceObject[campaignType]
            ['campaign']['id'], self.campaignShardObject.ListType[listType],
            self.campaignShardObject.ListInfo(
                listType.lower(), {
                    'createNewGroups': False,
                    'groupIdNameList': listOfGroupIdNamePair
                }))

        CampaignShardDBAssertion(
            constant.thiriftCampaignShardTestReferenceObject[campaignType]
            ['campaign']['id'],
            campaignType,
            'upload',
            existingListSecond['groupLabel'],
            groupIdsOfListCreated[0],
            existingListFirst['addRecipientPayload']['schema'],
            list(
                set(userPayloadInfo) -
                set(existingListFirst['addRecipientPayload']['data'])),
            derived=True).check()
        CampaignShardDBAssertion(
            constant.thiriftCampaignShardTestReferenceObject[campaignType]
            ['campaign']['id'],
            campaignType,
            'upload',
            existingListThird['groupLabel'],
            groupIdsOfListCreated[1],
            existingListFirst['addRecipientPayload']['schema'],
            list(
                set(userPayloadInfo) - set(userPayloadInfo) -
                set(existingListFirst['addRecipientPayload']['data'])),
            derived=True).check()
Ejemplo n.º 18
0
 def setupListForTimelineExection(self):
     try:
         campaignResponse_ORG, campaignPayload_ORG = campaigns.createCampaign(
             {
                 'name': 'IRIS_' + str(int(time.time() * 100000)),
                 'goalId': constant.irisGenericValues['goalId'],
                 'objectiveId': constant.irisGenericValues['objectiveId'],
                 'testControl': {
                     'type': 'ORG',
                     'test': 90
                 }
             })
         detailsOfFilterListCreated = CampaignShardHelper.createFilterList(
             campaignResponse_ORG['json']['entity']['campaignId'],
             'test_timeline_list_{}_{}'.format('org', int(time.time())))
         return detailsOfFilterListCreated['groupLabel']
     except Exception, exp:
         return constant.timelineDetails[
             constant.config['cluster']]['segment']
Ejemplo n.º 19
0
 def setBaseState():
     module = constant.config['module']
     if module == 'nsadmin':
         NSAdminHelper.checkCommServerConn()
     if module == 'iris':
         NSAdminHelper.checkCommServerConn(ignoreConnectionError=True)
         LuciHelper.checkLuciConn(ignoreConnectionError=False)
     if module == 'irisv2':
         LuciHelper.checkLuciConn(ignoreConnectionError=True)
         ReonHelper.checkReonConnection(ignoreConnectionError=True)
         NSAdminHelper.checkCommServerConn()
         CampaignShardHelper.checkCampaignShardConnection()
     if module == 'luci':
         LuciHelper.loginAndGetCookies()
         LuciHelper.checkLuciConn()
         DracarysHelper.checkDracarysConn()
         LuciHelper.setBaseDetails()
     if module == 'veneno':
         LuciHelper.checkLuciConn(ignoreConnectionError=True)
         LuciDBHelper.getAdminUserId()
         VenenoHelper.checkVenenoServerConnection()
         NSAdminHelper.checkCommServerConn(ignoreConnectionError=True)
         CampaignShardHelper.checkCampaignShardConnection()
     if module == 'campaign_shard':
         CampaignShardHelper.checkCampaignShardConnection()
     if module == 'darknight':
         DarknightHelper.checkDarknightConn()
     if module == 'campaignsui':
         NSAdminHelper.checkCommServerConn(ignoreConnectionError=True)
         TemporalHelper.checkTemporalServerConnection(ignoreConnectionError=True)
         try:
             status, version = ChromeDriverManager.checkChromeDriverCompatibility()
             if not status:
                 ChromeDriverManager.downloadChromeDriver(version)
         except:
             Logger.log(traceback.format_exc())
     if module == 'emf' or module == 'peb':
         LoyaltyHelper.checkEMFConn()
         PEBHelper.checkPEBConn()
     if module == 'peb':
         PEBHelper.checkPEBConn()
     if module == 'social':
         SocialHelper.checkSocialConn()
         VenenoHelper.checkVenenoServerConnection()
         LuciHelper.checkLuciConn(ignoreConnectionError=True)
         LuciDBHelper.getAdminUserId()
         DracarysHelper.checkDracarysConn(ignoreConnectionError=True)
         LuciHelper.loginAndGetCookies()
         LuciHelper.setBaseDetails()
 def test_campaignShardThrift_AudienceGroup_Async_CreateAudience_Sanity(
         self, audienceType):
     createAudienceRequest = campaignShardObject.createAudienceRequest(
         audienceType=audienceType)
     audiencecGroupEntity = self.connObj.createAudienceGroup(
         createAudienceRequest).__dict__
     createAudienceWithGroupId = campaignShardObject.createAudienceRequest(
         {'groupId': audiencecGroupEntity['id']}, audienceType=audienceType)
     time.sleep(20)
     createAudienceResponse = self.connObj.createAudience(
         createAudienceWithGroupId).__dict__
     userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
     CampaignShardDBAssertion(99999,
                              'org',
                              audienceType,
                              createAudienceResponse['label'],
                              audiencecGroupEntity['id'],
                              'firstName,lastName,mobile',
                              userPayloadInfo,
                              newFlow=True).check()
Ejemplo n.º 21
0
 def test_irisv2_recurring_campaign_performance(self, campaignType,
                                                testControlType, listType,
                                                channel, messageInfo):
     #campaignId = CreateCampaign.create(campaignType, testControlType, updateNode=True, lockNode=True)['ID']
     #couponSeriesId = CreateMessage.getCouponSeriesId(campaignId)
     #approveRespone = AuthorizeMessage.approve(campaignType, testControlType, listType, channel, messageInfo,lockNode=True)
     #AuthorizeMessage.assertResponse(approveRespone, 200)
     campaignId = CreateCampaign.create(campaignType, testControlType)['ID']
     #listInfo = CreateAudience.FilterList(campaignType, testControlType, lockNode=True)
     detailsOfFilterListCreated = CampaignShardHelper.createFilterListWithCreateGroupRecipient(
     )
     listInfo = detailsOfFilterListCreated['groupDetails']
     approveRespone = AuthorizeMessage.approve(campaignType,
                                               testControlType,
                                               listType,
                                               channel,
                                               messageInfo,
                                               campaignId=campaignId,
                                               listInfo=listInfo,
                                               lockNode=True)
     AuthorizeMessage.assertResponse(approveRespone, 200)
Ejemplo n.º 22
0
 def test_campaignShardThrfit_duplicateList_filterBased(
         self, campaignType, audienceType, listType):
     existingList = constant.thiriftCampaignShardTestReferenceObject[
         campaignType]['campaign']['lists'][audienceType][0]
     groupIdsOfListCreated = self.connObj.createList(
         constant.thiriftCampaignShardTestReferenceObject[campaignType]
         ['campaign']['id'], self.campaignShardObject.ListType[listType],
         self.campaignShardObject.ListInfo(
             listType, {
                 'oldGroupId': existingList['groupDetails']['id'],
                 'newGroupName': 'duplicate_' + existingList['groupLabel']
             }))
     userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
     CampaignShardDBAssertion(
         constant.thiriftCampaignShardTestReferenceObject[campaignType]
         ['campaign']['id'],
         campaignType,
         'loyalty',
         'duplicate_' + existingList['groupLabel'],
         groupIdsOfListCreated[0],
         'firstName,lastName,mobile',
         userPayloadInfo,
         derived=True).check()
Ejemplo n.º 23
0
 def preRequisitesForVenenoRateLimit(channel, testControl='org'):
     if channel.lower() in ['mobile', 'email']:
         campaignResponse, campaignPayload = campaigns.createCampaign({
             'name':
             'Veneno_RateLimit_' + str(int(time.time() * 100000)),
             'goalId':
             constant.irisGenericValues['goalId'],
             'objectiveId':
             constant.irisGenericValues['objectiveId'],
             'testControl': {
                 'type': testControl.upper(),
                 'test': 90
             }
         })
         return {
             'campaign': {
                 'name': campaignPayload['name'],
                 'id': campaignResponse['json']['entity']['campaignId']
             },
             'list': {
                 'upload':
                 CampaignShardHelper.setupUploadList(
                     'org',
                     campaignPayload['name'],
                     campaignResponse['json']['entity']['campaignId'],
                     'RL',
                     newUser=True,
                     setupObjectForCampaignShard=False,
                     channel=channel)
             }
         }
     elif channel.lower() in ['android', 'ios']:
         venenoObjectForPush = VenenoHelper.preRequisitesForVenenoMobilePush(
             channel.lower())
         return {
             'campaign': {
                 'name': venenoObjectForPush['campaignName'],
                 'id': venenoObjectForPush['campaignId']
             },
             'list': {
                 'upload': {
                     'addRecipientPayload':
                     venenoObjectForPush['addRecipientPayload'],
                     'groupLabel':
                     venenoObjectForPush['groupName'],
                     'groupDetails':
                     venenoObjectForPush['groupDetails'],
                     'groupVersionDetails':
                     venenoObjectForPush['groupVersionResult'],
                     'campaignGroupRecipients':
                     venenoObjectForPush['campaignGroupRecipient']
                 }
             }
         }
     elif channel.lower() in ['wechat']:
         venenoObjectForWechat = VenenoHelper.preRequisitesForVenenoWechat()
         return {
             'campaign': {
                 'name': venenoObjectForWechat['campaignName'],
                 'id': venenoObjectForWechat['campaignId']
             },
             'list': {
                 'upload': {
                     'addRecipientPayload':
                     venenoObjectForWechat['addRecipientPayload'],
                     'groupLabel':
                     venenoObjectForWechat['groupName'],
                     'groupDetails':
                     venenoObjectForWechat['groupDetails'],
                     'groupVersionDetails':
                     venenoObjectForWechat['groupVersionResult'],
                     'campaignGroupRecipients':
                     venenoObjectForWechat['campaignGroupRecipient']
                 }
             }
         }
     else:
         raise Exception(
             "Channel :{} not Supported in preRequisites".format(channel))
 def setup_method(self, method):
     self.connObj = CampaignShardHelper.getConnObj(newConnection=True)
     Logger.logMethodName(method.__name__)