#!/usr/bin/env python # _*_ coding:utf-8 _*_ import os,sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) from config import setting from selenium.webdriver.support.select import Select from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from public.page_obj.base import Page from time import sleep from public.models.GetYaml import getyaml from public.models.log import Log testData = getyaml(setting.TEST_Element_YAML + '/' + 'setup.yaml') log = Log() class setup(Page): """ 首页---设置页面 """ url = '/' # 定位器,通过元素属性定位元素对象 # 鼠标悬停控件 userProNick_loc = (By.ID, testData.get_elementinfo(0)) # 菜单设置元素 textsetup_loc = (By.XPATH, testData.get_elementinfo(1)) # 清空昵称文本框 nick_null_loc = (By.ID,testData.get_elementinfo(2)) # 昵称文本框元素
import os, sys from config import setting from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from public.page_obj.base import Page from time import sleep from public.models.GetYaml import getyaml sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) testData = getyaml(setting.TEST_Element_YAML + '/' + 'login.yaml') class login(Page): """ 用户登录页面 """ url = '/' dig_login_button_loc = (By.ID, testData.get_elementinfo(0)) def dig_login(self): """ 首页登录 :return: """ self.find_element(*self.dig_login_button_loc).click() sleep(1) # 定位器,通过元素属性定位元素对象 # 手机号输入框 login_phone_loc = (By.ID, testData.get_elementinfo(0)) # 密码输入框 login_password_loc = (By.ID, testData.get_elementinfo(1))