def weekendtype(self): num = mydef.rad_num(1, 5) self.click("xpath=>//*[@id='weekendtype']/option[" + num + "]") if num != 1: weekendprice = mydef.rad_num(60, 200) self.clear("id=>weekendprice") self.type("id=>weekendprice", weekendprice)
def cook(self): num = mydef.rad_num(1, 3) self.click("xpath=>//*[@id='cook']/option[" + num + "]") if num == 1: num1 = mydef.rad_num(1, 3) self.click("xpath=>//*[@id='cookyesorno']/option[" + num1 + "]") if num1 == 2: cook_price = mydef.rad_num(1, 100) self.type("id=>cook_price", cook_price)
def addbed(self): num = mydef.rad_num(1, 3) self.click("xpath=>//*[@id='addbed']/option[" + num + "]") if num == 1: num1 = mydef.rad_num(1, 3) self.click("xpath=>//*[@id='addbedyesorno']/option[" + num1 + "]") if num1 == 2: addbed_price = mydef.rad_num(1, 100) self.type("id=>addbed_price", addbed_price)
def LanguePic(self): pic = mydef.rad_num(10, 100) self.clear( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[1]/input[1]" ) self.type( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[1]/input[1]", pic)
def LangueSoftOutfit(self, softoutfit): softoutfit = mydef.rad_num(10, 20) self.clear( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[3]/input[1]" ) self.type( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[3]/input[1]", softoutfit)
def LangueBond(self, Bond): Bond = mydef.rad_num(10, 99) self.clear( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[2]/input[1]" ) self.type( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[2]/input[1]", Bond)
def test_roomsearch(self): '''按房间名搜索''' login_page.LoginPage(self.driver).login() sleep(2) landlord_nav_page.LandlordNavPage(self.driver).Iamlandlord() sleep(2) landlord_nav_page.LandlordNavPage(self.driver).close_weiChat() sleep(2) landlord_nav_page.LandlordNavPage(self.driver).settlements() po = landlord_roomsearch_page.LandlordRoomsearchPage(self.driver) num = mydef.rad_num(2, 3) po.lodgeunitid(num) sleep(1) po.search()
def test_room_offline(self): '''房源下线——下线原因:非我想休息,暂停出租''' # login_page.LoginPage(self.driver).login() # sleep(2) landlord_nav_page.LandlordNavPage(self.driver).Iamlandlord() sleep(2) # landlord_nav_page.LandlordNavPage(self.driver).close_weiChat() # sleep(2) landlord_nav_page.LandlordNavPage(self.driver).roommanager() po = landlord_offline_page.LandlordOfflinePage(self.driver) po.room_offline() num = mydef.rad_num(2,9) po.offline_reason(num) sleep(2) po.offlineReasonBtn() function.insert_img(self.driver,"offlineSuccess.png") print(po.offlineSuccess_text()) sleep(2) po.okOfflineSuccessBtn()
def publictoiletnum(self): self.click("xpath=>//*[@id='publictoiletnum']/option[" + mydef.rad_num(1, 12) + "]")
def alert_details_refuse_reason(self): self.click("xpath=>html/body/div[27]/div[2]/div[2]/form/label["+mydef.rad_num(1,9)+"]")
def roomnum(self): self.click("xpath=>//*[@id='roomnum']/option[" + mydef.rad_num(1, 11) + "]")
def parlor(self): self.click("xpath=>//*[@id='parlor']/option[" + mydef.rad_num(1, 12) + "]")
def bunk_bed(self): self.click("xpath=>//*[@id='双层床']/option[" + mydef.rad_num(1, 12) + "]")
def Budget(self): n = mydef.rad_num(100, 999) self.type( "xpath=>//*[@id='right-box']/div/div[2]/form/div/div[8]/div/div/form/div[7]/div/div/div/div/input", n)
def OwnerRoomNum(self): num = mydef.rad_num(1,999) self.type("xpath=>//*[@id='house_num']",num)
def SoftDeposit(self): deposit = mydef.rad_num(1, 1000) self.type( "xpath=>//*[@id='pane-softagreemt']/div/div[1]/form/div[2]/div/div/input", deposit)
def LangueCleaningFee(self): cleaningfee = mydef.rad_num(1, 99) self.type( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[7]/input", cleaningfee)
def cookhouse(self): self.click("xpath=>//*[@id='cookhouse']/option[" + mydef.rad_num(1, 12) + "]")
def privatetoiletnum(self): self.click("xpath=>//*[@id='privatetoiletnum']/option[" + mydef.rad_num(2, 12) + "]")
def balcony(self): self.click("xpath=>//*[@id='balcony']/option[" + mydef.rad_num(1, 12) + "]")
def LangueDesignFee(self, designfee): designfee = mydef.rad_num(1, 2000) self.type( "xpath=>//*[@id='pane-bsJoinagreemt']/div/div[4]/div[4]/div/div[5]/input[1]", designfee)
def guestnum(self): self.click("xpath=>//*[@id='guestnum']/option[" + mydef.rad_num(2, 11) + "]")
def SoftPic(self): pic = mydef.rad_num(1, 1000) self.type( "xpath=>//*[@id='pane-softagreemt']/div/div[3]/form/div[2]/div/div/input", pic)
def big_bed(self): self.click("xpath=>//*[@id='双人床(大,宽2m左右)']/option[" + mydef.rad_num(1, 12) + "]")
def UpgradeCost(self): cost = mydef.rad_num(1, 10) self.type( "xpath=>//*[@id='pane-softagreemt']/div/div[7]/form/div[3]/div[1]/div/div/input", cost)
def middle_bed(self): self.click("xpath=>//*[@id='双人床(中,宽1.8m左右)']/option[" + mydef.rad_num(1, 12) + "]")
def OwnerResidence(self): i = mydef.rad_num(1,6) self.click("xpath=>//*[@id='indexPage']/div[6]/div[2]/div[1]/div[5]/div/ul/li["+ i +"]/span")
def small_bed(self): self.click("xpath=>//*[@id='双人床(小,宽1.5m左右)']/option[" + mydef.rad_num(1, 12) + "]")
def people(self): people = mydef.rad_num(1, 10) self.type( "xpath=>html/body/form/div[2]/div[1]/div[1]/div/div/dl[3]/dd/input[2]", people)
def single_bed(self): self.click("xpath=>//*[@id='单人床']/option[" + mydef.rad_num(1, 12) + "]")