''' from os import sys,path from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException import unittest, time, re from time import sleep from public import pub_shipan_accountinfo, login_page from test_case.public.readFile import read_jsonFile sys.path.append("\public") filepath = path.join(path.dirname(path.dirname(path.abspath(__file__))), "test_data\\register.json") #print filepath json_data =read_jsonFile(filepath) class TestOpenShipan(unittest.TestCase): def setUp(self): self.dr = webdriver.Firefox() self.dr.implicitly_wait(30) self.base_url = "http://10.0.250.209/" self.verificationErrors = [] self.accept_next_alert = True def test_open_shipan(self): self.dr.get(json_data["url"]) login_page.LoginPage(self.dr).login(json_data["email"], json_data["edit_password"], json_data["code"]) sleep(3) pub_shipan_accountinfo.Pub(self.dr).open_account_with_male_inputpostid(json_data["nickname"],json_data['province'],json_data['city'], json_data['region'],json_data['address'],json_data["phone"],json_data['memberno'],json_data['referrer'],
Function: @author: lina To me :Believe yourself! ''' import sys from selenium import webdriver import unittest import time from os import path from test_case.public.readFile import read_jsonFile sys.path.append("\public") from public import readFile from public import login_page filepath = path.join(path.dirname(path.dirname(path.abspath(__file__))), "test_data\\register.json") json_data = read_jsonFile(filepath) file_path = path.join(path.dirname(path.dirname(path.abspath(__file__))), "test_data\\edit_first_pwd.json") pwd_data = read_jsonFile(file_path) class TestLogin(unittest.TestCase): def setUp(self): self.dr = webdriver.Firefox() self.dr.implicitly_wait(30) self.dr.get(pwd_data['login_url']) self.login_=login_page.LoginPage(self.dr) def test_first_login(self): self.assertTrue("您已通过验证" ,self.login_.get_text_msg()) time.sleep(15)