Esempio n. 1
0
 def test_irisV2_getPoc_WrongAuth(self):
     previousUserName = None
     try:
         previousUserName = IrisHelper.updateUserName('WrongName')
         response = Poc.getPoc()
         Poc.assertResponse(response, 401, 999999, 'Unauthorized')
     finally:
         if previousUserName is not None:
             IrisHelper.updateUserName(previousUserName)
Esempio n. 2
0
 def test_productCategory_wrongUserName(self, apiCategory):
     try:
         actualUserName = IrisHelper.updateUserName('ztyv')
         actualResult = ProductCategory.getLevelsForDimension(apiCategory)
         ProductCategory.assertResponse(actualResult,
                                        401,
                                        expectedErrorCode=999999,
                                        expectedErrorMessage='Unauthorized')
     finally:
         IrisHelper.updateUserName(actualUserName)
Esempio n. 3
0
 def test_irisV2_getLoyaltyProgram_WrongAuth(self):
     previousUserName = None
     try:
         previousUserName = IrisHelper.updateUserName('WrongName')
         response = LoyaltyProgram.getLoyaltyProgram()
         LoyaltyProgram.assertResponse(response, 401, 999999,
                                       'Unauthorized')
     finally:
         if previousUserName is not None:
             IrisHelper.updateUserName(previousUserName)
Esempio n. 4
0
 def test_irisV2_editCampaign_WrongAuth(self, description, campaignType,
                                        testControlType, editInfo,
                                        statusCode, errorCode,
                                        errorDescription):
     campaignInfo = CreateCampaign.create(campaignType,
                                          testControlType,
                                          updateNode=True)
     previousUserName = None
     try:
         previousUserName = IrisHelper.updateUserName('WrongName')
         editInfo = CreateCampaign.edit(campaignInfo, editInfo)
         Assertion.constructAssertion(
             editInfo['RESPONSE']['statusCode'] == statusCode,
             'Actual Status Code :{} and Expected : {}'.format(
                 editInfo['RESPONSE']['statusCode'], statusCode))
     finally:
         if previousUserName is not None:
             IrisHelper.updateUserName(previousUserName)
Esempio n. 5
0
 def test_irisv2_editMessage_with_wrongAuth(self, campaignType, testControlType,
                                              listType,
                                              channel, messageInfo, statusCode, errorCode,
                                              errorDescription):
     messageDetails = CreateMessage.create(campaignType, testControlType, listType, channel, messageInfo,
                                           updateNode=True, lockNode=True)
     message_calls().waitForJobDetailsStatusToClose(messageDetails['RESPONSE']['json']['entity']['id'],
                                                    'VARIANT_CREATION')
     CreateMessage.assertResponse(messageDetails['RESPONSE'], 200)
     previousUserName = None
     try:
         previousUserName = IrisHelper.updateUserName('WrongName')
         editInfo = CreateMessage.edit(constant.config['node'][campaignType][testControlType]['CAMPAIGN']['ID'],
                                       messageDetails['RESPONSE']['json']['entity']['id'], messageDetails['PAYLOAD'])
         CreateMessage.assertResponse(editInfo['RESPONSE'], 401, expectedErrorCode=[errorCode],
                                      expectedErrorMessage=errorDescription)
     finally:
         if previousUserName is not None: IrisHelper.updateUserName(previousUserName)
Esempio n. 6
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))
Esempio n. 7
0
 def test_testAndPreview_negative_validationCases_wrongAuth(self):
     previousAuth = IrisHelper.updateUserName('First')
     try:
         payload = copy.deepcopy(self.testAndControlPayload['SMS'])
         testPreviewResponse, testPreviewPayload = TestPreview.create(
             'LIVE', 'ORG', 'MOBILE', 0, payload=payload)
         TestPreview.assertResponse(testPreviewResponse, 401, 999999,
                                    'Unauthorized')
     except Exception, exp:
         Assertion.constructAssertion(False,
                                      'Exception Occured :{}'.format(exp))
Esempio n. 8
0
 def test_irisV2_getCampaign_ID_wrongAuth(self):
     previousUserName = None
     try:
         payload = copy.deepcopy(constant.payload['createcampaignv2'])
         payload.update({'name': 'test_irisV2_getCampaign_ID_wrongAuth_{}'.format(int(time.time()))})
         payload["testControl"].pop("testPercentage")
         campaignInfo = CreateCampaign.create('LIVE', 'ORG', payload=payload, updateNode=True, lockNode=True)
         previousUserName = IrisHelper.updateUserName('WrongName')
         getCampaignInfoResponse = GetCampaign.getById(campaignInfo['ID'])
         GetCampaign.assertResponse(getCampaignInfoResponse, 401, 999999,
                                    'Unauthorized')
     except Exception, exp:
         Assertion.constructAssertion(False, 'Exception :{}'.format(exp))
