Exemple #1
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.actualOrgId = IrisHelper.updateOrgId(
         constant.config['reon']['orgId'])
     self.actualOrgName = IrisHelper.updateOrgName(
         constant.config['reon']['orgName'])
     CreateAudience.getPocUsers()
Exemple #2
0
 def test_irisV2_createAudience_Derived_ExistingListName(self):
     label = 'Automation_ExistingList_check_{}'.format(
         int(time.time() * 1000))
     CreateAudience.derivedList('LIVE',
                                'ORG',
                                label=label,
                                derivedListInfo={
                                    'includedGroups': ['UPLOAD', 'LOYALTY'],
                                    'excludedGroup': ['LOYALTY'],
                                    'noOfUserUpload': 5
                                })
     listDetail = CreateAudience.derivedList('LIVE',
                                             'ORG',
                                             label=label,
                                             derivedListInfo={
                                                 'includedGroups':
                                                 ['UPLOAD', 'LOYALTY'],
                                                 'excludedGroup':
                                                 ['LOYALTY'],
                                                 'noOfUserUpload':
                                                 5
                                             })
     CreateAudience.assertResponse(
         listDetail['RESPONSE'], 400, 5003,
         ['invalid request : Audience label already exits'])
Exemple #3
0
    def irisv2_message_execute_stickyList_particularDate_coupon(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        includeUsers = constant.config[
            'pocUsers'] + CreateAudience.getPocNewUsers(offset=5)
        approveRespone = AuthorizeMessage.approve(
            campaignType,
            testControlType,
            listType,
            channel,
            messageInfo,
            derivedListInfo={
                'excludeUsers': CreateAudience.getPocNewUsers(newUsers=True),
                'includeUsers': includeUsers,
                'groupId': self.listInfo[0]['gId'],
                'label': self.listInfo[0]['gLabel']
            })
        AuthorizeMessage.assertResponse(approveRespone, 200)

        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        response = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][messageInfo['scheduleType'][
                'type']][messageInfo['offerType']]['RESPONSE']
        payload = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][messageInfo['scheduleType'][
                'type']][messageInfo['offerType']]['PAYLOAD']

        AuthorizeMessageDBAssertion(campaignId, response, payload,
                                    testControlType).check()
Exemple #4
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     self.listInfo = CreateAudience.uploadList('LIVE', 'ORG')
     self.listInfoFilter = CreateAudience.FilterList('LIVE', 'ORG')
     constant.config['FilterListID'] = CreateAudience.FilterList(
         'LIVE', 'ORG', campaignCheck=False)['ID']
     CreateAudience.getPocUsers()
Exemple #5
0
 def test_irisV2_createAudience_Filter(self, campaignType, testControlType,
                                       listType):
     list = CreateAudience.FilterList(campaignType,
                                      testControlType,
                                      campaignCheck=False)
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               listType,
                               len(self.filterUserList),
                               reachabilityCheck=True).check()
Exemple #6
0
 def test_irisV2_createAudience_Derived_IncludeList_ExcludeList_MoreThan10Lists_NegativeCases(
         self, description, derivedListInfo, popfield, statusCode,
         errorCode, errorDescription):
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       updateNode=True,
                                       lockNode=True,
                                       campaignCheck=False,
                                       derivedListInfo=derivedListInfo,
                                       popFields=popfield)
     CreateAudience.assertResponse(list['RESPONSE'], statusCode, errorCode,
                                   errorDescription)
 def test_irisV2_createAudience_stickyList_NegativeCase_01(
         self, description, includeUsers, excludeUsers, statusCode,
         errorCode, errorMessage):
     list = CreateAudience.stickyList(
         'LIVE',
         'ORG',
         campaignCheck=False,
         stickyInfo={
             'excludeUsers': CreateAudience.getPocNewUsers() * excludeUsers,
             'includeUsers': constant.config['pocUsers'] * includeUsers
         })
     CreateAudience.assertResponse(list['RESPONSE'], statusCode, errorCode,
                                   errorMessage)
 def test_irisV2_getAudienceById_Filter(self, campaignType,
                                        testControlType):
     list = CreateAudience.FilterList(campaignType,
                                      testControlType,
                                      campaignCheck=False)
     CreateAudience.waitForGVDToBeUpdated(list['ID'], checkParams=False)
     response = GetAudienceById.getById(list['ID'])
     GetAudienceById.assertResponse(response, 200)
     GetListDBAssertion(
         list['ID'],
         response,
         bucketUsed=constant.orgDetails[constant.config['cluster']][
             constant.config['orgId']]['s3BucketName'],
         createAudienceJob=False).check()
