Beispiel #1
0
 def chat_date(self):
     driver = self.driver
     try:
         driver.find_element_by_id(cit).click()
         time.sleep(1)
         driver.find_element_by_css_selector("div#" + ciw + " i.icon-create-network").click()
         chain = ActionChains(driver)
         me = driver.find_element_by_xpath(
             "/html/body/form/div[5]/div/div/div[2]/div[@id='" + ciw + "']/div[1]/div[3]/div/div[1]/div/div/ul/li[2]"
         )
         chain.move_to_element(me).perform()
         time.sleep(2)
         driver.find_element_by_css_selector("div#" + ciw + " li.menuItem.btnNewSchedule").click()
         time.sleep(3)
         datename = time.ctime()
         member = Config.member
         Funtion.datedata(datename, *member)
         time.sleep(3)
         try:
             driver.find_element_by_xpath('//div[@class="cardContent"][text()="' + datename + '"]')
             cdr = "PASS"
         except:
             cdr = "FAIL"
     except:
         cdr = "DONE"
     return cdr
Beispiel #2
0
 def date_newdate(self):
     driver = self.driver
     member = Config.member
     global datename
     try:
         driver.find_element_by_xpath(u"//button[@type='button' and text()=\"列表\"]").click()
         time.sleep(2)
         driver.find_element_by_xpath(u"//div[@id=\"addNewClaendar\" and text()=\"新日程\"]").click()
         datename = u"新建一个" + time.ctime()
         time.sleep(3)
         Funtion.datedata(datename,*member)
         time.sleep(3)
         try:
             driver.find_element_by_css_selector("[class='icon-task-status-complete']")
             dnd = "PASS"
             #driver.find_element_by_css_selector("span.dialogCloseBtn.icon-task-delete").find_element_by_xpath("..").click()
             for i in range(0,10):
                 try:
                     driver.find_element_by_css_selector("[class='icon-task-status-complete']")
                     driver.find_element_by_css_selector("span.dialogCloseBtn.icon-task-delete").click()
                     time.sleep(0.5)
                 except:
                     break
         except:
             dnd = "FAIL"
     except:
     	  dnd = "DONE"
     time.sleep(1)
     return dnd