Esempio n. 1
0
 def inputBrand(self, Brand=None):
     await_ele.getAwaitEle('id', "brand", self.driver,
                           second=20)  # 判断元素是否可以点击
     e = self.driver.find_element_by_id("brand")
     if Brand is None or Brand == "":  # 如果传入了值,则进行操作,没有传值则返回元素
         return e
     elementaction.inputContent(self, e, Brand)
Esempio n. 2
0
 def inputCategory(self, Category=None):
     await_ele.getAwaitEle('id', "category", self.driver,
                           second=20)  # 判断元素是否可以点击
     e = self.driver.find_element_by_id("category")
     if Category is None or Category == "":  # 如果传入了值,则进行操作,没有传值则返回元素
         return e
     elementaction.inputContent(self, e, Category)
Esempio n. 3
0
 def inputGoods(self, Goods=None):
     await_ele.getAwaitEle('id', "goods", self.driver,
                           second=20)  # 判断元素是否可以点击
     e = self.driver.find_element_by_id("goods")
     if Goods is None or Goods == "":  # 如果传入了值,则进行操作,没有传值则返回元素
         return e
     elementaction.inputContent(self, e, Goods)
Esempio n. 4
0
 def inputShop(self, Shop=None):
     await_ele.getAwaitEle('id', "shop", self.driver,
                           second=20)  # 判断元素是否可以点击
     e = self.driver.find_element_by_id("shop")
     if Shop is None or Shop == "":  # 如果传入了值,则进行操作,没有传值则返回元素
         return e
     elementaction.inputContent(self, e, Shop)
Esempio n. 5
0
 def optionShopStatus(self, ShopStatus=None):
     await_ele.getAwaitEle('id', "shopStatus", self.driver,
                           second=20)  # 判断元素是否可以点击
     ShopStatuss = self.driver.find_elements_by_xpath(
         r'//*[@id="shopStatus"]/option')
     if ShopStatus is not None or ShopStatus == "":  # 如果没有传入仓库或传的是'""'则直接返回仓库名组
         return ShopStatuss
     elementaction.dropDownBox_text(self, ShopStatuss, ShopStatus)
Esempio n. 6
0
 def optionCity(self, City=None):
     await_ele.getAwaitEle('id', "cityList", self.driver,
                           second=20)  # 判断元素是否可以点击
     Citys = self.driver.find_elements_by_xpath(
         r'//*[@id="cityList"]/option')
     if City is not None or City == "":  # 如果没有传入仓库或传的是'""'则直接返回仓库名组
         return Citys
     elementaction.dropDownBox_text(self, Citys, City)
Esempio n. 7
0
 def clickSave(self, action=None):
     if action is not None:  # 如果没有传入值,则进行操作,有传值则返回元素
         return self.driver.find_element_by_xpath(
             '//*[@id="saleOrderDetail"]/div/div/div[3]/button[1]')
     await_ele.getAwaitEle(
         'xpath',
         '//*[@id="saleOrderDetail"]/div/div/div[3]/button[1]',
         self.driver,
         second=20)  # 判断元素是否可以点击
Esempio n. 8
0
 def clickSee(self, action=None):
     if action is not None:  # 如果没有传入值,则进行操作,有传值则返回元素
         return self.driver.find_element_by_id("search")
     await_ele.getAwaitEle('id', "search", self.driver,
                           second=20)  # 判断元素是否可以点击
Esempio n. 9
0
 def joinShopStock(self, action=None):
     if action is not None:  # 如果没有传入值,则进行操作,有传值则返回元素
         return self.driver.find_element_by_link_text("货柜库存")
     await_ele.getAwaitEle('link_text', "货柜库存", self.driver,
                           second=20)  # 判断元素是否可以点击
Esempio n. 10
0
 def __init__(self, driver):
     self.driver = driver
     joinmodule.joinModule(self,
                           "list4")  # 进入“库存管理”模块:库存管理的‘for’属性值为“list4”
     await_ele.getAwaitEle('link_text', "货柜库存", self.driver,
                           second=20)  # 判断元素是否可以点击
Esempio n. 11
0
 def optionClickEdit(self, WareHouse):  # 传入仓库编码
     if WareHouse is None or WareHouse == '':  # 如果没有传入值,则进行操作,有传值则返回元素
         raise NameError('必须传入仓库“编码”参数')
     s = '//*[@id="renderListSm0"]/tr[@data-code="%s"]/td[5]/button' % WareHouse
     # 选择对应仓库下的编辑(隐式等待,默认间隔0.5s,可不传值)
     await_ele.getAwaitEle('xpath', s, self.driver, second=20)  # 判断元素是否可以点击
Esempio n. 12
0
 def clickPlus(self, action=None):
     s = '//*[@id="renderList"]/tr[1]/td[1]/label'
     if action is not None:  # 如果没有传入值,则进行操作,有传值则返回元素
         return self.driver.find_element_by_xpath(s)
     await_ele.getAwaitEle('xpath', s, self.driver, second=20)  # 判断元素是否可以点击