if __name__ == '__main__': log = GetLog(__name__) log.debug('This is a debug message') log.info('This is an info message') log.warning('This is a warning message') log.error('This is an error message') log.critical('This is a critical message')
@allure.story('测试直接点击其他手机号码登录') deftest_login_01(self, android_driver): login_page = LoginPage(android_driver) with allure.step('点击其他手机号码登录按钮'): login_page.local_phone_btn() with allure.step('显示元素“请先阅读并同意协议”'): assert login_page.show_read_and_agreed_btn() isTrue
@allure.story('点击同意协议复选框2次') deftest_login_02(self, android_driver): login_page = LoginPage(android_driver) with allure.step('点击同意协议复选框2次,让“请先阅读并同意协议”消失'): login_page.local_phone_btn() login_page.local_phone_btn()
@allure.story('测试直接点击其他手机号码登录') deftest_login_03(self, android_driver): login_page = LoginPage(android_driver) with allure.step('点击其他手机号码登录按钮'): login_page.other_phone_login_btn() with allure.step('显示元素“请先阅读并同意协议”'): assert login_page.show_read_and_agreed_btn() isTrue
@allure.story('测试其他电话登录') deftest_login_04(self, android_driver): login_page = LoginPage(android_driver) with allure.step('点击同意协议复选框'): login_page.agree_protocol() with allure.step('点击其他手机号码登录按钮'): login_page.other_phone_login_btn() with allure.step('输入电话号码'): login_page.input_phone_number('17312341234') with allure.step('点击获取短信验证码'): login_page.get_phone_verification() with allure.step('输入验证码'): login_page.input_phone_verification('1234')
from appium import webdriver from appium.options.android import UiAutomator2Options from appium.options.ios import XCUITestOptions from appium.webdriver.appium_service import AppiumService
@pytest.fixture defios_driver(): """return ios_driver to the function using it, quit driver afterwards.""" # prefer this fixture if there is no need to customize driver options in tests driver = create_ios_driver() yield driver driver.quit()
@pytest.fixture defandroid_driver(): """return android_driver to the function using it, quit driver afterwards.""" # prefer this fixture if there is no need to customize driver options in tests driver = create_android_driver() yield driver driver.quit()