示例#1
0
class Testnotice():
    def __init__(self):
        self.donoti = Donotice()
        self.com = Common()

    def test_notice(self, headline, exp):
        self.donoti.do_notice(headline)
        self.com.asert_text_equa('msg', exp)
示例#2
0
class Test_login():
    def __init__(self):
        self.com =Common()
    def test_login(self):
        lists = self.com.get_data('data.csv')
        for li in lists:
            login =Login()
            login.login_go(li['username'],li['password'])
            self.com.asert_login()

    def test_login_fil(self):
        lists = self.com.get_data('data_file.csv')
        for li in lists:
            login =Login()
            login.login_go(li['username'],li['password'])
            self.com.asert_logfil()

    def test_login_success(self,username,password):

        lg = Login()
        lg.login_go(username,password)
        self.com.asert_login()
示例#3
0
class Login():
    def __init__(self):
        self.com = Common()
        self.dr = self.com.get_dr()
        self.dr.implicitly_wait(5)

    def login_user(self):
        return self.dr.find_element_by_id('username')

    def login_pwd(self):
        return self.dr.find_element_by_id('password')

    def login_click(self):
        return self.dr.find_element_by_id('login')

    def login_go(self, username, password):

        # for li in self.com.get_data(file):
        # print(li['username'])
        self.login_user().send_keys(username)
        self.login_pwd().send_keys(password)
        self.login_click().click()
        time.sleep(2)
示例#4
0
 def __init__(self):
     self.com = Common()
     self.dr = self.com.get_dr()
     self.dr.implicitly_wait(5)
示例#5
0
 def __init__(self):
     self.com =Common()
示例#6
0
 def __init__(self):
     self.com = Common()
     self.dr = self.com.dr
示例#7
0
 def __init__(self):
     self.donoti = Donotice()
     self.com = Common()
示例#8
0
from class_69.CBT.common import Common
from class_69.CBT.test_logn import Test_login
from class_69.CBT.test_notice import Testnotice

com = Common()

values = com.get_data('data.csv')
# sum = com.get_count("SELECT count(*) FROM `customer`")  #通过数据库获取数量
for value in values:
    username = value['username']
    password = value['password']
    verify = value['vrifyco']
    headline = value['headline']
    exp = value['exp']
    tl = Test_login()
    tl.test_login_success(username, password)
    tn = Testnotice()
    tn.test_notice(headline, exp)