def __check(self, text, bExpress): if "m_enableIgnore" in dir(self) and self.m_enableIgnore: return if self.bEnableTrace: WBXTF.WBXTFCheck(text, bExpress) else: WBXTF.WBXTFCheck("", bExpress)
def checkChatAllLastInfo(self, sCommand): nNum = 0 if self.env.getHost() != None: nNum = nNum + 1 nNum = nNum + len(self.env.getAttendees()) ress = self.env.sendToAll("chat.GetAllChatMsg()") if len(ress) != nNum: WBXTF.WBXTFCheck("Verify chat", False) return False for res in ress: try: nCount = len(res["result"]["result"]) if nCount == 0: WBXTF.WBXTFCheck( "Verify the last chat string: not get the chat from attendee", False) return False lastText = res["result"]["result"][nCount - 1]["Chatmsg"] if lastText != sCommand: WBXTF.WBXTFCheck( "Verify the last chat string: chat message does not match", False) return False except Exception: WBXTF.WBXTFCheck("Verify the last chat string" % (ress), False) return False WBXTF.WBXTFCheck("Verify the last chat string", True) return True
def checkPollingAnswers(self): resAttendees = self.env.sendToAttendee("polling.GetPollAnswers()") resHosts = self.env.sendToHost("polling.GetPollAnswers()") for resA in resAttendees: try: bCorrect = 0 for resH in resHosts[0]["result"]["result"]: if resA["result"]["result"][0] == resH: bCorrect = 1 if bCorrect == 0: strErrorMsg = "Verify polling data:" \ "Sender userid=" + str(resA["result"]["result"][0]["userid"]) + \ "answer:" + str(resA["result"]["result"][0]["answer"]) WBXTF.WBXTFCheck(strErrorMsg, False) return False elif bCorrect == 1: strResMsg = "Verify polling data:"\ "Sender userid=" + str(resA["result"]["result"][0]["userid"]) WBXTF.WBXTFCheck(strResMsg, True) return True except Exception: WBXTF.WBXTFCheck("Verify polling data: Error", False) return False