Commit 22b60c14 authored by 齐 振鋆's avatar 齐 振鋆
Browse files

个人代码迁移

parent c6ba7a8b
Pipeline #10140 failed with stages
in 3 seconds
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
.idea
.vscode
# Cython debug symbols
cython_debug/
.pytest_cache
geckodriver.log
file/screenshot/
extract.yaml
Temp/
Reports/
allure-results/
allure-report/
This diff is collapsed.
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/1/9
# 描述:
# autotest-airtest-web-sc-airtest # 分布式执行
## 启动selenium server
>java -jar selenium-server-standalone-3.141.0.jar -role hub -host 0.0.0.0
## 启动selenium client
>cd c:\
>java -Dwebdriver.chrome.driver="C:\chromedriver.exe" -jar selenium-server-standalone-3.141.0.jar -role node -port 5555 -hub http://10.17.73.97:4444/grid/register/
## Getting started #
\ No newline at end of file
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin http://10.17.65.20/gitlab/test/autotest-airtest-web-sc-airtest.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](http://10.17.65.20/gitlab/test/autotest-airtest-web-sc-airtest/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2022/8/11
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/3/27
# 描述:
import argparse
from pytest_run import py_run
from unit.public.DataDic import DataDic
dd = DataDic()
def get_command_args():
"""命令行参数解析"""
parser = argparse.ArgumentParser(description=u'可选择参数:')
parser.add_argument("--client", default='localhost', help="client:客户端IP")
parser.add_argument("--project", default='GuKeYiTiHua', help="project:项目")
# url: 'http://10.17.65.216:8088/portal/' 'http://10.17.65.200:8088/portal/'
parser.add_argument("--url", default='http://10.17.65.216:8088/portal/', help="url: 地址")
# ;手术跟台: surgery | 采购管理:purchase | 调拨管理: Transfer | 库存管理:inventory | 调试:debug
parser.add_argument("--module", default='purchase', help="module:模块")
parser.add_argument("--tab", default='purchase', help="tab:标记")
parser.add_argument("--order", help="order: 单据编码")
parser.add_argument("--co", help="co: 公司")
parser.add_argument("--wh", help="wh: 仓库")
parser.add_argument("--good", help="good: 商品")
parser.add_argument("--num", help="num: 数量")
args = parser.parse_args()
dd.set_value('client', args.client)
dd.set_value('project', args.project)
dd.set_value('url', args.url)
dd.set_value('module', args.module)
dd.set_value('tab', args.tab)
dd.set_value('order', args.order)
dd.set_value('company', args.co)
dd.set_value('warehouse', args.wh)
dd.set_value('custGood', args.good)
dd.set_value('custNum', args.num)
py_run()
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/3/27
# 描述:
from flet import ResponsiveRow, Column, ElevatedButton, Text, TextField, Dropdown, icons, FilePickerResultEvent, \
FilePicker, alignment, Container, dropdown, KeyboardType
from flet import Ref
from pytest_run import py_run
from unit.public.DataDic import DataDic
dd = DataDic()
def get_ui_args(page):
page.title = "国药自动化测试启动器"
client_ip = Ref[TextField]()
test_url = Ref[TextField]()
project_name = Ref[Dropdown]()
module_name = Ref[Dropdown]()
tab_name = Ref[Dropdown]()
test_file = Ref[TextField]()
greetings = Ref[Column]()
def run(e):
greetings.current.controls.append(
Text(f"【测试环境】:{test_url.current.value}")
)
greetings.current.controls.append(
Text(f"【项目】:{project_name.current.value}-【模块】:{module_name.current.value}-【标签】:{tab_name.current.value}")
)
page.update()
dd.set_value('client', client_ip.current.value)
p_name = project_name.current.value
p_code = 'GuKeYiTiHua' if p_name == '骨科一体化' else 'TestProject'
dd.set_value('project', p_code)
dd.set_value('url', test_url.current.value)
m_name = module_name.current.value
m_code = 'purchase' if m_name == '采购管理' \
else 'surgery' if m_name == '手术跟台' \
else 'transfer' if m_name == '调拨管理' \
else None
dd.set_value('module', m_code)
t_name = tab_name.current.value
t_code = 'all' if t_name == '全量' else 'smoking' if t_name == '冒烟' else 'debug' if t_name == '调试' else None
dd.set_value('tab', t_code)
py_run()
def stop(e):
dd.get_value('driver').close()
dd.get_value('driver').quit()
def module_update(e):
m_options = []
module_list = ['采购管理', '手术跟台', '调拨管理'] if project_name.current.value == '骨科一体化' \
else ['模块1', '模块2', '模块3'] if project_name.current.value == '测试项目' \
else []
for m_item in module_list:
m_options.append(dropdown.Option(m_item))
module.options = m_options
page.update()
def pick_files_result(e: FilePickerResultEvent):
selected_files.value = (
e.files[0].path if e.files else "Cancelled!"
)
selected_files.update()
test_data_file = test_file.current.value
dd.set_value('test_data_file', test_data_file)
client = TextField(ref=client_ip, label="客户端地址", icon=icons.BOY, autofocus=True, value='localhost',
read_only=True, )
url = TextField(ref=test_url, label="测试环境", icon=icons.HTTP, keyboard_type=KeyboardType.URL, value='http://10.17.65.216:8088/portal/r/w')
project_options = []
for item in ['骨科一体化', '测试项目']:
project_options.append(dropdown.Option(item))
project = Dropdown(ref=project_name, label="项目名称", icon=icons.HOUSE, options=project_options,
on_change=module_update)
module_options = []
module = Dropdown(ref=module_name, label="模块名称", icon=icons.MOOD, options=module_options)
tab_options = []
for item in ['全量', '冒烟', '调试']:
tab_options.append(dropdown.Option(item))
tab = Dropdown(ref=tab_name, label="标签名称", icon=icons.TAB, options=tab_options)
file = ElevatedButton(
"测试数据文件",
on_click=lambda _: pick_files_dialog.pick_files(
allow_multiple=False,
allowed_extensions=["yaml"]
),
)
pick_files_dialog = FilePicker(on_result=pick_files_result)
selected_files = TextField(ref=test_file, label="测试数据", icon=icons.DATASET, read_only=True, )
page.overlay.append(pick_files_dialog)
page.add(
Container(client, col={"sm": 6, "md": 4, "xl": 2}),
Container(url, col={"sm": 6, "md": 4, "xl": 2}),
Container(project, col={"sm": 6, "md": 4, "xl": 2}),
Container(module, col={"sm": 6, "md": 4, "xl": 2}),
Container(tab, col={"sm": 6, "md": 4, "xl": 2}),
ResponsiveRow([
Container(selected_files, col={"sm": 10}),
Container(file, col={"sm": 2}),
]),
ResponsiveRow([
Container(ElevatedButton("运行", on_click=run), col={"sm": 1}, alignment=alignment.center),
Container(ElevatedButton("停止", on_click=stop), col={"sm": 1}, alignment=alignment.center),
]),
Container(Column(ref=greetings), )
)
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/2/22
# 描述:
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/2/22
# 描述:
PROJECTNAME = '骨科一体化项目'
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2022/9/27
import logging
import pytest
from page.GuKeYiTiHua.Public.loginPage import LoginPage
from unit.public.DataDic import DataDic
log = logging.getLogger(__name__)
dd = DataDic()
@pytest.fixture(scope="session", autouse=True)
def login():
dd.set_value('project_name', '骨科一体化项目')
login = LoginPage()
login.login()
yield
dd.get_value('db').final()
dd.get_value('driver').quit()
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/3/14
# 描述:
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/3/14
# 描述:
import os
from datetime import datetime
import pytest
import allure
import logging
from ddt import ddt, file_data
from cases.UI.GuKeYiTiHua import PROJECTNAME
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_accept import WarehouseVerify
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_take import WarehouseTake
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_up import WarehouseUp
from component.GuKeYiTiHua.StorageManage.StorageOut.storage_out_integration import StorageOut
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_check import WarehouseCheck
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_pick import WarehousePick
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.apolegamy_back import ApolegamyBack
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.apolegamy_out import ApolegamyOut
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.orthopedic_take import OrthopedicTake
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.surgery_back import SurgeryBack
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.apolegamy_borrow import ApolegamyBorrow
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.apolegamy_take import ApolegamyTake
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.orthopedic_lend import OrthopedicLend
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.out_ledger import OutLedger
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_distribute import SurgeryDistribute
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_require import SurgeryRequire
from page.GuKeYiTiHua.DBQuery.db_query import DBQuery
from page.GuKeYiTiHua.Public.common import CommonElement
from unit.public.DataDic import DataDic
log = logging.getLogger(__name__)
@pytest.mark.incremental
@ddt
@allure.epic(PROJECTNAME)
@allure.feature('Debug模块')
class TestDebug(object):
dd = DataDic()
def setup_class(self):
self.dbq = DBQuery()
self.common = CommonElement()
self.sr = SurgeryRequire()
self.sd = SurgeryDistribute()
self.ol = OrthopedicLend()
self.wp = WarehousePick()
self.so = StorageOut()
self.ole = OutLedger()
self.ab = ApolegamyBorrow()
self.at = ApolegamyTake()
self.sb = SurgeryBack()
self.ot = OrthopedicTake()
self.wc = WarehouseCheck()
self.abk = ApolegamyBack()
self.aot = ApolegamyOut()
self.wt = WarehouseTake()
self.wv = WarehouseVerify()
self.wu = WarehouseUp()
@allure.description('测试时间:{}'.format(datetime.now()))
@allure.story('调试专用')
@allure.severity(allure.severity_level.BLOCKER)
@pytest.mark.run(order=10)
@pytest.mark.debug
@file_data('{}/data/purchaseTestData.yaml'.format(os.getcwd()))
def test_debug1(self, **kwargs):
self.dd.set_value('test_data_info', kwargs)
order_code = 'OP230529000012'
# log.info(kwargs)
# self.wt.take_menu_open()
# self.wt.take_pool_take(order_code=order_code)
# self.wt.take_confirm(order_code=order_code)
self.wv.open_verify_menu()
self.wv.verify_edit_and_confirm(order_code=order_code)
# self.wu.open_up_menu()
# self.wu.up_confirm(order_code=order_code)
dbinfo:
'DB_HOST': '10.17.65.215'
'DB_PORT': 3306
'DB_USER': 'aws'
'DB_PASSWD': 'admins'
'DB_NAME': 'aws'
userinfo: # 登录用户信息
username: 'qizhenjun'
password: 'Gyxc1234'
verificationCode: 0 # 验证码识别:1开启|0关闭
minNum: 2
\ No newline at end of file
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/2/22
# 描述:
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/2/22
# 描述: 采购OP
import os
from datetime import datetime
from time import sleep
import pytest
import allure
import logging
from ddt import ddt, file_data
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_accept import WarehouseVerify
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_take import WarehouseTake
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_up import WarehouseUp
from component.GuKeYiTiHua.StorageManage.StorageInfo.serial_storage import SerialStorage
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_check import WarehouseCheck
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_delivery import WarehouseDelivery
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_pick import WarehousePick
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.orthopedic_lend import OrthopedicLend
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_distribute import SurgeryDistribute
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_require import SurgeryRequire
from component.GuKeYiTiHua.purchaseManage.purchaseIn.purchase_op import PurchaseOP
from page.GuKeYiTiHua.DBQuery.db_query import DBQuery
from page.GuKeYiTiHua.Public.common import CommonElement
from unit.public.DataDic import DataDic
log = logging.getLogger(__name__)
@pytest.mark.incremental
@ddt
class TestPurchaseOrder(object):
dd = DataDic()
def setup_class(self):
self.dbq = DBQuery()
self.common = CommonElement()
self.po = PurchaseOP()
self.wt = WarehouseTake()
self.wa = WarehouseVerify()
self.wu = WarehouseUp()
self.ss = SerialStorage()
@allure.feature('采购管理')
@allure.story('采购OP')
@allure.title('测试标题')
# @pytest.mark.skip(reason='调试通过')
@allure.description('测试时间:{}'.format(datetime.now()))
@pytest.mark.purchase
@pytest.mark.run(order=10)
@file_data('{}/data/{}TestData.yaml'.format(os.getcwd(), dd.get_value('module')))
def test_purchase_op(self, **kwargs):
with allure.step("测试数据准备..."):
log.info(kwargs)
company = self.dd.get_value('company')
warehouse = self.dd.get_value('warehouse')
if company is not None and warehouse is not None:
kwargs['company'] = company
kwargs['warehouse'] = warehouse
elif (company is None and warehouse is not None) or (company is not None and warehouse is None):
pytest.fail("公司及仓库参数需同时传入.")
cust_good = self.dd.get_value('custGood')
if cust_good is not None:
kwargs['goods'] = [[cust_good, int(self.dd.get_value('custNum'))]]
self.dd.set_value('test_data_info', kwargs)
purchase_op_code = None
with allure.step("采购订单(OP)"):
self.po.open_menu_purchase_op()
self.po.purchase_op_create(purchase_op_code)
purchase_op_code = self.dd.get_value('purchase_op_code')
self.po.purchase_op_transact(purchase_op_code)
self.common.close_tap()
with allure.step("仓库:收货"):
self.wt.take_menu_open()
self.wt.take_pool_take(purchase_op_code)
self.wt.take_confirm(purchase_op_code)
self.common.close_tap()
with allure.step("仓库:验收"):
self.wa.open_verify_menu()
self.wa.verify_edit_and_confirm(purchase_op_code)
self.common.close_tap()
with allure.step("仓库:上架"):
self.wu.open_up_menu()
self.wu.up_confirm(purchase_op_code)
self.common.close_tap()
with allure.step("序列号库存查询"):
self.ss.open_menu_serial_storage()
total = 0
for good in kwargs['goods']:
if self.dbq.get_serial_flag(warehouse, good[0]) == 'Y':
total += good[1]
self.ss.serial_storage_search(text=purchase_op_code, count=total)
self.common.close_tap()
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/1/18
# 描述:
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2022/9/27
from time import sleep
import pytest
@pytest.fixture(scope="function", autouse=True)
def function_setup_teardown():
# scope:function, class, module, package/session
sleep(0.1)
yield
sleep(0.1)
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/2/15
# 描述:
import os
import pytest
import allure
import logging
from ddt import ddt, file_data
from datetime import datetime
from cases.UI.GuKeYiTiHua import PROJECTNAME
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_accept import WarehouseVerify
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_up import WarehouseUp
from component.GuKeYiTiHua.StorageManage.StorageOut.storage_out_integration import StorageOut
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_pick import WarehousePick
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.apolegamy_back import ApolegamyBack
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.apolegamy_out import ApolegamyOut
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.orthopedic_take import OrthopedicTake
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.surgery_back import SurgeryBack
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.apolegamy_borrow import ApolegamyBorrow
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.apolegamy_take import ApolegamyTake
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.orthopedic_lend import OrthopedicLend
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.out_ledger import OutLedger
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_distribute import SurgeryDistribute
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_require import SurgeryRequire
from page.GuKeYiTiHua.DBQuery.db_query import DBQuery
from page.GuKeYiTiHua.Public.common import CommonElement
from unit.public.DataDic import DataDic
log = logging.getLogger(__name__)
@pytest.mark.incremental
@ddt
@allure.epic(PROJECTNAME)
@allure.feature('手术跟台模块')
class TestSurgeryFollow(object):
dd = DataDic()
def setup_class(self):
self.dbq = DBQuery()
self.common = CommonElement()
self.sr = SurgeryRequire()
self.sd = SurgeryDistribute()
self.ol = OrthopedicLend()
self.wp = WarehousePick()
self.so = StorageOut()
self.ole = OutLedger()
self.ab = ApolegamyBorrow()
self.at = ApolegamyTake()
self.sb = SurgeryBack()
self.ot = OrthopedicTake()
self.wa = WarehouseVerify()
self.wu = WarehouseUp()
self.abk = ApolegamyBack()
self.aot = ApolegamyOut()
@allure.story('手术跟台流程')
@allure.title('借出-还回-销售')
@allure.severity(allure.severity_level.BLOCKER)
@allure.description('测试时间:{}'.format(datetime.now()))
@pytest.mark.surgery
@pytest.mark.run(order=10)
# @file_data('{}/data/{}TestData.yaml'.format(os.getcwd(), dd.get_value('module')))
@file_data(dd.get_value('test_data_file'))
def test_surgery_normal(self, **kwargs):
with allure.step('测试数据准备...'):
log.info(kwargs)
self.dd.set_value('test_data_info', kwargs)
goods = kwargs['goods']
process_type = kwargs['process_type']
if process_type == 1:
with allure.step('手术请领单'):
self.sr.surgery_require_menu_open()
self.sr.surgery_require_create()
ql_code = self.dd.get_value('ql_code')
self.sr.surgery_require_search('已办', ql_code)
self.common.close_tap()
with allure.step('请领单配货'):
self.sd.surgery_distribute_menu_open()
self.sd.surgery_distribute_search(order_code=ql_code)
self.sd.surgery_require_distribute(order_code=ql_code)
self.sd.surgery_distribute_search(tap_name='已办', order_code=ql_code)
self.common.close_tap()
with allure.step('骨科仓借出单'):
self.ol.orthopedic_lend_menu_open()
if process_type == 1:
self.ol.orthopedic_lend_search(ot='QL', order_code=ql_code)
self.ol.orthopedic_lend_edit_submit()
else:
self.ol.orthopedic_lend_create()
jc_code = self.dd.get_value('jc_code')
self.ol.orthopedic_lend_search(order_code=jc_code)
self.ol.orthopedic_lend_transact(jc_code)
self.ol.orthopedic_lend_search('已办', order_code=jc_code)
self.common.close_tap()
with allure.step("仓库:发货-拣货-复核"):
self.so.storage_out_integration(jc_code, len(goods))
with allure.step("借出单出库台账"):
self.ole.open_menu_out_ledger()
self.ole.out_ledger_search(order_code=jc_code)
self.common.close_tap()
with allure.step("选配类借入单"):
self.ab.open_menu_apolegamy_borrow()
self.ab.apolegamy_borrow_search(order_code=jc_code)
self.ab.get_apolegamy_borrow_code(jc_code)
self.common.close_tap()
with allure.step("选配类收货单"):
self.at.open_menu_apolegamy_take()
jr_code = self.dd.get_value('jr_code')
self.at.apolegamy_take_search(order_code=jr_code)
self.common.close_tap()
with allure.step("手术跟台还回单"):
self.sb.open_menu_surgery_back()
self.sb.surgery_back_search(order_code=jc_code)
self.sb.get_surgery_back_code(jc_code)
self.common.close_tap()
with allure.step("骨科仓归还收货"):
self.ot.open_menu_orthopedic_take()
follow = kwargs['follow']
self.ot.orthopedic_take_create(None, jc_code, follow)
self.ot.orthopedic_take_search(tap_name='已办', order_code=self.dd.get_value('hhsh_code'))
self.common.close_tap()
with allure.step("仓库:验收"):
self.wa.open_verify_menu()
hh_code = self.dd.get_value('hh_code')
self.wa.verify_edit_and_confirm(order_code=hh_code, order_type='HH') if follow == 'N' else 0
self.wa.verify_order_search('已办', order_code=hh_code)
self.common.close_tap()
with allure.step("仓库:上架"):
self.wu.open_up_menu()
self.wu.up_confirm(order_code=hh_code) if follow == 'N' else 0
self.wu.up_order_search('已办', order_code=hh_code)
self.common.close_tap()
with allure.step("选配类还回出库"):
self.abk.open_menu_apolegamy_back()
self.abk.apolegamy_back_search(order_code=hh_code)
self.abk.get_apolegamy_out_code(order_code=hh_code)
self.common.close_tap()
with allure.step("选配类还回出库单出库"):
self.aot.open_menu_apolegamy_out()
self.aot.apolegamy_out_search(order_code=self.dd.get_value('fh_code'))
self.common.close_tap()
# 连台新流程
if follow == 'Y':
with allure.step("连台:请领单"):
self.sr.surgery_require_menu_open()
new_ql_code = self.dbq.get_follow_ql_code(hh_code)
log.info('连台生成请领单号:【{}】'.format(new_ql_code))
self.sr.surgery_require_search('已办', new_ql_code)
self.common.close_tap()
with allure.step("连台:借出单"):
self.ol.orthopedic_lend_menu_open()
self.ol.orthopedic_lend_search(ot='QL', order_code=new_ql_code)
self.ol.orthopedic_lend_edit_submit(follow)
self.common.close_tap()
with allure.step("连台:仓库:拣货"):
self.wp.open_menu_warehouse_pick()
self.wp.pick_order_search(tap_name='待办', order_code=self.dd.get_value('new_jc_code'))
self.common.close_tap()
# 选配类转销售单
# -*- coding:utf-8 -*-
# 作者:齐振鋆
# 日期:2023/3/12
# 描述:
'''
@Project :gukeyitihua
@File :1.py
@IDE :PyCharm
@Author :何凯
@Date :2023/3/12 10:35
'''
import os
import logging
import allure
import pytest as pytest
from ddt import ddt, file_data
from page.GuKeYiTiHua.Public.common import CommonElement
from unit.public.DataDic import DataDic
from component.GuKeYiTiHua.Transfer.transfer_out import TransferOut
from component.GuKeYiTiHua.StorageManage.StorageOut.storage_out_integration import StorageOut
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_check import WarehouseCheck
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_delivery import WarehouseDelivery
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_pick import WarehousePick
log = logging.getLogger(__name__)
@pytest.mark.incremental
@ddt
class TestBoundOrder(object):
def setup_class(self):
self.dd = DataDic()
self.sr = TransferOut()
self.so = StorageOut()
self.wd = WarehouseDelivery()
self.wp = WarehousePick()
self.wc = WarehouseCheck()
self.common = CommonElement()
@allure.feature('出库')
@allure.story('调拨出库单')
@allure.title('调拨出库单创建')
# @pytest.mark.skip(reason='调试通过')
@allure.description('选择公司->选择业务员->选择调拨出库仓->选择调拨入库仓->保存->添加商品->输入数量->提交')
@pytest.mark.transfer
@pytest.mark.run(order=10)
@file_data('{}/data/transferTestData.yaml'.format(os.getcwd()))
def test_Outboundorder(self, **kwargs):
log.info(kwargs)
self.dd.set_value('test_data_info', kwargs)
goods = kwargs['goods']
#创建调拨出库单
self.sr.open_menu_transfer_out()
self.sr.transfer_out_code_create()
transfer_out_code = self.dd.get_value('transfer_out_code')
#审核
self.sr.transfer_out_code_transact(transfer_out_code)
self.common.close_tap()
#库存管理-发货-拣货-复核
transfer_out_code = self.dd.get_value('transfer_out_code')
self.so.storage_out_integration(transfer_out_code, goods)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment