Exemplo n.º 1
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')
Exemplo n.º 2
0
    def test_irisv2_getMessageVariant_create_upload_mobile_immediate_plain_lapsed(
            self, campaignType, testControlType, listType, channel,
            messageInfo):
        CreateCampaign.create(
            campaignType,
            testControlType,
            endDate=int(time.time() * 1000) +
            5 * 60 * 1000)  # Extending Campaign for 5 Mins to set message
        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.getMessageVariantById(
                campaignId,
                message_calls().getVariantIdByMessageId(messageId))
            GetMessage.assertResponse(getMessageResponse, 200)
            VariantDBAssertion(campaignId, messageId,
                               [getMessageResponse['json']['entity']]).check()
        else:
            Assertion.constructAssertion(
                False, 'Variant_Creation is Not Closed in Specified time')
Exemplo n.º 3
0
 def test_irisv2_getMessage_All_Campaign_Variations(self, campaignType,
                                                    testControlType):
     campaignId = GetMessage.getCampaignID(campaignType, testControlType)
     getMessageAllResponse = GetMessage.getMessageAll(campaignId)
     GetMessage.assertResponse(getMessageAllResponse, 200)
     GetMessage.validateGetAll(getMessageAllResponse['json']['data'],
                               campaignId)
Exemplo n.º 4
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)
Exemplo n.º 5
0
 def test_getMessage_negative_validationMessage_usingVarinatId(
         self, wrongMessageId):
     response = GetMessage.getMessageVariantById(self.campaignId,
                                                 wrongMessageId)
     GetMessage.assertResponse(
         response, 400, 3023,
         'Message with message id variant does not exists')
Exemplo n.º 6
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))
Exemplo n.º 7
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()
Exemplo n.º 8
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')
Exemplo n.º 9
0
 def test_irisv2_getMessage_All_WithQueryParam_targetAudience(
         self, campaignType, testControlType):
     campaignId = GetMessage.getCampaignID(campaignType, testControlType)
     getMessageAllResponse = GetMessage.getMessageAll(
         campaignId, queryParam=[('includeAudience', 'true')])
     GetMessage.assertResponse(getMessageAllResponse, 200)
     GetMessage.validateGetAllAudienceInclude(
         getMessageAllResponse['json']['data'], campaignId)
Exemplo n.º 10
0
 def test_irisv2_getMessage_All_WhenNoMessageInCampaign(self):
     campaignId = GetMessage.getCampaignIDHavingNoMessage('LIVE', 'ORG')
     getMessageAllResponse = GetMessage.getMessageAll(campaignId)
     GetMessage.assertResponse(getMessageAllResponse, 200)
     Assertion.constructAssertion(
         len(getMessageAllResponse['json']['data']) == 0,
         'Lenght Of getMessage Array is :{}'.format(
             len(getMessageAllResponse['json']['data'])))
Exemplo n.º 11
0
 def test_getMessage_negative_validationMessage_getVariant_withMessageId(
         self):
     response = GetMessage.getMessageVariantById(
         self.campaignId,
         self.messageDetails['RESPONSE']['json']['entity']['id'])
     GetMessage.assertResponse(
         response, 400, 3040,
         'Message variant with id {} does not exists'.format(
             self.messageDetails['RESPONSE']['json']['entity']['id']))
Exemplo n.º 12
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()
Exemplo n.º 13
0
    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()
Exemplo n.º 14
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))
Exemplo n.º 15
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()
Exemplo n.º 16
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']))
Exemplo n.º 17
0
 def test_irisv2_getMessage_All_WithQueryParam_targetAudience_Variant_False(
         self, campaignType, testControlType):
     campaignId = GetMessage.getCampaignID(campaignType, testControlType)
     getMessageAllResponse = GetMessage.getMessageAll(
         campaignId,
         queryParam=[('includeVariant', 'false'),
                     ('includeAudience', 'false')])
     GetMessage.assertResponse(getMessageAllResponse, 200)
     GetMessage.validateGetAll(getMessageAllResponse['json']['data'],
                               campaignId)
     GetMessage.validateGetAllIncludeVariantAndAudienceAsFalse(
         response=getMessageAllResponse['json']['data'])
Exemplo n.º 18
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))
Exemplo n.º 19
0
    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()
Exemplo n.º 20
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')
Exemplo n.º 21
0
    def test_irisv2_getMessageVariant_create_upload_mobile_immediate_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.getMessageVariantById(
            campaignId,
            message_calls().getVariantIdByMessageId(messageId))
        GetMessage.assertResponse(getMessageResponse, 200)
        VariantDBAssertion(campaignId, messageId,
                           [getMessageResponse['json']['entity']]).check()
    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()
Exemplo n.º 23
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()
Exemplo n.º 24
0
    def test_irisv2_getMessageVariant_create_upload_mobile_immediate_plain_additionalProperties_UsingRateLimit(
            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.getMessageVariantById(
            campaignId,
            message_calls().getVariantIdByMessageId(messageId))
        GetMessage.assertResponse(getMessageResponse, 200)
        VariantDBAssertion(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')
Exemplo n.º 26
0
 def test_getMessage_negative_validationMessage_withoutTheMessageId(
         self, wrongMessageId):
     response = GetMessage.getMessageById(self.campaignId, wrongMessageId)
     GetMessage.assertResponse(response, 200)
Exemplo n.º 27
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)