• import pytest
    from appium import webdriver
    from selenium.webdriver.common.by import By
    import time
    from appium.webdriver import WebElement


    class TestXueQiu:

    def setup_method(self):
    print("**************************8")
    server = 'http://localhost:4723/wd/hub'
    # app启动参数
    desired_caps = {}
    desired_caps["platformName"] = "Android"
    desired_caps["deviceName"] = "192.168.56.103:5555"
    desired_caps["appPackage"] = "com.xueqiu.android"
    desired_caps["appActivity"] = ".view.WelcomeActivityAlias"
    desired_caps["autoGrantPermissions"] = True
    # 驱动
    self.driver = webdriver.Remote(server, desired_caps)
    time.sleep(15)
    self.driver.implicitly_wait(15)

    def teardown_method(self):
    print("*********$###################")
    # self.driver.quit()

    def into_login_page(self,phone,password):
    time.sleep(1)
    p_m1 = "//*[contains(@resource-id,'image_cancel')]"
    self.driver.find_element(By.XPATH, p_m1).click()
    p_m = "//*[contains(@resource-id, 'user_profile_container')]"
    self.driver.find_element(By.XPATH, p_m).click()
    ele3 = "//*[contains(@resource-id,'tv_login')]"
    self.driver.find_element(By.XPATH, ele3).click()
    ele4 = "//*[contains(@resource-id,'tv_login_by_phone_or_others')]"
    self.driver.find_element(By.XPATH, ele4).click()
    ele5 = "//*[contains(@resource-id,'tv_login_with_account')]"
    self.driver.find_element(By.XPATH, ele5).click()
    ele6 = "//*[contains(@resource-id,'login_account')]"
    self.driver.find_element_by_xpath(ele6).clear()
    self.driver.find_element_by_xpath(ele6).send_keys(phone)
    ele7 = "//*[contains(@resource-id,'login_password')]"
    self.driver.find_element(By.XPATH,ele7).send_keys(password)
    ele8 = "//*[contains(@resource-id,'button_next')]"
    self.driver.find_element(By.XPATH,ele8).click()
    ele9 = "//*[@text='手机号码填写错误']"
    alert = self.driver.find_element_by_xpath(ele9).text

    return alert

    def test_wrong_phone(self):
    phone = "aadasdsa"
    password = "adadsadas"
    alert = self.into_login_page(phone,password)
    ##input account and password
    assert alert == "手机号码填写错误"

    def test_wrong_password(self):
    phone = "15118156275"
    password = "adadsadas"
    alert = self.into_login_page(phone, password)
    ##input account and password
    assert alert in "用户名或密码错误"
    @pytest.mark.parametrize("product",["alibaba","xiaomi","google"])
    def test_search(self,product):
    time.sleep(3)
    p_m1 = "//*[contains(@resource-id,'image_cancel')]"
    self.driver.find_element(By.XPATH, p_m1).click()
    time.sleep(3)
    ele2 = "//*[contains(@resource-id, 'home_search')]"
    self.driver.find_element(By.XPATH, ele2).click()
    time.sleep(3)
    ele3 = "//*[contains(@resource-id, 'search_input_text')]"
    self.driver.find_element(By.XPATH, ele3).send_keys(product)
    time.sleep(5)



  • 满了哦

  • 持续集成、质量监控

  • 以后应该会有,时间还没发确定。

  • 已修改,感谢指正

  • 你真穿我就可以让你进了😂

  • 之后会有男生可以参加的workshop,沙龙的~

  • 已经发了

  • 稍等,晚上发布链接,只限女生哈~

  • 稍等,晚上发布链接,只限女生哈