Exemple #9
0
 def test_irisV2_createAudience_Derived_Include_SMS(
         self, description, campaignType, testControlType, listType,
         derivedListInfo, popfield):
     list = CreateAudience.derivedList(campaignType,
                                       testControlType,
                                       campaignCheck=False,
                                       derivedListInfo=derivedListInfo,
                                       popFields=popfield)
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               listType,
                               list['expectedUserCount'],
                               reachabilityCheck=True).check()
Exemple #10
0
 def test_irisV2_createAudience_Derived_IncludeExcludeList_WithInvalidIdInExcludeGroup_NegativeCases(
         self):
     payload = copy.deepcopy(constant.payload['derivedlist'])
     payload['includedGroups'] = [self.listId_1, self.listId_2]
     payload['excludedGroups'] = [99999]
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       updateNode=True,
                                       lockNode=True,
                                       campaignCheck=False,
                                       payload=payload)
     CreateAudience.assertResponse(
         list['RESPONSE'], 400, 5004,
         ['invalid audience group : audience groups not exists: [99999]'])
Exemple #11
0
 def test_irisV2_createAudience_Derived_IncludeExcludeList_WithSameIdInExcludeIncludeGroup_NegativeCases(
         self):
     payload = copy.deepcopy(constant.payload['derivedlist'])
     payload['includedGroups'] = [self.listId_1, self.listId_2]
     payload['excludedGroups'] = [self.listId_1]
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       updateNode=True,
                                       lockNode=True,
                                       campaignCheck=False,
                                       payload=payload)
     CreateAudience.assertResponse(list['RESPONSE'], 400, 5006, [
         'invalid request : groups added in both include and exclude : [{}]'
         .format(self.listId_1)
     ])
Exemple #12
0
 def test_irisV2_createAudience_Derived_IncludeList_WithoutFieldInPayload_NegativeCases(
         self, description, payloadChange, statusCode, errorCode,
         errorDescription):
     payload = copy.deepcopy(constant.payload['derivedlist'])
     payload.pop('excludedGroups')
     payload['includedGroups'] = [self.listId_1, self.listId_2]
     payload.pop(payloadChange)
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       updateNode=True,
                                       lockNode=True,
                                       campaignCheck=False,
                                       payload=payload)
     CreateAudience.assertResponse(list['RESPONSE'], statusCode, errorCode,
                                   errorDescription)
 def test_irisV2_createAudience_stickyList_NegativeCase_02(
         self, description, popFields, updatePayload, statusCode, errorCode,
         errorMessage):
     stickyData = {
         'excludeUsers': CreateAudience.getPocNewUsers(),
         'includeUsers': constant.config['pocUsers']
     }
     stickyData.update(updatePayload)
     list = CreateAudience.stickyList('LIVE',
                                      'ORG',
                                      campaignCheck=False,
                                      stickyInfo=stickyData,
                                      popFields=popFields)
     CreateAudience.assertResponse(list['RESPONSE'], statusCode, errorCode,
                                   errorMessage)
Exemple #14
0
 def test_irisV2_createAudience_Derived_IncludeList_SameListIdIncludedGroups_NegativeCases(
         self):
     payload = copy.deepcopy(constant.payload['derivedlist'])
     payload.pop('excludedGroups')
     payload['includedGroups'] = [self.listId_1, self.listId_1]
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       updateNode=True,
                                       lockNode=True,
                                       campaignCheck=False,
                                       payload=payload)
     CreateAudience.assertResponse(list['RESPONSE'], 400, 5006, [
         'invalid request : include groups contains duplicate',
         'invalid request : combine include and exclude groups size should be minimum 2'
     ])
 def test_irisV2_createAudience_stickyList(self, campaignType,
                                           testControlType, listType):
     list = CreateAudience.stickyList(campaignType,
                                      testControlType,
                                      campaignCheck=False,
                                      stickyInfo={
                                          'excludeUsers': [],
                                          'includeUsers': ':1'
                                      })
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               listType,
                               1,
                               reachabilityCheck=True).check()
    def tests_irisv2_getMessage_create_stickyList_particularDate_points(self, campaignType, testControlType,
                                                                       channel, messageInfo):
        includeUsers = constant.config['pocUsers'] + CreateAudience.getPocNewUsers(newUsers=True)
        CreateMessage.create(campaignType, testControlType, 'ORG_USERS', channel, messageInfo,
                                              derivedListInfo={'excludeUsers': CreateAudience.getPocNewUsers(),
                                                     'includeUsers': includeUsers,
                                                     'groupId': self.listInfo[0]['gId'],
                                                     'label': self.listInfo[0]['gLabel']})
        campaignId = constant.config['node'][campaignType][testControlType]['CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType]['LIST']['ORG_USERS'][channel]['MESSAGE'][
            messageInfo['scheduleType']['type']][messageInfo['offerType']]['RESPONSE']['json']['entity']['id']

        getMessageResponse = GetMessage.getMessageById(campaignId, messageId)
        GetMessage.assertResponse(getMessageResponse, 200)
        CreateMessageDBAssertion(campaignId, messageId, getMessageResponse['json']['entity'],offer=True).check()
