def test_login(self,browser): rd = Read_config() role = rd.angency_role('tester01') url=rd.angency_url('login') self.page_login(browser).driver.get(url) browser.maximize_window() username = role[0] verification = role[1] ele_username = self.page_login(browser).ele_username() ele_input(ele_username, username) ele_verification = self.page_login(browser).ele_verification() ele_input(ele_verification, verification) ele_login = self.page_login(browser).ele_login() ele_login.click() dashboard=self.page_dashboard(browser) window_by=dashboard.window_by() ele_window=is_ele_exist(browser,window_by) if ele_window: print('发现弹窗') ele_window.click() dashboard.ele_window_confirm().click() url_dashboard = rd.angency_url('dashboard') time.sleep(3) assert_url = self.page_login(browser).driver.current_url print(url_dashboard, assert_url) assert url_dashboard == assert_url
def test_login(self,browser): rd=Read_config() role=rd.platform_role('tester01') url = rd.platform_url('login') self.platform(browser).driver.get(url) username=role[0] verification=role[1] ele_username=self.platform(browser).ele_username() ele_input(ele_username,username) ele_verification=self.platform(browser).ele_verification() ele_input(ele_verification,verification) ele_login=self.platform(browser).ele_login() ele_login.click() # ele_after_login_assert=self.platform(browser).ele_after_login_assert() # if ele_after_login_assert.text!="暂不绑定?点此跳过": # msg='登陆失败' # print(msg) # if 1: # print(self.platform(browser).driver.title) # ele_after_login_assert.click() url_dashboard=rd.platform_url('dashboard') time.sleep(3) assert_url=self.platform(browser).driver.current_url print(url_dashboard,assert_url) assert url_dashboard==assert_url
def readconifg(): rd = Read_config() return rd
from page.company.companySettlementDetails_page import CompangySettlementDetails from selenium.webdriver import ActionChains from selenium.webdriver.common.keys import Keys from pykeyboard import PyKeyboard from pymouse import PyMouse from utility.utilities import ele_input,is_ele_exist import time,pytest from time import sleep pt_bill_number=None handle=None Data_import_pt_bill=Read_config().read_pt_import_bill() @pytest.fixture(scope='module',params=Data_import_pt_bill) def data_import_pt_bill(request): return request.param pt_bill_number=None pt_bill_handle=None class Test_platform: def platform(self,browser): p=PlatformLogin(browser) return p def test_login(self,browser):
def __init__(self, browser): self.driver = browser self.content = Read_config().read_location_company_settlementDetails()
def __init__(self, browser): self.driver = browser self.content = Read_config().read_location_company_login()
def __init__(self, browser): self.driver = browser self.content = Read_config().read_location_agency_dashboard()
def __init__(self, browser): self.driver = browser self.platform = Read_config().read_location_platform_login()