#coding=utf-8
#author='Shichao-Dong'

import os,sys
from appium import webdriver
import time
import public
import unittest

class kaoqin(unittest.TestCase):
    '''
    考勤相关
    '''
    @classmethod
    def setUpClass(cls):
        # os.system('start startAppiumServer.bat')
        # time.sleep(8)
        cls.driver=public.login()
    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()
        # os.system('start stopAppiumServer.bat')
    def setUp(self):
        pass
    def tearDown(self):
        pass

    def test_1qingjia(self):
        u'考勤'
        try:
            self.assertTrue(self.driver.find_element_by_name(u'工作台'),msg=u'进入工作台失败')
        except Exception as msg:
            print (msg)
            public.screenshot(u"考勤.png")
        public.get_name(u"考勤").click()
        self.driver.implicitly_wait(2)
        public.get_name(u'请假申请').click()
        self.driver.implicitly_wait(4)
        self.driver.find_elements_by_class_name('android.widget.TextView')[1].send_keys(u'2017-01-06  周五  10:30')
        public.screenshot(u"时间.png")
        time.sleep(5)

if __name__=="__main__":
    unittest.main()