Exemplo n.º 1
0
    def test_outboundCampaign_differentName_parellelRequest(self):
        que = Queue.Queue()
        threads_list = list()

        for i in range(1, 11):
            threads_list.append(
                Thread(target=lambda q, arg1: q.put(
                    {'createCampaign': campaigns.createCampaign(arg1)}),
                       args=(que, {
                           'name':
                           str(i) + '_' + str(int(time.time() * 100000)),
                           'goalId':
                           constant.irisGenericValues['goalId'],
                           'objectiveId':
                           constant.irisGenericValues['objectiveId']
                       })))
        [x.start() for x in threads_list]
        [x.join() for x in threads_list]

        while not que.empty():
            result = que.get().get('createCampaign')
            Logger.log('Checking for Campaign Created:', result)
            campaigns.assertCreateCampaign(result[0], 200)
            campaigns.assertCreateCampaignDBCall(
                result[0]['json']['entity']['campaignId'], result[1])
Exemplo n.º 2
0
 def test_outboundCampaign_Sanity(self):
     response, payload = campaigns.createCampaign({
         'name':
         'IRIS_' + str(int(time.time() * 100000)),
         'goalId':
         constant.irisGenericValues['goalId'],
         'objectiveId':
         constant.irisGenericValues['objectiveId']
     })
     campaigns.assertCreateCampaign(response, 200)
     campaigns.assertCreateCampaignDBCall(
         response['json']['entity']['campaignId'], payload)
Exemplo n.º 3
0
 def test_outboundCampaign_differentCampaignName_positiveScenario(
         self, caseName, campaignName):
     response, payload = campaigns.createCampaign({
         'name':
         campaignName,
         'goalId':
         constant.irisGenericValues['goalId'],
         'objectiveId':
         constant.irisGenericValues['objectiveId']
     })
     campaigns.assertCreateCampaign(response, 200)
     campaigns.assertCreateCampaignDBCall(
         response['json']['entity']['campaignId'], payload)
Exemplo n.º 4
0
 def createCampaign():
     response, payload = campaigns.createCampaign({
         'name':
         'IRIS_' + str(int(time.time())),
         'goalId':
         constant.irisGenericValues['goalId'],
         'objectiveId':
         constant.irisGenericValues['objectiveId']
     })
     campaigns.assertCreateCampaign(response, 200)
     campaigns.assertCreateCampaignDBCall(
         response['json']['entity']['campaignId'], payload)
     return response['json']['entity']['campaignId']
Exemplo n.º 5
0
 def test_outboundCampaign_googleAnalytics(self):
     response, payload = campaigns.createCampaign({
         'name':
         'IRIS_' + str(int(time.time() * 100000)),
         'goalId':
         constant.irisGenericValues['goalId'],
         'objectiveId':
         constant.irisGenericValues['objectiveId'],
         'gaName':
         'Test',
         'gaSource':
         'Automation'
     })
     campaigns.assertCreateCampaign(response, 200)
     campaigns.assertCreateCampaignDBCall(
         response['json']['entity']['campaignId'], payload)
Exemplo n.º 6
0
 def test_outboundCampaign_sameName_SequentialRequest(self):
     response, payload = campaigns.createCampaign({
         'name':
         'IRIS_' + str(int(time.time() * 100000)),
         'goalId':
         constant.irisGenericValues['goalId'],
         'objectiveId':
         constant.irisGenericValues['objectiveId']
     })
     campaigns.assertCreateCampaign(response, 200)
     campaigns.assertCreateCampaignDBCall(
         response['json']['entity']['campaignId'], payload)
     response, payload = campaigns.createCampaign({
         'goalId':
         constant.irisGenericValues['goalId'],
         'objectiveId':
         constant.irisGenericValues['objectiveId'],
         'name':
         payload['name']
     })
     campaigns.assertCreateCampaign(
         response, 400, 1003,
         'Campaign Name Exception : Campaign Name already exists')