Example #1
0
    def test_irisv2_getMessage_queryParam_withTargetAudience(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateMessage.create(campaignType, testControlType, listType, channel,
                             messageInfo)

        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][
                messageInfo['scheduleType']['type']][messageInfo['offerType']][
                    'RESPONSE']['json']['entity']['id']

        getMessageResponse = GetMessage.getMessageById(
            campaignId, messageId, [('includeAudience', 'true')])
        GetMessage.assertResponse(getMessageResponse, 200)
        CreateMessageDBAssertion(campaignId, messageId,
                                 getMessageResponse['json']['entity']).check()
        GetListDBAssertion(
            constant.config['node'][campaignType][testControlType]['LIST']
            [listType][channel]['ID'], {
                'json': {
                    'entity':
                    getMessageResponse['json']['entity']['targetAudience']
                    ['includeAudienceGroupInfo'][0]
                }
            },
            campaignHashLookUp=False,
            createAudienceJob=False,
            reachabilityCheck=False,
            campaignGroupRecipients=False).check()
Example #2
0
 def test_getMessage_negative_validationMessage_wrongValueOfIncludeVariant(
         self):
     response = GetMessage.getMessageById(
         self.campaignId,
         self.messageDetails['RESPONSE']['json']['entity']['id'],
         queryParam=[('includeAudience', '$$$$$$')])
     GetMessage.assertResponse(response, 200)
Example #3
0
 def test_getMessage_negative_validationMessage_wrongValueOfMessageId(
         self, wrongMessageId):
     response = GetMessage.getMessageById(self.campaignId, wrongMessageId)
     GetMessage.assertResponse(
         response, 400, 3023,
         'Message with message id {} does not exists'.format(
             wrongMessageId))
Example #4
0
    def test_irisv2_getMessage_queryParam_withVariation(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateMessage.create(campaignType, testControlType, listType, channel,
                             messageInfo)

        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][
                messageInfo['scheduleType']['type']][messageInfo['offerType']][
                    'RESPONSE']['json']['entity']['id']

        for eachType in ['MESSAGE_TARGET_AUDIENCE', 'VARIANT_CREATION']:
            status = message_calls().waitForJobDetailsStatusToClose(
                messageId, eachType, maxNumberOfAttempts=20)

        if status:
            getMessageResponse = GetMessage.getMessageById(
                campaignId, messageId, [('includeVariant', 'true')])
            GetMessage.assertResponse(getMessageResponse, 200)
            CreateMessageDBAssertion(
                campaignId, messageId,
                getMessageResponse['json']['entity']).check()
            VariantDBAssertion(
                campaignId, messageId, getMessageResponse['json']['entity']
                ['messageVariantList']).check()
        else:
            Assertion.constructAssertion(
                False, 'Variant_Creation is Not Closed in Specified time')
Example #5
0
 def test_getMessage_negative_validationMessage_wrongCampaignId(self):
     response = GetMessage.getMessageById(
         99999,
         self.messageDetails['RESPONSE']['json']['entity']['id'],
         queryParam=[('includeAudience', '$$$$$$')])
     GetMessage.assertResponse(
         response, 400, 1007,
         'Campaign Id Exception : Invalid Campaign Id Passed 99999')
Example #6
0
    def test_irisv2_getMessage_create_filter_mobile_Recurring_points(self, campaignType, testControlType, listType,
                                                                   channel, messageInfo):
        CreateMessage.create(campaignType, testControlType, listType, channel, messageInfo)
        campaignId = constant.config['node'][campaignType][testControlType]['CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType]['LIST'][listType][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']).check()
Example #7
0
 def test_getMessage_negative_validationMessagewrongAuth(self):
     previousUser = IrisHelper.updateUserName('XXXXXX')
     try:
         response = GetMessage.getMessageById(
             self.campaignId,
             self.messageDetails['RESPONSE']['json']['entity']['id'],
             queryParam=[('include', 'true')])
         GetMessage.assertResponse(response, 401, 999999, 'Unauthorized')
     except Exception, exp:
         Assertion.constructAssertion(False,
                                      'Exception Occured :{}'.format(exp))
