Beispiel #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')
Beispiel #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')
Beispiel #3
0
 def validateGetAllVaraintsInclude(response, campaignId):
     for eachMessage in response:
         if 'messageVariantList' in eachMessage:
             VariantDBAssertion(campaignId, eachMessage['messageId'],
                                eachMessage['messageVariantList']).check()
         else:
             Assertion.constructAssertion(False, 'messageVariantList Not Found for MessageId :{}'.format(
                 eachMessage['messageId']), verify=True)
Beispiel #4
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')
Beispiel #5
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()
Beispiel #6
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()