Ejemplo n.º 1
0
 def est_venenoThrift_inboxUser_WeChat_Sanity(self):
     actualOrgId = construct.updateOrgId(constant.config['wechat']['orgId'])
     actualOrgName = construct.updateOrgName(constant.config['wechat']['orgName'])
     try:
         details = VenenoHelper.preRequisitesForVenenoWechat(testControlType='skip')
         campaignMessage.getWeCRMTemplates()
         subject = {
             "template_id" : unicodedata.normalize('NFKD', constant.config['templateId']).encode('ascii', 'ignore'),
             "touser" : "{{wechat_open_id}}",
             "OriginalId" : constant.config['wechat']['OriginalId'],
             "Title" : "",
             "BrandId" : "f",
             "url" : "http://we.capillarytech-cn.com/web?appid=wxc7bf989decc7e35b&redirect_uri=http://somelink.com/someword?nowAParam=firstParam&second=second.Param&response_type=code&scope=snsapi_base&state=STATE",
             "TopColor" : "#000000",
             "data" : {"productType": {"value": "HakeemProduct", "color": "#00000"}, "name": {"value": "Hakeem {{first_name}} Lukka", "color": "#00000"}, "number": {"value": "898767 skdjnjn", "color": "#00000"}, "expDate": {"value": "look down", "color": "#00000"}, "remark": { "value": "Look up", "color": "#00000"}}
         }
         cdDetailsBody = {
              'campaignId':details['campaignId'],
              'communicationType':'WECHAT',
              'subject': str(subject),
              'body': 'Thrift Created Automation Wechat Body',
              'recipientListId':details['groupVersionResult']['TEST']['id'],
              'overallRecipientCount':details['groupVersionResult']['TEST']['customer_count'],
              'expectedDeliveryCount':details['groupVersionResult']['TEST']['customer_count'],
              'groupName':details['groupName']
             }
         communicationDetailObject = VenenoObject.communicationDetail(cdDetailsBody)
         communicationId = self.connObj.addMessageForRecipients(communicationDetailObject)
         VenenoDBAssertion(cdDetailsBody['campaignId'], cdDetailsBody['communicationType'], communicationId, cdDetailsBody['overallRecipientCount'], cdDetailsBody['recipientListId'], cdDetailsBody['subject'], testControlType='skip', skippedReasons=['Captured OpenId for user seems to be unsubscribed']).check()
     except Exception, exp:
         raise Exception('Wechat Case Failed due to :{}'.format(exp))
Ejemplo n.º 2
0
 def test_wechat_UI_channel_Sanity(self, request):
     try:
         details = VenenoHelper.preRequisitesForVenenoWechat()
         self.createCampaignPage.goToCampaignSection()
         self.createCampaignPage.openCampaignWithCampaignName(details['campaignName'])
         self.createCampaignPage.goToMessagePage('wechat')
         self.messagePage.chooseRecipient(details['groupName'])
         self.messagePage.attachIncentive('nodeal')
         self.messagePage.customizeContent(templateName='',channel='wechat')
         self.messagePage.deliverySetting()
         self.createCampaignPage.authorizePresentCampaignOnPage()
         self.messagePage.verifyAuthorizeCampaign(details['campaignId'], details['groupVersionResult']['TEST']['id'])
     except Exception,exp:
         self.getScreenshot(request.node.name)
         Assertion.constructAssertion(False, exp)