Example #8
0
    def test_irisv2_getMessage_create_filter_mobile_plain_UsingTinyURL(self, campaignType, testControlType,
                                                                               listType, channel, messageInfo):
        messageInfo= CreateMessage.create(campaignType, testControlType, listType, channel, messageInfo,
                             updateNode=True,
                             lockNode=True)
        campaignId = constant.config['node'][campaignType][testControlType]['CAMPAIGN']['ID']
        messageId = messageInfo['RESPONSE']['json']['entity']['id']

        getMessageResponse = GetMessage.getMessageById(campaignId, messageId)
        GetMessage.assertResponse(getMessageResponse, 200)
        CreateMessageDBAssertion(campaignId, messageId, getMessageResponse['json']['entity']).check()
    def tests_irisv2_getMessage_Sanity_create_stickyList_immediate_plain(self, campaignType, testControlType,
                                                                 channel, messageInfo):
        CreateMessage.create(campaignType, testControlType, 'ORG_USERS', channel, messageInfo, derivedListInfo={'excludeUsers': [], 'includeUsers': ':1'})

        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']).check()
Example #10
0
 def test_getMessage_negative_validationMessage_withCampaignId_differentCampaign(
         self):
     campaignInfo = CreateCampaign.create('LIVE', 'CUSTOM')
     diffId = campaignInfo['ID']
     response = GetMessage.getMessageById(
         diffId,
         self.messageDetails['RESPONSE']['json']['entity']['id'],
         queryParam=[('includeAudience', '$$$$$$')])
     GetMessage.assertResponse(
         response, 400, 3023,
         'Message with message id {} does not exists'.format(
             self.messageDetails['RESPONSE']['json']['entity']['id']))
    def tests_irisv2_getMessage_create_stickyList_immediate_points(self, campaignType, testControlType,
                                                                  channel, messageInfo):
        CreateMessage.create(campaignType, testControlType, 'ORG_USERS', channel, messageInfo,
                                              derivedListInfo={'excludeUsers': CreateAudience.getPocNewUsers(),
                                                     'includeUsers': constant.config['pocUsers'] + CreateAudience.getPocNewUsers(newUsers=True),
                                                     '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()
Example #12
0
 def test_getMessage_negative_validationMessage_wrongOrgId(self):
     previousOrgId = IrisHelper.updateOrgId(0)
     try:
         response = GetMessage.getMessageById(
             self.campaignId,
             self.messageDetails['RESPONSE']['json']['entity']['id'],
             queryParam=[('include', 'true')])
         GetMessage.assertResponse(
             response, 400, 1007,
             'Campaign Id Exception : Invalid Campaign Id Passed {}'.format(
                 self.campaignId))
     except Exception, exp:
         Assertion.constructAssertion(False,
                                      'Exception Occured :{}'.format(exp))
Example #13
0
    def test_irisv2_getMessage_queryParam_WithBothTargetAudienceAndVariation_HavingOffer(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateMessage.create(campaignType, testControlType, listType, channel,
                             messageInfo)

        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][
                messageInfo['scheduleType']['type']][messageInfo['offerType']][
                    'RESPONSE']['json']['entity']['id']

        for eachType in ['MESSAGE_TARGET_AUDIENCE', 'VARIANT_CREATION']:
            status = message_calls().waitForJobDetailsStatusToClose(
                messageId, eachType, maxNumberOfAttempts=20)

        if status:
            getMessageResponse = GetMessage.getMessageById(
                campaignId, messageId, [('includeVariant', 'true'),
                                        ('includeAudience', 'true')])
            GetMessage.assertResponse(getMessageResponse, 200)
            CreateMessageDBAssertion(
                campaignId, messageId,
                getMessageResponse['json']['entity']).check()
            VariantDBAssertion(
                campaignId,
                messageId,
                getMessageResponse['json']['entity']['messageVariantList'],
                offer=True).check()
            GetListDBAssertion(
                constant.config['node'][campaignType][testControlType]['LIST']
                [listType][channel]['ID'], {
                    'json': {
                        'entity':
                        getMessageResponse['json']['entity']['targetAudience']
                        ['includeAudienceGroupInfo'][0]
                    }
                },
                campaignHashLookUp=False,
                createAudienceJob=False,
                reachabilityCheck=False,
                campaignGroupRecipients=False).check()
        else:
            Assertion.constructAssertion(
                False, 'Variant_Creation is Not Closed in Specified time')
    def test_irisv2_getMessage_mobilePush_queryParam_withTargetAudience(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateMessage.create(campaignType, testControlType, listType, channel,
                             messageInfo)

        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][
                messageInfo['scheduleType']['type']][messageInfo['offerType']][
                    'RESPONSE']['json']['entity']['id']

        getMessageResponse = GetMessage.getMessageById(
            campaignId, messageId, [('includeAudience', 'true')])
        GetMessage.assertResponse(getMessageResponse, 200)
        CreateMessageDBAssertion(campaignId, messageId,
                                 getMessageResponse['json']['entity']).check()
Example #15
0
    def test_irisv2_getMessage_create_mobilePush_id_immediate_plain_lapsed(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateCampaign.create(campaignType,
                              testControlType,
                              endDate=int(time.time() * 1000) + 5 * 60 * 1000)
        CreateMessage.create(campaignType, testControlType, listType, channel,
                             messageInfo)
        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][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']).check()
    def test_irisv2_getMessage_mobilePush_queryParam_With_QueryParamPassedButAsFalse(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateMessage.create(campaignType, testControlType, listType, channel,
                             messageInfo)

        campaignId = constant.config['node'][campaignType][testControlType][
            'CAMPAIGN']['ID']
        messageId = constant.config['node'][campaignType][testControlType][
            'LIST'][listType][channel]['MESSAGE'][
                messageInfo['scheduleType']['type']][messageInfo['offerType']][
                    'RESPONSE']['json']['entity']['id']

        for eachType in ['MESSAGE_TARGET_AUDIENCE', 'VARIANT_CREATION']:
            status = message_calls().waitForJobDetailsStatusToClose(
                messageId, eachType, maxNumberOfAttempts=20)

        if status:
            getMessageResponse = GetMessage.getMessageById(
                campaignId, messageId, [('includeVariant', 'false'),
                                        ('includeAudience', 'false')])
            GetMessage.assertResponse(getMessageResponse, 200)
            CreateMessageDBAssertion(
                campaignId, messageId,
                getMessageResponse['json']['entity']).check()
            Assertion.constructAssertion(
                'messageVariantList'
                not in getMessageResponse['json']['entity'],
                'messageVariantList Key Check in Response',
                verify=True)
            Assertion.constructAssertion(
                'includeAudienceGroupInfo'
                not in getMessageResponse['json']['entity']['targetAudience'],
                'includeAudienceGroupInfo Key Check in Response->json->Entity->message->targetAudience',
                verify=True)
        else:
            Assertion.constructAssertion(
                False, 'Variant_Creation is Not Closed in Specified time')
Example #17
0
 def test_getMessage_negative_validationMessage_withoutTheMessageId(
         self, wrongMessageId):
     response = GetMessage.getMessageById(self.campaignId, wrongMessageId)
     GetMessage.assertResponse(response, 200)
Example #18
0
 def test_getMessage_negative_validationMessage_unknownQueryParam(self):
     response = GetMessage.getMessageById(
         self.campaignId,
         self.messageDetails['RESPONSE']['json']['entity']['id'],
         queryParam=[('include', 'true')])
     GetMessage.assertResponse(response, 200)