Esempio n. 9
0
 def test_approveMessage_negative_validationMessage_wrongAuth(self):
     previousUser = IrisHelper.updateUserName('XXXX')
     try:
         responseAuthorize = AuthorizeMessage.approveWithCampaignAndMessageId(
             self.campaignInfo['ID'],
             self.messageDetails['RESPONSE']['json']['entity']['id'])
         AuthorizeMessage.assertResponse(
             responseAuthorize,
             401,
             expectedErrorCode=999999,
             expectedErrorMessage='Unauthorized')
     except Exception, exp:
         Assertion.constructAssertion(False,
                                      'Exception Occured :{}'.format(exp))
Esempio n. 10
0
    def test_approveMessage_negative_validationMessage_wrongAuth(self):
        previousUser = IrisHelper.updateUserName('XXXX')
        try:
            responseAuthorize = AuthorizeMessage.approveWithCampaignAndMessageId(
                self.campaignInfo['ID'],
                self.messageDetails['RESPONSE']['json']['entity']['id'])
            AuthorizeMessage.assertResponse(
                responseAuthorize,
                401,
                expectedErrorCode=999999,
                expectedErrorMessage='Unauthorized')
        except Exception, exp:
            Assertion.constructAssertion(False,
                                         'Exception Occured :{}'.format(exp))
        finally:
            IrisHelper.updateUserName(previousUser)

    def test_approveMessage_negative_validationMessage_wrongOrgId(self):
        previousOrg = IrisHelper.updateOrgId(-1)
        Logger.log(constant.config['orgId'])
        try:
            responseAuthorize = AuthorizeMessage.approveWithCampaignAndMessageId(
                self.campaignInfo['ID'],
                self.messageDetails['RESPONSE']['json']['entity']['id'])
            AuthorizeMessage.assertResponse(
                responseAuthorize,
                401,
                expectedErrorCode=999999,
                expectedErrorMessage='Invalid org id')
        except Exception, exp:
            Assertion.constructAssertion(False,
Esempio n. 11
0
    def test_irisV2_getCampaign_ID_wrongAuth(self):
        previousUserName = None
        try:
            payload = copy.deepcopy(constant.payload['createcampaignv2'])
            payload.update({'name': 'test_irisV2_getCampaign_ID_wrongAuth_{}'.format(int(time.time()))})
            payload["testControl"].pop("testPercentage")
            campaignInfo = CreateCampaign.create('LIVE', 'ORG', payload=payload, updateNode=True, lockNode=True)
            previousUserName = IrisHelper.updateUserName('WrongName')
            getCampaignInfoResponse = GetCampaign.getById(campaignInfo['ID'])
            GetCampaign.assertResponse(getCampaignInfoResponse, 401, 999999,
                                       'Unauthorized')
        except Exception, exp:
            Assertion.constructAssertion(False, 'Exception :{}'.format(exp))
        finally:
            if previousUserName is not None: IrisHelper.updateUserName(previousUserName)



    @pytest.mark.parametrize('campaignType,testControlType', [

        ('LIVE', 'ORG')

    ])
    def test_irisV2_getCampaign_byId_for_Objective_and_GA(self, campaignType, testControlType):
        payload = copy.deepcopy(constant.payload['createcampaignv2'])
        payload.update({
            "name": "Automation_IRISV2_{}".format(int(time.time() * 1000)),
            "objective": {
                "objectiveName": "Boost_Sales"
            },
Esempio n. 12
0
            'Invalid request : Channel in message content is required.'
        ])

    def test_testAndPreview_negative_validationCases_wrongAuth(self):
        previousAuth = IrisHelper.updateUserName('First')
        try:
            payload = copy.deepcopy(self.testAndControlPayload['SMS'])
            testPreviewResponse, testPreviewPayload = TestPreview.create(
                'LIVE', 'ORG', 'MOBILE', 0, payload=payload)
            TestPreview.assertResponse(testPreviewResponse, 401, 999999,
                                       'Unauthorized')
        except Exception, exp:
            Assertion.constructAssertion(False,
                                         'Exception Occured :{}'.format(exp))
        finally:
            IrisHelper.updateUserName(previousAuth)

    def test_testAndPreview_negative_validationCases_emptyAuth(self):
        previousAuth = IrisHelper.updateUserName('')
        previousPass = IrisHelper.updatepassword('')
        try:
            payload = copy.deepcopy(self.testAndControlPayload['SMS'])
            testPreviewResponse, testPreviewPayload = TestPreview.create(
                'LIVE', 'ORG', 'MOBILE', 0, payload=payload)
            TestPreview.assertResponse(testPreviewResponse, 401, 999999,
                                       'Unauthorized')
        except Exception, exp:
            Assertion.constructAssertion(False,
                                         'Exception Occured :{}'.format(exp))
        finally:
            IrisHelper.updateUserName(previousAuth)