Exemple #17
0
 def test_irisV2_createAudience_Derived_Include_Exclude_DifferentChannels(
         self, description, campaignType, testControlType, listType,
         derivedListInfo, schemaIdentifier, popfield):
     list = CreateAudience.derivedList(campaignType,
                                       testControlType,
                                       schemaIdentifier=[schemaIdentifier],
                                       newUser=False,
                                       campaignCheck=False,
                                       derivedListInfo=derivedListInfo,
                                       popFields=popfield)
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               listType,
                               list['expectedUserCount'],
                               reachabilityCheck=False).check()
Exemple #18
0
 def test_irisV2_checkAvailability_differentTypesOfList_Mobile(
         self, campaignType, testControlType, listType, schemaIdentifier):
     list = CreateAudience.uploadList(campaignType,
                                      testControlType,
                                      schemaIdentifier=schemaIdentifier)
     response = CheckAvailabiltyName.checkExists(list['NAME'])
     CheckAvailabiltyName.assertCheckExists(response, 200)
 def test_irisV2_createAudience_stickyList_NegativeCase_03(
         self, description, updatePayload, statusCode, errorCode,
         errorMessage):
     stickyData = {
         'excludeUsers': constant.config['pocUsers'],
         'includeUsers': constant.config['pocUsers'],
         'groupId': self.listInfo[0]['gId'],
         'label': self.listInfo[0]['gLabel']
     }
     stickyData.update(updatePayload)
     list = CreateAudience.stickyList('LIVE',
                                      'ORG',
                                      campaignCheck=False,
                                      stickyInfo=stickyData)
     CreateAudience.assertResponse(list['RESPONSE'], statusCode, errorCode,
                                   errorMessage)
 def irisv2_message_create_stickyList_immediate_coupon(
         self, campaignType, testControlType, channel, messageInfo):
     messageDetails = CreateMessage.create(
         campaignType,
         testControlType,
         'ORG_USERS',
         channel,
         messageInfo,
         derivedListInfo={
             'excludeUsers': CreateAudience.getPocNewUsers(newUsers=True),
             'includeUsers': CreateAudience.getPocNewUsers(offset=3)
         })
     CreateMessage.assertResponse(messageDetails['RESPONSE'], 200)
     CreateMessageDBAssertion(
         constant.config['node'][campaignType][testControlType]['CAMPAIGN']
         ['ID'], messageDetails['RESPONSE']['json']['entity']['id'],
         messageDetails['PAYLOAD']).check()
Exemple #21
0
 def test_irisV2_createAudience_Derived_IncludeList_InvalidFieldIncludedGroups_NegativeCases(
         self, description, payloadChange, statusCode, errorCode,
         errorDescription):
     payload = copy.deepcopy(constant.payload['derivedlist'])
     payload['includedGroups'] = [self.listId_1, self.listId_2]
     for eachKey in payload:
         if eachKey in payloadChange:
             value = payload[eachKey]
             payload.pop(eachKey)
             payload[payloadChange[eachKey]] = value
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       updateNode=True,
                                       lockNode=True,
                                       campaignCheck=False,
                                       payload=payload)
     CreateAudience.assertResponse(list['RESPONSE'], statusCode, errorCode,
                                   errorDescription)
Exemple #22
0
 def test_irisV2_createAudience_Derived_WithSpecialCharecters(self):
     label = '~!@#$%^&*)(_{}'.format(int(time.time() * 1000))
     list = CreateAudience.derivedList('LIVE',
                                       'ORG',
                                       label=label,
                                       derivedListInfo={
                                           'includedGroups':
                                           ['UPLOAD', 'UPLOAD', 'LOYALTY'],
                                           'excludedGroup': ['LOYALTY'],
                                           'noOfUserUpload':
                                           5
                                       })
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               'DERIVED',
                               list['expectedUserCount'],
                               reachabilityCheck=True).check()
