NOW() AND enc_user_id IN (SELECT enc_user_id FROM uc_user_member WHERE final_end_time >NOW() AND level_type_code=001) order by id desc limit 1
\ No newline at end of file
diff --git a/main.py b/main.py
index 1e4bae3d6b11cd70dee21f8f9761b96e7fd26052..1ede8b56cf8bd8b7d6580551abad22bdfaafe0a0 100644
--- a/main.py
+++ b/main.py
@@ -31,7 +31,7 @@ def print_hi(name):
if __name__ == '__main__':
print_hi('PyCharm')
# pytest.main(
- # ['-vs', 'D:/pythonProject/atuobase/test_login/test_login_success.py', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
+ # ['-vs', 'D:/pythonProject/atuobase/operator_login/test_login_success.py', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
# os.path.join(os.sep, 'autotest_sc_report'),
# '--clean-alluredir'])
@@ -39,20 +39,20 @@ if __name__ == '__main__':
report_dir = create_report_dir()
# pytest.main(
- # ['-vs', 'D:/pythonProject/atuobase/test_login/test_login_success.py', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
+ # ['-vs', 'D:/pythonProject/atuobase/operator_login/test_login_success.py', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
# report_dir, '--clean-alluredir'])
# 开始执行用例
# pytest.main(
- # ['-vs', 'D:/pythonProject/atuobase/test_login', 'D:/pythonProject/atuobase/test_buy/test_buy_one_nonseq_commodity.py::TestBuyOneNonseqCommodity::test_buy_one_nonseq_commodity', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
+ # ['-vs', 'D:/pythonProject/atuobase/operator_login', 'D:/pythonProject/atuobase/buy/test_buy_one_nonseq_commodity.py::TestBuyOneNonseqCommodity::test_buy_one_nonseq_commodity', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
# report_dir, '--clean-alluredir'])
# Mail().send()
#pytest.main(
- # ['-vs', '../autotest-airtest-web-sc/test_buy','../autotest-airtest-web-sc/test_login', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
+ # ['-vs', '../autotest-airtest-web-sc/buy','../autotest-airtest-web-sc/operator_login', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
# report_dir, '--clean-alluredir'])
pytest.main(
- ['-vs', '../autotest-airtest-web-sc/test_login', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
+ ['-vs', '../autotest-airtest-web-sc/operator_login', '--reruns', '3', '--reruns-delay', '2', '--alluredir',
report_dir, '--clean-alluredir'])
os.system('allure generate -c results/ -o report/')
#os.system('allure serve %s' % report_dir)
- # 可以在终端执行命令 pytest D:\pythonProject\atuobase\test_login\test_login_success.py
+ # 可以在终端执行命令 pytest D:\pythonProject\atuobase\operator_login\test_login_success.py
diff --git a/page_class/base_page.py b/page_class/base_page.py
index 38acefc4bbe6d7cd070623b26b88a4f254db0414..651e837f45e7af0cdff576ed5c9fa4d414f25bb1 100644
--- a/page_class/base_page.py
+++ b/page_class/base_page.py
@@ -1,11 +1,10 @@
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
-from selenium.webdriver.remote.webdriver import WebElement
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver import ActionChains
from time import sleep
from datetime import datetime
-from common.logger import log
+from common.logger import logger
import os
@@ -31,10 +30,10 @@ class BasePage(object):
def single_click(self, page_element):
self.wait_seconds(1)
page_element.click()
- #action_chains = ActionChains(self.driver)
- #action_chains.move_to_element(page_element)
- #action_chains.click()
- #action_chains.perform()
+ # action_chains = ActionChains(self.driver)
+ # action_chains.move_to_element(page_element)
+ # action_chains.click()
+ # action_chains.perform()
# self.driver.execute_script("arguments[0].click();", page_element)
def single_click_then_wait(self, page_element, seconds):
@@ -127,10 +126,10 @@ class BasePage(object):
'''展示窗口句柄信息,测试用,只下日志'''
def display_window_handle(self):
- log.info('当前窗口的title:%s' % self.driver.title)
- log.info('当前窗口的url:%s' % self.driver.current_url)
- log.info('当前窗口的句柄:%s' % self.driver.current_window_handle)
- log.info('所有句柄:%s' % self.driver.window_handles)
+ logger.info('当前窗口的title:%s' % self.driver.title)
+ logger.info('当前窗口的url:%s' % self.driver.current_url)
+ logger.info('当前窗口的句柄:%s' % self.driver.current_window_handle)
+ logger.info('所有句柄:%s' % self.driver.window_handles)
'''获取当前页面title'''
diff --git a/report/report/report.py b/report/report/report.py
index 4b31c0bd4158df8993a076b896f872fcbbcdab1c..db7d54029db7f8b89e3fa519285d7335a2a3926b 100644
--- a/report/report/report.py
+++ b/report/report/report.py
@@ -492,7 +492,7 @@ def simple_report(filepath, logpath=True, logfile=LOGFILE, output=HTML_FILE):
path, name = script_dir_name(filepath)
if logpath is True:
logpath = os.path.join(path, LOGDIR)
- rpt = LogToHtml(path, logpath, logfile=logfile, script_name=name)
+ rpt = LogToHtml(path, logpath, logfile=logfile, script_name=name, plugins=['airtest_selenium.report'])
rpt.report(HTML_TPL, output_file=output)
diff --git a/report/summary.html b/report/summary.html
index fd809b0b35ab4caae86d5d579b2091e24faa1150..8eb5268616aeb31ffd567822a2f0666f467054b3 100644
--- a/report/summary.html
+++ b/report/summary.html
@@ -54,10 +54,10 @@
- 6 |
- 6 |
- 1分5秒 |
- 100.0% |
+ 1 |
+ 0 |
+ 0分34秒 |
+ 0.0% |
@@ -72,45 +72,10 @@
- case_login_no_input_userid |
- 成功 |
- 10.549 |
- Unknown |
-
-
-
- case_login_no_input_verifycode |
- 成功 |
- 9.908 |
- Unknown |
-
-
-
- case_login_password_error |
- 成功 |
- 9.955 |
- Unknown |
-
-
-
- case_login_success |
- 成功 |
- 9.955 |
- Unknown |
-
-
-
- case_login_userid_error |
- 成功 |
- 10.563 |
- Unknown |
-
-
-
- case_login_verify_code_error |
- 成功 |
- 9.981 |
- Unknown |
+ case_buy_one_nonseq_commodity |
+ 失败 |
+ 34.545 |
+ qinguanglei |
diff --git a/runner.py b/runner.py
index 0d291532e8b1a4d0095dc9a290dd7688d5c85666..83ac454cf6c01ed10e2a7637cd057a33cc7de8eb 100644
--- a/runner.py
+++ b/runner.py
@@ -9,7 +9,7 @@ curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
-
+# python runner.py tag case_login_success debug sit
if __name__ == '__main__':
# 第一个参数 case 执行类型,'all', 'sc', 'tag'
caseType = sys.argv[1]
diff --git a/screen_shot/test_login/1700469774.png b/screen_shot/test_login/1700469774.png
deleted file mode 100644
index 0e79e81e9810cb8da326bfb01f602964b5b1ea99..0000000000000000000000000000000000000000
Binary files a/screen_shot/test_login/1700469774.png and /dev/null differ
diff --git a/screen_shot/test_login/1700469810.png b/screen_shot/test_login/1700469810.png
deleted file mode 100644
index d964eee164357a0271e0396586042152b3205fe7..0000000000000000000000000000000000000000
Binary files a/screen_shot/test_login/1700469810.png and /dev/null differ
diff --git a/screen_shot/test_login/1700469840.png b/screen_shot/test_login/1700469840.png
deleted file mode 100644
index 0d1fbec7865ecad6767669f8a6f29df727346fe7..0000000000000000000000000000000000000000
Binary files a/screen_shot/test_login/1700469840.png and /dev/null differ
diff --git a/screen_shot/test_login/1700469957.png b/screen_shot/test_login/1700469957.png
deleted file mode 100644
index adda9a263ef9271380f331678f1260b80557e792..0000000000000000000000000000000000000000
Binary files a/screen_shot/test_login/1700469957.png and /dev/null differ
diff --git a/test_buy/page_buy.py b/test_buy/page_buy.py
index c2614b4ae1c05e565ee3e643a90c2be9eb3a3130..c9f4d02b3777b3a0954dc30b54be8cbc0afc78ce 100644
--- a/test_buy/page_buy.py
+++ b/test_buy/page_buy.py
@@ -1,6 +1,7 @@
-from test_login.page_login import PageLogin
from selenium.webdriver.remote.webdriver import By
+from actions.actions_login.page_login import PageLogin
+
class PageBuy(PageLogin):
"""基础元素"""
@@ -35,7 +36,7 @@ class PageBuy(PageLogin):
_main_info_locator = (By.ID, 'tab-7667cf55-c391-4f2c-a5ba-c0f6d27b6d3a')
'''仓库信息'''
# 仓库输入内容
- _warehouse_content_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-122")]')
+ _warehouse_content_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-121")]')
# 请求查询仓库元素
_ware_request_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-122")]/../span/span/i')
# _ware_request_locator = (By.XPATH, '//div[text() = "仓库名称"]/../div[@class="el-form-item__content"]/descendant::i[@class="awsui-iconfont" and @style="cursor: pointer;"]')
@@ -75,7 +76,7 @@ class PageBuy(PageLogin):
'''协议信息'''
# 协议输入内容元素
- _protocol_content_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-124")]')
+ _protocol_content_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-123")]')
# 协议请求元素
_protocol_request_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-109")]/../span/span/i')
@@ -91,7 +92,7 @@ class PageBuy(PageLogin):
'''业务员信息'''
# 业务员输入内容元素
- _businessman_content_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-127")]')
+ _businessman_content_locator = (By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-126")]')
# 业务员请求元素
_businessman_request_locator = (
By.XPATH, '//input[starts-with(@id,"el-id-") and contains(@id,"-110")]/../span/span/i')
@@ -112,7 +113,7 @@ class PageBuy(PageLogin):
_merchandise_locator = (By.XPATH, '//span[text()="添加商品"]')
# 商品dialog
_merchandise_dialog_locator = (
- By.XPATH, '//div[starts-with(@id,"el-id-") and contains(@id,"-136") and @class="el-dialog__body"]')
+ By.XPATH, '//div[starts-with(@id,"el-id-") and contains(@id,"-135") and @class="el-dialog__body"]')
# 商品输入元素
_merchandise_input_locator = (By.XPATH, '//input[@placeholder="模糊检索:商品编码,商品名称,规格型号,厂家物料编码"]')
# 商品搜索元素
@@ -387,8 +388,10 @@ class PageBuy(PageLogin):
def get_businessman_dialog(self):
return self.get_element_wait_presence(self._businessman_dialog_locator)
+
'''商品信息hold'''
'''获取商品全选复选框'''
+
def get_merchandise_all_select(self):
return self.get_element_wait_presence(self._merchandise_all_select_locator)
@@ -428,5 +431,6 @@ class PageBuy(PageLogin):
return self.get_element_wait_presence(self._detail_table)
'''订单提交'''
+
def get_submit_element(self):
return self.get_element_wait_presence(self._submit_locator)
diff --git a/test_buy/steps_buy.py b/test_buy/steps_buy.py
index 5f65d25e60da4536fe2e078e249b9a34fa2bb7df..3940bb0d115de6741c21b4bedade0a4487414cd3 100644
--- a/test_buy/steps_buy.py
+++ b/test_buy/steps_buy.py
@@ -10,7 +10,7 @@ from common.read_yaml import get_filed_from_yaml
from common.verifycode import VerifyCode
from test_buy.page_buy import PageBuy
-module = 'test_buy'
+module = 'buy'
class StepsBuy(object):
diff --git a/test_login/__init__.py b/test_login/__init__.py
deleted file mode 100644
index 33481c8bf7c3d64f77a21769a746e910eaaced66..0000000000000000000000000000000000000000
--- a/test_login/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/16 11:00
diff --git a/test_login/test_login_no_input_userid.py b/test_login/test_login_no_input_userid.py
deleted file mode 100644
index 1895c7fb410a29173887d64db97c404d9c10c15a..0000000000000000000000000000000000000000
--- a/test_login/test_login_no_input_userid.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/17 15:54
-import allure
-import pytest
-from test_login.steps_login import StepsLogin
-
-
-@allure.feature('登录模块')
-class TestLoginNoInputUserid(object):
- @pytest.fixture(scope='function', autouse=True)
- def housework(self, driver_fixture):
- # 驱动器从fixture传来
- self.driver = driver_fixture
-
- @allure.story('不输入用户名登录失败案例-点击登录')
- def test_login_no_input_userid(self):
- # 载入步骤集合
- steps_login = StepsLogin(self.driver)
- # 打开浏览器
- steps_login.open_browser()
- # 输入账号密码,只输入密码
- steps_login.enter_account_password(2)
- # 输入验证码,输入正确的验证码
- steps_login.enter_verify_code(0)
- # 点击登录
- steps_login.click_login_button()
- # 判断结果
- steps_login.judge_result_error(2)
diff --git a/test_login/test_login_no_input_verifycode.py b/test_login/test_login_no_input_verifycode.py
deleted file mode 100644
index de2519765a9cac868fe468216c2fd36b0c078b26..0000000000000000000000000000000000000000
--- a/test_login/test_login_no_input_verifycode.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/20 9:56
-import allure
-import pytest
-from test_login.steps_login import StepsLogin
-
-
-@allure.feature('登录模块')
-class TestLoginNoInputVerifycode(object):
- @pytest.fixture(scope='function', autouse=True)
- def housework(self, driver_fixture):
- # 驱动器从fixture传来
- self.driver = driver_fixture
-
- @allure.story('不输入验证码案例-点击登录')
- def test_login_no_input_verifycode(self):
- # 载入步骤集合
- steps_login = StepsLogin(self.driver)
- # 打开浏览器
- steps_login.open_browser()
- # 输入账号密码,都输入正确的
- steps_login.enter_account_password(0)
- # 输入验证码,不输入验证码
- steps_login.enter_verify_code(2)
- # 点击登录
- steps_login.click_login_button()
- # 判断结果
- steps_login.judge_result_error(3)
diff --git a/test_login/test_login_password_error.py b/test_login/test_login_password_error.py
deleted file mode 100644
index a93228b22174a8df26fb4b48efa5ea9177e51a8c..0000000000000000000000000000000000000000
--- a/test_login/test_login_password_error.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/20 9:43
-import allure
-import pytest
-from test_login.page_login import PageLogin
-from test_login.steps_login import StepsLogin
-
-
-@allure.feature('登录模块')
-class TestLoginPasswordError(object):
- @pytest.fixture(scope='function', autouse=True)
- def housework(self, driver_fixture):
- # 驱动器从fixture传来
- self.driver = driver_fixture
- # 执行案例前统一获取页面元素操作方法
- self.page_login = PageLogin(self.driver)
-
- @allure.story('输入错误密码登录失败案例-点击登录')
- def test_login_password_error(self):
- # 载入步骤集合
- steps_login = StepsLogin(self.driver)
- # 打开浏览器
- steps_login.open_browser()
- # 输入账号密码,密码输入错误
- steps_login.enter_account_password(4)
- # 输入验证码,输入正确的验证码
- steps_login.enter_verify_code(0)
- # 点击登录
- steps_login.click_login_button()
- # 判断结果
- steps_login.judge_result_error(1)
-
-
-
-
diff --git a/test_login/test_login_success.py b/test_login/test_login_success.py
deleted file mode 100644
index edca518a6b353a241014919dc462424403f57686..0000000000000000000000000000000000000000
--- a/test_login/test_login_success.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/16 11:18
-import pytest
-import allure
-from test_login.steps_login import StepsLogin
-
-module = 'test_login'
-
-
-@allure.feature('登录模块')
-class TestLoginSuccess(object):
- @pytest.fixture(scope='function', autouse=True)
- def housework(self, driver_fixture):
- # 驱动器从fixture传来
- self.driver = driver_fixture
-
- @allure.story('登录成功案例-点击登录')
- def test_login_success_click(self):
- # 载入步骤集合
- steps_login = StepsLogin(self.driver)
- # 打开浏览器
- steps_login.open_browser()
- # 输入账号密码,账号与密码都输入
- steps_login.enter_account_password(0)
- # 输入验证码,正确的验证码
- steps_login.enter_verify_code(0)
- # 点击登录
- steps_login.click_login_button()
- # 判断结果
- steps_login.judge_result()
diff --git a/test_login/test_login_userid_error.py b/test_login/test_login_userid_error.py
deleted file mode 100644
index 0f2f7a0b45af3537c99162cc5da1af09095d2685..0000000000000000000000000000000000000000
--- a/test_login/test_login_userid_error.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/20 9:23
-import allure
-import pytest
-from test_login.steps_login import StepsLogin
-
-
-@allure.feature('登录模块')
-class TestLoginUseridError(object):
- @pytest.fixture(scope='function', autouse=True)
- def housework(self, driver_fixture):
- # 驱动器从fixture传来
- self.driver = driver_fixture
-
- @allure.story('登录用户名错误案例-点击登录')
- def test_login_userid_error(self):
- # 载入步骤集合
- steps_login = StepsLogin(self.driver)
- # 打开浏览器
- steps_login.open_browser()
- # 输入账号密码,用户名输入错误
- steps_login.enter_account_password(3)
- # 输入验证码,输入正确的验证码
- steps_login.enter_verify_code(0)
- # 点击登录
- steps_login.click_login_button()
- # 判断结果
- steps_login.judge_result_error(1)
diff --git a/test_login/test_login_verify_code_error.py b/test_login/test_login_verify_code_error.py
deleted file mode 100644
index 13b37d6d3ca4e5824e3adc8b6173ff28f3b599f2..0000000000000000000000000000000000000000
--- a/test_login/test_login_verify_code_error.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# author:qinguanglei
-# ddate:2023/11/16 16:40
-import allure
-import pytest
-from test_login.steps_login import StepsLogin
-
-module = 'test_login'
-
-
-@allure.feature('登录模块')
-class TestLoginVerifyCodeError(object):
- @pytest.fixture(scope='function', autouse=True)
- def housework(self, driver_fixture):
- # 驱动器从fixture传来
- self.driver = driver_fixture
-
- @allure.story('登录验证码错误案例-点击登录')
- def test_login_verify_code_error(self):
- # 载入步骤集合
- steps_login = StepsLogin(self.driver)
- # 打开浏览器
- steps_login.open_browser()
- # 输入账号密码,都输入正确的
- steps_login.enter_account_password(0)
- # 输入验证码,错误的验证码
- steps_login.enter_verify_code(1)
- # 点击登录
- steps_login.click_login_button()
- # 判断结果
- steps_login.judge_result_error(0)
diff --git a/test_sell/page_sell.py b/test_sell/page_sell.py
index 0a6fe6cccaeed5070c73691c81f15e404b0e3506..8ef6f49a0cfcc69db0771a67afbd284e9e7f051d 100644
--- a/test_sell/page_sell.py
+++ b/test_sell/page_sell.py
@@ -1,6 +1,6 @@
# author:qinguanglei
# ddate:2023/11/22 9:17
-from test_login.page_login import PageLogin
+from operator.operator_login import PageLogin
from selenium.webdriver.remote.webdriver import By
diff --git a/test_sell/steps_sell.py b/test_sell/steps_sell.py
index 1e9b6ec6d20c0ab7335c5b6e07be4fa3fa566413..d75550f742d61f30c947a03a30b2bca03661b7f2 100644
--- a/test_sell/steps_sell.py
+++ b/test_sell/steps_sell.py
@@ -10,7 +10,7 @@ from common.read_yaml import get_filed_from_yaml
from common.verifycode import VerifyCode
from test_sell.page_sell import PageSell
-module = 'test_sell'
+module = 'sell'
class StepsSell(object):