Exemple #23
0
 def test_irisV2_createAudience_Derived_WithLabelLengthGretaerThan50Charecters_NegativeCases(
         self):
     label = 'Automation_ExistingList_checkkkkkkkkkkkkkk_{}'.format(
         int(time.time() * 1000))
     listDetail = CreateAudience.derivedList('LIVE',
                                             'ORG',
                                             label=label * 3,
                                             derivedListInfo={
                                                 'includedGroups':
                                                 ['UPLOAD', 'LOYALTY'],
                                                 'excludedGroup':
                                                 ['LOYALTY'],
                                                 'noOfUserUpload':
                                                 5
                                             })
     CreateAudience.assertResponse(listDetail['RESPONSE'], 400, 102, [
         'Invalid request : Invalid audience name. Name exceeds 160 characters. '
     ])
Exemple #24
0
 def getListInfo(campaignType, testControlType, listType, schemaIdentifier,
                 newUser, derivedListInfo):
     if schemaIdentifier.upper() == 'MOBILE_PUSH':
         return CreateAudience.uploadList(campaignType,
                                          testControlType,
                                          schemaIdentifier=['USER_ID'],
                                          schemaData=['USER_ID'],
                                          newUser=newUser,
                                          updateNode=True,
                                          lockNode=True,
                                          campaignCheck=False,
                                          mobilePush=True)
     if listType == 'UPLOAD':
         return CreateAudience.uploadList(
             campaignType,
             testControlType,
             schemaIdentifier=[schemaIdentifier],
             schemaData=[schemaIdentifier, 'FIRST_NAME'],
             newUser=newUser,
             campaignCheck=False)
     elif listType == 'LOYALTY':
         return CreateAudience.FilterList(
             campaignType,
             testControlType,
             schemaIdentifier=[schemaIdentifier],
             campaignCheck=False)
     elif listType == 'DERIVED':
         return CreateAudience.derivedList(
             campaignType,
             testControlType,
             schemaIdentifier=[schemaIdentifier],
             newUser=newUser,
             campaignCheck=False,
             derivedListInfo=derivedListInfo)
     elif listType == 'ORG_USERS':
         return CreateAudience.stickyList(
             campaignType,
             testControlType,
             schemaIdentifier=[schemaIdentifier],
             campaignCheck=False,
             stickyInfo=derivedListInfo)
     else:
         raise Exception(
             'ListTypeNotSupportedException:{}'.format(listType))
 def test_irisV2_createAudience_stickyList_newUsersAndGroupId(
         self, campaignType, testControlType, listType):
     customerCount = list_Calls().getCustomerCountInGVD(
         self.listInfo[0]['gId'])
     list = CreateAudience.stickyList(
         campaignType,
         testControlType,
         campaignCheck=False,
         stickyInfo={
             'excludeUsers': CreateAudience.getPocNewUsers(newUsers=True),
             'includeUsers': CreateAudience.getPocNewUsers(newUsers=True),
             'groupId': self.listInfo[0]['gId'],
             'label': self.listInfo[0]['gLabel']
         })
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               listType, (customerCount + 2),
                               reachabilityCheck=True,
                               isGVUpdated=True).check()
Exemple #26
0
 def test_irisV2_checkAvailability_OnlySuffixOfList(
         self, description, campaignType, testControlType, listType,
         schemaIdentifier, listName):
     list = CreateAudience.uploadList(campaignType,
                                      testControlType,
                                      label=listName +
                                      str(int(time.time())),
                                      schemaIdentifier=schemaIdentifier,
                                      updateNode=True,
                                      campaignCheck=False)
     response = CheckAvailabiltyName.checkExists(list['NAME'][1:])
     CheckAvailabiltyName.assertCheckExists(response, 200, isExists=False)
 def test_irisV2_createAudience_stickyList_ExcludePocUsersAndNewUsers(
         self, campaignType, testControlType, listType):
     stickyId = CreateAudience.stickyList(campaignType,
                                          testControlType,
                                          campaignCheck=False,
                                          updateNode=True,
                                          lockNode=True,
                                          stickyInfo={
                                              'excludeUsers': [],
                                              'includeUsers': ':1',
                                          })
     excludeUsers = constant.config[
         'pocUsers'] + CreateAudience.getPocNewUsers(newUsers=True)
     customerCount = list_Calls().getCustomerCountInGVD(stickyId['ID']) - 1
     list = CreateAudience.stickyList(
         campaignType,
         testControlType,
         campaignCheck=False,
         stickyInfo={
             'excludeUsers': excludeUsers,
             'includeUsers': CreateAudience.getPocNewUsers(newUsers=True),
             'groupId': stickyId['ID'],
             'label': stickyId['NAME']
         })
     CreateAudience.waitForGVDToBeUpdated(list['ID'])
     CreateAudienceDBAssertion(list['ID'],
                               list,
                               listType, (customerCount + 2),
                               reachabilityCheck=True,
                               isGVUpdated=True).check()
Exemple #28
0
    def test_irisv2_message_edit_immediate_live_create_plain_mobile_editStickyListMessage_negativeCase(self,
                                                                                                         campaignType,
                                                                                                         testControlType,
                                                                                                         channel,
                                                                                                         messageInfo,statusCode,errorCode,errorDescription):

        CreateAudience.getPocUsers()
        constant.config['FilterListID'] = CreateAudience.FilterList('LAPSED', 'ORG', campaignCheck=False)['ID']
        messageDetails = CreateMessage.create(campaignType, testControlType, 'ORG_USERS', channel, messageInfo,
                                              derivedListInfo={'excludeUsers': [], 'includeUsers': ':1'})
        CreateMessage.assertResponse(messageDetails['RESPONSE'], 200)
        messageDetails['PAYLOAD'].pop('targetAudience')
        messageDetails['PAYLOAD'].update({
            'targetAudience': {
                'orgUsers': [self.listInfoFilter['ID']]
            }
        })
        message_calls().waitForJobDetailsStatusToClose(messageDetails['RESPONSE']['json']['entity']['id'],
                                                       'VARIANT_CREATION')
        editInfo = CreateMessage.edit(constant.config['node'][campaignType][testControlType]['CAMPAIGN']['ID'],
                                      messageDetails['RESPONSE']['json']['entity']['id'], messageDetails['PAYLOAD'])
        CreateMessage.assertResponse(editInfo['RESPONSE'], 400, expectedErrorCode=[errorCode],
                                     expectedErrorMessage=errorDescription)
 def irisv2_message_create_stickyList_particularDate_points(
         self, campaignType, testControlType, channel, messageInfo):
     includeUsers = constant.config[
         'pocUsers'] + CreateAudience.getPocNewUsers(offset=8)
     messageDetails = CreateMessage.create(
         campaignType,
         testControlType,
         'ORG_USERS',
         channel,
         messageInfo,
         derivedListInfo={
             'excludeUsers': CreateAudience.getPocNewUsers(newUsers=True),
             'includeUsers': includeUsers,
             'groupId': self.listInfo[0]['gId'],
             'label': self.listInfo[0]['gLabel']
         })
     CreateMessage.assertResponse(messageDetails['RESPONSE'], 200)
     CreateMessageDBAssertion(
         constant.config['node'][campaignType][testControlType]['CAMPAIGN']
         ['ID'],
         messageDetails['RESPONSE']['json']['entity']['id'],
         messageDetails['PAYLOAD'],
         offer=True).check()
Exemple #30
0
    def test_approveMessage_USER_ID_positiveScenarios_WithDifferntCustomTags(self, campaignType, testControlType,
                                                                             listType,
                                                                             channel, messageInfo, customTags):
        listInfo = CreateAudience.uploadList(campaignType, testControlType, schemaIdentifier=[channel],
                                             schemaData=[channel, 'FIRST_NAME'] + customTags, newUser=False,
                                             campaignCheck=False, updateNode=True, lockNode=True)

        messageDetails = CreateMessage.create(campaignType, testControlType, listType, channel,
                                              messageInfo=messageInfo, listInfo=listInfo, updateNode=True,
                                              lockNode=True, numberOfCustomTag=len(customTags))
        if not message_calls().waitForJobDetailsStatusToClose(messageDetails['RESPONSE']['json']['entity']['id'],
                                                              'VARIANT_CREATION'):
            raise Exception('VariantNotCreatedException')

        campaignId = constant.config['node'][campaignType][testControlType]['CAMPAIGN']['ID']
        approveRespone = AuthorizeMessage.approveWithCampaignAndMessageId(campaignId,
                                                                          messageDetails['RESPONSE']['json'][
                                                                              'entity']['id'])
        AuthorizeMessage.assertResponse(approveRespone, 200)
        AuthorizeMessageDBAssertion(campaignId, messageDetails['RESPONSE'], messageDetails['PAYLOAD'],
                                    testControlType).check()