no message

This commit is contained in:
chenmeng 2017-09-13 10:38:58 +08:00
commit 66dd02a883
139 changed files with 2892 additions and 136 deletions

217
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,217 @@
{
"version": "0.2.0",
"configurations": [
<<<<<<< HEAD
=======
>>>>>>> aa83da6aba2ca2bd8d28babf912398ca2114d309
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
<<<<<<< HEAD
"pythonPath": "${config:python.pythonPath}",
=======
// "pythonPath": "${config:python.pythonPath}",
>>>>>>> aa83da6aba2ca2bd8d28babf912398ca2114d309
"program": "${file}",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "PySpark",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"osx": {
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit"
},
"windows": {
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd"
},
"linux": {
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit"
},
"program": "${file}",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Python Module",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"module": "module.name",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Integrated Terminal/Console",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"console": "integratedTerminal",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
{
"name": "External Terminal/Console",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"console": "externalTerminal",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
{
"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${workspaceRoot}/manage.py",
"cwd": "${workspaceRoot}",
"args": [
"runserver",
<<<<<<< HEAD
"--noreload",
"--nothreading"
=======
"--noreload"
>>>>>>> aa83da6aba2ca2bd8d28babf912398ca2114d309
],
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput",
"DjangoDebugging"
]
},
{
"name": "Flask",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${config:python.pythonPath}",
"program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",
"cwd": "${workspaceRoot}",
"env": {
"FLASK_APP": "${workspaceRoot}/quickstart/app.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Flask (old)",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${config:python.pythonPath}",
"program": "${workspaceRoot}/run.py",
"cwd": "${workspaceRoot}",
"args": [],
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Pyramid",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/.env",
"args": [
"${workspaceRoot}/development.ini"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput",
"Pyramid"
]
},
{
"name": "Watson",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${workspaceRoot}/console.py",
"cwd": "${workspaceRoot}",
"args": [
"dev",
"runserver",
"--noreload=True"
],
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"localRoot": "${workspaceRoot}",
"remoteRoot": "${workspaceRoot}",
"port": 3000,
"secret": "my_secret",
"host": "localhost"
}
]
}

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
//
{
// "python.pythonPath": "/usr/local/bin/python"
"python.pythonPath": "/usr/local/bin/python3",
"python.linting.pylintEnabled": false
}

20
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"version": "0.1.0",
"command": "python3",
"isShellCommand": true,
"osx": {
"args": [
"chrome",
"/usr/local/bin/chromedriver"
]
// ,
// "args2": [
// "Firfox",
// "/usr/local/bin/geckodriver"
// ]
},
"args": [
"${file}"
],
"showOutput": "always"
}

Binary file not shown.

Binary file not shown.

27
comp_info.py Normal file
View File

@ -0,0 +1,27 @@
class CompInfo(object):
# base_url
BASE_URL = 'https://firms.guanplus.com'
# BASE_URL = 'http://guanplus-app-accountingfirm-web-dev-1.cn-north-1.eb.amazonaws.com.cn'
# BASE_URL = 'https://web-gyz-stage.guanplus.com'
# 登录信息
# pro
# LOGIN_DATA = ['13683139989','qq123456']
# dev
# LOGIN_DATA = ['18612198503','qq123456']
# stage
LOGIN_DATA = ['13683139989', 'qq123456']
# 公司信息
# comp_json 'username','password','comp_name']
# stage
# COMP_NAME = 'auto_test'
# COMP_NAME_YB ='auto_test_yb'
#
# stage
COMP_NAME = 'auto_test'
COMP_NAME_YB = 'auto_test_yb'
ENTER_COMP_INFO = [LOGIN_DATA, COMP_NAME]
ENTER_COMP_INFO_YB = [LOGIN_DATA, COMP_NAME_YB]

View File

@ -13,16 +13,16 @@ Driver = webdriver.Chrome()
# BaseUrl = 'http://guanplus-app-accountingfirm-web-dev-1.cn-north-1.eb.amazonaws.com.cn'
#stage环境地址
BaseUrl = 'https://web-gyz-stage.guanplus.com'
# BaseUrl = 'https://web-gyz-stage.guanplus.com'
#pro环境地址
# BaseUrl = 'https://firms.guanplus.com'
BaseUrl = 'https://firms.guanplus.com'
#dev环境:账户->账套 [账户,密码,公司名]
# AccountCompany = ['18201215366','qq123456','一般纳税人07251510']
#stage环境:账户->账套 [账户,密码,公司名]
AccountCompany = ['18514509382','qq123456','羊羊羊08101921']
AccountCompany = ['18514509382','qq123456','多数据多账期0905']
#pro环境测试账户->账套 [账户,密码,公司名]
# AccountCompany = ['18514509382','qq123456','一般纳税人07272015']

98
debug.log Normal file
View File

@ -0,0 +1,98 @@
[0704/190401.897:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0704/190401.898:ERROR:exception_snapshot_win.cc(87)] thread ID 12476 not found in process
[0704/190401.898:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0719/140121.526:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0719/140121.527:ERROR:exception_snapshot_win.cc(87)] thread ID 9872 not found in process
[0719/140121.527:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0721/175619.384:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0721/175619.386:ERROR:exception_snapshot_win.cc(87)] thread ID 1368 not found in process
[0721/175619.386:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0722/200508.755:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0722/200508.795:ERROR:exception_snapshot_win.cc(87)] thread ID 26752 not found in process
[0722/200508.795:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/090227.148:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/090227.188:ERROR:exception_snapshot_win.cc(87)] thread ID 23000 not found in process
[0725/090227.188:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/105858.739:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/105858.771:ERROR:exception_snapshot_win.cc(87)] thread ID 19332 not found in process
[0725/105858.771:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/122129.872:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/122129.905:ERROR:exception_snapshot_win.cc(87)] thread ID 15100 not found in process
[0725/122129.905:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/122130.452:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/122130.452:ERROR:exception_snapshot_win.cc(87)] thread ID 22960 not found in process
[0725/122130.452:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/151618.297:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/151618.338:ERROR:exception_snapshot_win.cc(87)] thread ID 22596 not found in process
[0725/151618.338:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/151701.320:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/151701.320:ERROR:exception_snapshot_win.cc(87)] thread ID 9252 not found in process
[0725/151701.320:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/205847.788:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/205847.819:ERROR:exception_snapshot_win.cc(87)] thread ID 5868 not found in process
[0725/205847.819:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0725/210130.146:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0725/210130.146:ERROR:exception_snapshot_win.cc(87)] thread ID 16836 not found in process
[0725/210130.146:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0727/183444.802:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0727/183444.839:ERROR:exception_snapshot_win.cc(87)] thread ID 13416 not found in process
[0727/183444.839:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0727/201716.677:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0727/201716.717:ERROR:exception_snapshot_win.cc(87)] thread ID 10484 not found in process
[0727/201716.717:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0727/222345.248:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0727/222345.288:ERROR:exception_snapshot_win.cc(87)] thread ID 17212 not found in process
[0727/222345.288:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/171458.562:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/171458.785:ERROR:exception_snapshot_win.cc(87)] thread ID 10256 not found in process
[0729/171458.785:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/171459.656:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/171459.657:ERROR:exception_snapshot_win.cc(87)] thread ID 12388 not found in process
[0729/171459.657:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.123:ERROR:process_reader_win.cc(151)] SuspendThread: 拒绝访问。 (0x5)
[0729/191932.161:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.161:ERROR:exception_snapshot_win.cc(87)] thread ID 8348 not found in process
[0729/191932.161:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.313:ERROR:process_reader_win.cc(151)] SuspendThread: 拒绝访问。 (0x5)
[0729/191932.314:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.314:ERROR:exception_snapshot_win.cc(87)] thread ID 25568 not found in process
[0729/191932.314:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.750:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.751:ERROR:exception_snapshot_win.cc(87)] thread ID 12564 not found in process
[0729/191932.751:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.759:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.761:ERROR:exception_snapshot_win.cc(87)] thread ID 24796 not found in process
[0729/191932.761:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.880:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.881:ERROR:exception_snapshot_win.cc(87)] thread ID 2556 not found in process
[0729/191932.881:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.897:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.899:ERROR:exception_snapshot_win.cc(87)] thread ID 16776 not found in process
[0729/191932.899:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0729/191932.950:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0729/191932.951:ERROR:exception_snapshot_win.cc(87)] thread ID 27320 not found in process
[0729/191932.951:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0801/123618.760:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0801/123618.798:ERROR:exception_snapshot_win.cc(87)] thread ID 10556 not found in process
[0801/123618.798:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0801/132815.120:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0801/132815.120:ERROR:exception_snapshot_win.cc(87)] thread ID 23384 not found in process
[0801/132815.120:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0803/144930.514:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0803/144930.537:ERROR:exception_snapshot_win.cc(87)] thread ID 12580 not found in process
[0803/144930.537:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0803/164154.555:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0803/164154.582:ERROR:exception_snapshot_win.cc(87)] thread ID 5808 not found in process
[0803/164154.582:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0803/164441.012:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0803/164441.035:ERROR:exception_snapshot_win.cc(87)] thread ID 14592 not found in process
[0803/164441.035:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0803/165019.444:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0803/165019.445:ERROR:exception_snapshot_win.cc(87)] thread ID 17528 not found in process
[0803/165019.445:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0804/125328.040:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0804/125328.073:ERROR:exception_snapshot_win.cc(87)] thread ID 20688 not found in process
[0804/125328.073:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0804/125935.975:ERROR:process_reader_win.cc(123)] NtOpenThread: {无法访问} 过程已请求访问一对象,但未给访问权限。 (0xc0000022)
[0804/125935.976:ERROR:exception_snapshot_win.cc(87)] thread ID 9456 not found in process
[0804/125935.976:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed

17
geckodriver.log Normal file
View File

@ -0,0 +1,17 @@
1503316560106 geckodriver INFO geckodriver 0.18.0
1503316560113 geckodriver INFO Listening on 127.0.0.1:53220
1503316562184 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe with args ["-marionette"]
1503316563410 Marionette INFO Enabled via --marionette
[GPU 19532] WARNING: pipe error: 109: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1503316565768 Marionette INFO Listening on port 53229
1503316565777 Marionette INFO Listening on port 53229
1503316565809 Marionette WARN TLS certificate errors will be ignored for this session
1503316565850 Marionette DEBUG loaded listener.js
1503316565959 Marionette DEBUG Received DOM event "beforeunload" for "about:blank"
1503316566053 Marionette DEBUG Received DOM event "pagehide" for "about:blank"
1503316566053 Marionette DEBUG Received DOM event "unload" for "about:blank"
1503316573072 Marionette DEBUG Received DOM event "DOMContentLoaded" for "http://guanplus-app-accountingfirm-web-dev-1.cn-north-1.eb.amazonaws.com.cn/"
1503316574738 Marionette DEBUG Received DOM event "pageshow" for "http://guanplus-app-accountingfirm-web-dev-1.cn-north-1.eb.amazonaws.com.cn/"
1503316575595 Marionette DEBUG Canceled page load listener because no navigation has been detected
1503316585603 Marionette INFO New connections will no longer be accepted
[Child 7640] WARNING: pipe error: 232: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 513

17
ghostdriver.log Normal file
View File

@ -0,0 +1,17 @@
<<<<<<< HEAD
[INFO - 2017-09-10T07:03:01.914Z] GhostDriver - Main - running on port 59997
[INFO - 2017-09-10T07:03:05.269Z] Session [17d86300-95f6-11e7-b0e3-138a045eab1a] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true}
[INFO - 2017-09-10T07:03:05.269Z] Session [17d86300-95f6-11e7-b0e3-138a045eab1a] - page.customHeaders: - {}
[INFO - 2017-09-10T07:03:05.270Z] Session [17d86300-95f6-11e7-b0e3-138a045eab1a] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"windows-10-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2017-09-10T07:03:05.270Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 17d86300-95f6-11e7-b0e3-138a045eab1a
[ERROR - 2017-09-10T07:03:27.870Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1505027007812
=======
[INFO - 2017-09-06T09:55:46.591Z] GhostDriver - Main - running on port 62559
[INFO - 2017-09-06T09:55:47.033Z] Session [8e494050-92e9-11e7-ba72-d9b567fde432] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true}
[INFO - 2017-09-06T09:55:47.033Z] Session [8e494050-92e9-11e7-ba72-d9b567fde432] - page.customHeaders: - {}
[INFO - 2017-09-06T09:55:47.033Z] Session [8e494050-92e9-11e7-ba72-d9b567fde432] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"mac-10.11 (El Capitan)-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2017-09-06T09:55:47.033Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 8e494050-92e9-11e7-ba72-d9b567fde432
[ERROR - 2017-09-06T09:56:44.956Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1504691804912
>>>>>>> aa83da6aba2ca2bd8d28babf912398ca2114d309
phantomjs://platform/console++.js:263 in error

6
gitignore.py Normal file
View File

@ -0,0 +1,6 @@
/report/*
*.cpython-36.pyc
test_case/invoice/__pycache__/*.cpython-36.pyc
util/__pycache__/*.cpython-36.pyc
*._init_.cpython-36.pyc
*.*.__pycache__/*.cpython-36.pyc

View File

@ -1,15 +1,20 @@
一、环境说明:
python版本 3.6.1
selenum版本 2.0
chrome版本 59.0.3071.115
chromedriver版本 2.30.477700
pip命令使用配置: 将python安装文件目录下Scripts配置到系统环境变量中的path里面
将HTMLTestRunner拷贝到 'C:\Users\yangchunhong\AppData\Local\Programs\Python\Python36\Lib'目录下
二、涉及的第三方模块
快速下载第三方模块pip3 install --index https://pypi.mirrors.ustc.edu.cn/simple/
1、操作excel xlrd, openpyxl
2、http协议相关 requests
3、连接PostgreSQL数据库模块psycopg2
sqlalchemy sqlalchemy
一、环境说明:
python版本 3.6.1
selenum版本 2.0
chrome版本 59.0.3071.115
chromedriver版本 2.30.477700
pip命令使用配置: 将python安装文件目录下Scripts配置到系统环境变量中的path里面
将HTMLTestRunner拷贝到 'C:\Users\yangchunhong\AppData\Local\Programs\Python\Python36\Lib'目录下
二、涉及的第三方模块
快速下载第三方模块pip3 install --index https://pypi.mirrors.ustc.edu.cn/simple/
1、操作excel xlrd, openpyxl
2、http协议相关 requests
3、连接PostgreSQL数据库模块psycopg2
sqlalchemy sqlalchemy
# pip3 install -U selenium
# pip3 install xlrd
# pip3 install openpyxl
# pip3 install requests

55
remote_ts.py Normal file
View File

@ -0,0 +1,55 @@
from selenium import webdriver
from time import sleep
from selenium.webdriver import Remote
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
# def login():
# # driver = webdriver.Chrome()
# binary = FirefoxBinary('C:\\Users\yangchunhong\\AppData\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\selenium\\webdriver\\firefox\\firefox_binary.py')
# driver = webdriver.Firefox(firefox_binary=binary)
# driver.get('http://guanplus-app-accountingfirm-web-dev-1.cn-north-1.eb.amazonaws.com.cn')
# userNameInput = driver.find_element_by_id('usernameInput')
# userNameInput.clear()
# userNameInput.send_keys('18514509382')
# passwordInput = driver.find_element_by_id('passwordInput')
# passwordInput.clear()
# passwordInput.send_keys('qq123456')
# loginButton = driver.find_element_by_id('loginButton')
# loginButton.click()
# sleep(10)
# driver.quit()
lists = {
'http://127.0.0.1:4444/wd/hub':'chrome',
# 'http://192.168.38.88:5555/wd/hub':'chrome'
'http://127.0.0.1:5556/wd/hub':'chrome'
}
for host,browser in lists.items():
print(host,browser)
driver = Remote(command_executor=host,
desired_capabilities={
'platform':'ANY',
'browserName':browser,
'version':'',
'javascriptEnabled':True,
'acceptInsecureCerts':True
}
)
driver.get('http://guanplus-app-accountingfirm-web-dev-1.cn-north-1.eb.amazonaws.com.cn')
userNameInput = driver.find_element_by_id('usernameInput')
userNameInput.clear()
userNameInput.send_keys('18514509382')
passwordInput = driver.find_element_by_id('passwordInput')
passwordInput.clear()
passwordInput.send_keys('qq123456')
loginButton = driver.find_element_by_id('loginButton')
loginButton.click()
sleep(10)
driver.quit()

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

View File

@ -0,0 +1,9 @@
import asyncio
async def hello_world():
print("Hello World!")
loop = asyncio.get_event_loop()
# Blocking call which returns when the hello_world() coroutine is done
loop.run_until_complete(hello_world())
loop.close()

View File

@ -0,0 +1,21 @@
def consumer():
r = ''
while True:
n = yield r
if not n:
return
print('[CONSUMER] Consuming %s...' % n)
r = '200 OK'
def produce(c):
c.send(None)
n = 0
while n < 5:
n = n + 1
print('[PRODUCER] Producing %s...' % n)
r = c.send(n)
print('[PRODUCER] Consumer return: %s' % r)
c.close()
c = consumer()
produce(c)

74
report/ych_test/iter.py Normal file
View File

@ -0,0 +1,74 @@
class MyRange(object):
def __init__(self,n):
self.i = 0
self.n = n
def __iter__(self):
return self
def __next__(self):
if self.i < self.n:
i = self.i
self.i += 1
return i
else:
raise StopIteration()
#斐波那契数列
class Fibs(object):
def __init__(self,max):
self.max = max
self.a = 0
self.b = 1
def __iter__(self):
return self
def __next__(self):
fib = self.a
if fib > self.max:
raise StopIteration()
self.a,self.b = self.b,self.a + self.b
return fib
#斐波那契数列 yield
def fibs_yield(max):
n,a,b = 0,0,1
while n < max:
yield b
a,b = b,a + b
n = n + 1
#生成器方法 在开始运行后可以为生成器提供新的值,类似生成器与“外界”进行数据交流
def repeater(n):
while True:
n = (yield n)
if __name__ =='__main__':
#自定义迭代
# x = MyRange(7)
# # print('x.next():' + str(x.__next__()))
# # for i in x:
# # print(i)
# print(list(x))
# print(x.__next__())
#斐波那契数列
# fibs = Fibs(5)
# print(list(fibs))
#斐波那契数列 yield
# ff = fibs_yield(5)
# for i in ff:
# print(i)
#生成器方法 send()方法必须在生成器运行后并挂起才能使用即yield至少被执行一次
r = repeater(3)
# print(r.send(None))
print(r.__next__())
print(r.send('y'))
r.close()

View File

@ -0,0 +1,30 @@
from time import sleep,ctime
import threading
def music(musicName):
for i in range(2):
print('I was listening to %s! %s'%(musicName,ctime()))
sleep(2)
def movie(moiveName,loop):
for i in range(loop):
print('I was at the %s! %s'%(moiveName,ctime()))
sleep(5)
threads = []
# t1 = threading.Thread(target=music,args=('爱情买卖',2))
# threads.append(t1)
# t2 = threading.Thread(target=movie,args=('阿发达',2))
# threads.append(t2)
nameList = ['讲经说法的','收到了福建师范']
for name in nameList:
t = threading.Thread(target=music,args=(name,))
threads.append(t)
if __name__ == '__main__':
for t in threads:
t.start()
for t in threads:
t.join()
print('all end:%s'%ctime())

View File

@ -1,6 +1,8 @@
from openpyxl import load_workbook
from openpyxl import Workbook
# import sys,os
import requests
import json
import sys,os
# # import getpass
# def write_to_excel():
@ -18,5 +20,63 @@ from openpyxl import Workbook
# # write_to_excel()
# read_excel()
def get_voucher_api(pageIndex):
checkJournalList = []
for i in range(1,17):
url = 'https://api-firms.guanplus.com/api/v1/journal/search?year=2017&month=8&keyword=&pageIndex=' + str(i) + '&pageSize=10&type='
headers = {
'Accept':'application/json',
'Accept-Encoding':'gzip, deflate, sdch',
'Accept-Language':'zh-CN,zh;q=0.8',
'Cache-Control':'no-cache',
'Connection':'keep-alive',
'Content-Type':'application/json',
'Authorization':'bearer aOmvOukO67OHdvqLWbnTyULE_eOnsPqZqnDxes2kgYQ1owKRGVoINwe85CCf5Ns2iw5bKBUjmL6kb-F0b6W8uMo58d4myuDINR35fBKQq-w4wb-l4JgIg2aqEMH1qid34VA_-wLVzZztjnrVsIHXYKVLmT58l33mKrU3E2o_7VQWP-qRuc_zVdH_LTWRv93uwzfOz3PhrkueXRmBT_uZkIb1Kl-ESyCnLKzfbvzmNsJ1CdFTlfvdRAf3cvQI_ZKDNNHLGRfsiZzzWB7GxCcy8B1g1aM',
'company_id':'5a8a5e65-0f17-4353-815a-9046199c6f5b',
'accountbook_id':'94abec6d-1afe-4c2f-bc26-88043fe4754d',
'Host':'api-firms.guanplus.com',
'Origin':'https://firms.guanplus.com',
'Referer':'//firms.guanplus.com/app/finance/voucher',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0'
}
request = requests.get(url,headers=headers)
resposeData = json.loads(request.text)
journalList = resposeData['list']
for i in journalList:
journalEntryLineItemList = i['journalEntryLineItemModels']
for j in journalEntryLineItemList:
checkJournalItemDict = {}
checkJournalItemDict['journalNumber'] = i['journalEntryNumber']
checkJournalItemDict['accountCode'] = j['account']['id']
checkJournalItemDict['accountName'] = j['account']['name']
checkJournalItemDict['dcDirection'] = j['debitCreditType']
checkJournalItemDict['amount'] = str(j['amount'])
checkJournalList.append(checkJournalItemDict)
print(checkJournalList)
wb = load_workbook('F:\\autoTest_workspace\\python_code\\e2e-test\\test_data\\凭证.xlsx')
sheet = wb.get_sheet_by_name('说明')
for lists,i in zip(checkJournalList,range(2,(len(checkJournalList) + 2))):
rowNum = i
sheet['A' + str(rowNum)] = lists['journalNumber']
sheet['B' + str(rowNum)] = lists['accountCode']
sheet['C' + str(rowNum)] = lists['accountName']
sheet['D' + str(rowNum)] = lists['dcDirection']
sheet['E' + str(rowNum)] = lists['amount']
wb.save('凭证.xlsx')
print('write success')
# return checkJournalList
get_voucher_api('1')
def write_to_excel():
wb = load_workbook('F:\\autoTest_workspace\\python_code\\e2e-test\\test_data\\凭证.xlsx')
sheet = wb.get_sheet_by_name('(一般纳税人)流水单生成凭证校验')
sheet['A4'] = '来连连看'
wb.save('凭证.xlsx')
print('write success')

View File

@ -0,0 +1,21 @@
def r_return(n):
print('you taked me')
while n > 0:
print('before return')
return n
n -= 1
print('after return')
# r_return(3)
def y_yield(n):
print('you taked me')
while n > 0:
print('before return')
yield n
n -= 1
print('after return')
yy = y_yield(3)
for i in yy:
print(i)

203
rrr.py Normal file
View File

@ -0,0 +1,203 @@
import unittest,time,os
import smtplib
from email.mime.text import MIMEText
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from HTMLTestRunner import HTMLTestRunner
from test_case.transaction.record_outcome_spec import RecordOutcomeSpec
from test_case.transaction.record_income_spec import RecordIncomeSpec
from test_case.transaction.record_transfer_spec import RecordTransterSpec
from test_case.transaction.outcome_voucher_spec import OutcomeVoucherSpec
from test_case.invoice.record_input_invoice_spec import RecordInputInvoiceSpec
from test_case.invoice.record_output_invoice_spec import RecordOutputInvoiceSpec
from test_case.finance.voucher.generate_voucher_spec import GenerateVoucherSpec
from test_case.fixedassets.record_fixed_spec import RecordFixedSpec
from test_case.fixedassets.record_intangible_spec import RecordIntangibleSpec
from test_case.finance.voucher.record_business_spec import RecordBusinessSpec
from test_case.business_flow.positive_flow_spec import PositiveFlowSpec
from test_case.business_flow.positive_flow_specb import PositiveFlowSpec1
# from test_case.dashbaord.assistant_dashbaord_spec import AssistantDashbaordSPec
from test_case.dashbaord.assistant_dashbaord_spec import AssistantDashbaordSPec
import queue
import threading
#发送邮件
def send_mail(file_new):
f = open(file_new,'rb')
mail_body = f.read()
f.close()
smtpserver = 'smtp.163.com'
user = '18514509382@163.com'
password = 'yang115817'
sender = '18514509382@163.com'
receiver = 'yangchunhong@concordya.com'
msg = MIMEMultipart()
msg['From'] = '18514509382@163.com'
msg['Subject'] = Header(u'自动化测试报告','utf8').encode()
msg['To'] = 'yangchunhong@concordya.com'
msg.attach(MIMEText(mail_body,'html','utf-8'))
smtp = smtplib.SMTP(smtpserver,25)
smtp.login(user,password)
smtp.sendmail(sender,receiver,msg.as_string())
smtp.quit()
#查找最新的测试报告
def find_new_report(testReport):
lists = os.listdir(testReport)
lists.sort(key=lambda fn:os.path.getmtime(testReport + '//' + fn))
file_new = os.path.join(testReport,lists[-1])
return file_new
class MyThread(threading.Thread):
def __init__(self, func, args=(), name=''):
super(MyThread, self).__init__(target=func, args=args, name=name)
self.name = name
self.func = func
self.args = args
def run(self):
self.func.run(suite)
while True:
if myqueue.empty() == False:
suite = myqueue.get()
self.func.run(suite)
else:
break
testcase=['test1','test2']
myqueue = queue.Queue(maxsize = 10)
for i in testcase:
suite = unittest.TestSuite()
suite.addTest(PositiveFlowSpec1(i))
myqueue.put(suite)
if __name__ == '__main__':
threads = []
now = time.strftime('%Y-%m-%d %H_%M_%S')
report_dir = './report'
filename = report_dir + '/' + now + '_result.html'
testReport = open(filename,'wb')
runner = HTMLTestRunner(stream = testReport,title = "管有账测试报告",description='测试用例执行情况:')
for i in range(1):
t = MyThread(runner)
# t.start()
threads.append(t)
for i in threads:
i.start()
for i in threads:
i.join()
testReport.close()
# now = time.strftime('%Y-%m-%d %H_%M_%S')
# report_dir = './report'
# filename = report_dir + '/' + now + '_result.html'
# testReport = open(filename,'wb')
# runner = HTMLTestRunner(stream = testReport,title = "管有账测试报告",description='测试用例执行情况:')
# runner.run(testSuite)
# testReport.close()
# new_report = find_new_report('./report')
# send_mail(new_report)
# def spec():
# testSuite = unittest.TestSuite()
# #记支出测试
# testSuite.addTest(RecordOutcomeSpec('test1'))
# testSuite.addTest(RecordOutcomeSpec('test2'))
# testSuite.addTest(RecordOutcomeSpec('test3'))
# testSuite.addTest(RecordOutcomeSpec('test4'))
# testSuite.addTest(RecordOutcomeSpec('test5'))
# testSuite.addTest(RecordOutcomeSpec('test6'))
# testSuite.addTest(RecordOutcomeSpec('test7'))
# testSuite.addTest(RecordOutcomeSpec('test8'))
# #记收入测试
# testSuite.addTest(RecordIncomeSpec('test1'))
# testSuite.addTest(RecordIncomeSpec('test2'))
# testSuite.addTest(RecordIncomeSpec('test3'))
# testSuite.addTest(RecordIncomeSpec('test4'))
# testSuite.addTest(RecordIncomeSpec('test5'))
# testSuite.addTest(RecordIncomeSpec('test6'))
# testSuite.addTest(RecordIncomeSpec('test7'))
# testSuite.addTest(RecordIncomeSpec('test8'))
# #记账户互转 *注意:需要新增招商银行账户
# testSuite.addTest(RecordTransterSpec('test1'))
# testSuite.addTest(RecordTransterSpec('test2'))
# testSuite.addTest(RecordTransterSpec('test3'))
# testSuite.addTest(RecordTransterSpec('test4'))
# testSuite.addTest(RecordTransterSpec('test5'))
# testSuite.addTest(RecordTransterSpec('test6'))
# testSuite.addTest(RecordTransterSpec('test7'))
# testSuite.addTest(RecordTransterSpec('test8'))
# # # #记收票测试
# testSuite.addTest(RecordInputInvoiceSpec('test1'))
# testSuite.addTest(RecordInputInvoiceSpec('test2'))
# # #记开票测试
# testSuite.addTest(RecordOutputInvoiceSpec('test1'))
# testSuite.addTest(RecordOutputInvoiceSpec('test2'))
# # #记固定资产
# testSuite.addTest(RecordFixedSpec('test1'))
# testSuite.addTest(RecordFixedSpec('test2'))
# # # #记无形资产
# testSuite.addTest(RecordIntangibleSpec('test1'))
# testSuite.addTest(RecordIntangibleSpec('test2'))
#记所有的业务单:收入、支出、账户互转、收票、开票、固定资产、无形资产
# testSuite.addTest(RecordBusinessSpec('test1'))
# testSuite.addTest(RecordBusinessSpec('test2'))
# testSuite.addTest(RecordBusinessSpec('test3'))
# testSuite.addTest(RecordBusinessSpec('test4'))
# testSuite.addTest(RecordBusinessSpec('test5'))
# testSuite.addTest(RecordBusinessSpec('test6'))
# testSuite.addTest(RecordBusinessSpec('test7'))
# testSuite.addTest(RecordBusinessSpec('test8'))
# testSuite.addTest(RecordBusinessSpec('test9'))
# testSuite.addTest(RecordBusinessSpec('test10'))
#业务流程测试
# testSuite.addTest(PositiveFlowSpec('test1'))
# testSuite.addTest(PositiveFlowSpec('test2'))
# testSuite.addTest(PositiveFlowSpec('test3'))
# testSuite.addTest(PositiveFlowSpec('test4'))
# testSuite.addTest(PositiveFlowSpec('test5'))
# testSuite.addTest(PositiveFlowSpec('test6'))
# testSuite.addTest(PositiveFlowSpec('test7'))
# testSuite.addTest(PositiveFlowSpec('test8'))
# testSuite.addTest(PositiveFlowSpec('test9'))
# testSuite.addTest(PositiveFlowSpec('test10'))
# testSuite.addTest(PositiveFlowSpec('test11'))
#会计首页测试(导入)
# testSuite.addTest(AssistantDashbaordSPec('test1'))
# testSuite.addTest(AssistantDashbaordSPec('test2'))
# testSuite.addTest(AssistantDashbaordSPec('test3'))
#生成凭证测试 *【注意】需要新增招商银行且没有流水记录
# testSuite.addTest(GenerateVoucherSpec('test1'))
# testSuite.addTest(GenerateVoucherSpec('test2'))
# testSuite.addTest(GenerateVoucherSpec('test3'))
#支出-生成凭证测试
# testSuite.addTest(OutcomeVoucherSpec('test1'))

View File

@ -6,6 +6,7 @@ from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from HTMLTestRunner import HTMLTestRunner
from test_case.login.login_spec import LoginSpec
from test_case.transaction.record_outcome_spec import RecordOutcomeSpec
from test_case.transaction.record_income_spec import RecordIncomeSpec
from test_case.transaction.record_transfer_spec import RecordTransterSpec
@ -19,6 +20,7 @@ from test_case.finance.voucher.record_business_spec import RecordBusinessSpec
from test_case.business_flow.positive_flow_spec import PositiveFlowSpec
# from test_case.dashbaord.assistant_dashbaord_spec import AssistantDashbaordSPec
from test_case.dashbaord.assistant_dashbaord_spec import AssistantDashbaordSPec
from test_case.setting.setting_spec import SettingSpec
#发送邮件
def send_mail(file_new):
@ -52,6 +54,7 @@ def find_new_report(testReport):
if __name__ == '__main__':
testSuite = unittest.TestSuite()
<<<<<<< HEAD
# #记支出测试
testSuite.addTest(RecordOutcomeSpec('test1'))
testSuite.addTest(RecordOutcomeSpec('test2'))
@ -61,10 +64,21 @@ if __name__ == '__main__':
testSuite.addTest(RecordOutcomeSpec('test6'))
testSuite.addTest(RecordOutcomeSpec('test7'))
testSuite.addTest(RecordOutcomeSpec('test8'))
=======
#记支出测试
testSuite.addTest(RecordOutcomeSpec('test1'))
# testSuite.addTest(RecordOutcomeSpec('test2'))
# testSuite.addTest(RecordOutcomeSpec('test3'))
# testSuite.addTest(RecordOutcomeSpec('test4'))
# testSuite.addTest(RecordOutcomeSpec('test5'))
# testSuite.addTest(RecordOutcomeSpec('test6'))
# testSuite.addTest(RecordOutcomeSpec('test7'))
# testSuite.addTest(RecordOutcomeSpec('test8'))
>>>>>>> e62348180f8c1658af8fa14c9701c79491fe2b38
# #记收入测试
# testSuite.addTest(RecordIncomeSpec('test1'))
#记收入测试
testSuite.addTest(RecordIncomeSpec('test1'))
# testSuite.addTest(RecordIncomeSpec('test2'))
# testSuite.addTest(RecordIncomeSpec('test3'))
# testSuite.addTest(RecordIncomeSpec('test4'))
@ -73,8 +87,8 @@ if __name__ == '__main__':
# testSuite.addTest(RecordIncomeSpec('test7'))
# testSuite.addTest(RecordIncomeSpec('test8'))
# #记账户互转 *注意:需要新增招商银行账户
# testSuite.addTest(RecordTransterSpec('test1'))
#记账户互转 *注意:需要新增招商银行账户
testSuite.addTest(RecordTransterSpec('test1'))
# testSuite.addTest(RecordTransterSpec('test2'))
# testSuite.addTest(RecordTransterSpec('test3'))
# testSuite.addTest(RecordTransterSpec('test4'))
@ -83,19 +97,20 @@ if __name__ == '__main__':
# testSuite.addTest(RecordTransterSpec('test7'))
# testSuite.addTest(RecordTransterSpec('test8'))
# #记收票测试
# # #记收票测试
# testSuite.addTest(RecordInputInvoiceSpec('test1'))
# testSuite.addTest(RecordInputInvoiceSpec('test2'))
# #记开票测试
# # #记开票测试
# testSuite.addTest(RecordOutputInvoiceSpec('test1'))
# testSuite.addTest(RecordOutputInvoiceSpec('test2'))
#记固定资产
# # #记固定资产
# testSuite.addTest(RecordFixedSpec('test1'))
# testSuite.addTest(RecordFixedSpec('test2'))
#记无形资产
# # # #记无形资产
# testSuite.addTest(RecordIntangibleSpec('test1'))
# testSuite.addTest(RecordIntangibleSpec('test2'))
@ -137,6 +152,7 @@ if __name__ == '__main__':
#支出-生成凭证测试
# testSuite.addTest(OutcomeVoucherSpec('test1'))
now = time.strftime('%Y-%m-%d %H_%M_%S')
report_dir = './report'

67
runtest_multi.py Normal file
View File

@ -0,0 +1,67 @@
from selenium import webdriver
from time import sleep,ctime
from selenium.webdriver import Remote
from threading import Thread
# def login(host,browser):
# print(host,browser)
# user_text_id = 'usernameInput'
# pass_text_id = 'passwordInput'
# login_button_id = 'loginButton'
# dc = {'browserName':browser}
# driver = webdriver.Remote(command_executor=host,desired_capabilities=dc)
# driver.get('https://web-gyz-stage.guanplus.com')
# driver.find_element_by_id(user_text_id).send_keys('18514509382')
# driver.find_element_by_id(pass_text_id).send_keys('qq123456')
# driver.find_element_by_id(login_button_id).click()
# sleep(5)
# print('login lalalalla')
# driver.quit()
# if __name__ == '__main__':
# lists = {
# 'http://127.0.0.1:4444/wd/hub':'chrome',
# 'http://127.0.0.1:5555/wd/hub':'chrome'
# }
# threads = []
# driver = webdriver.Chrome()
# files = range(len(lists))
# for host,browser in lists.items():
# t = Thread(target=login,args=(host,browser))
# threads.append(t)
# for i in files:
# threads[i].start()
# for i in files:
# threads[i].join()
class MyThread(Thread):
def __init__(self,func,args,name=''):
Thread.__init__(self)
self.func = func
self.args = args
self.name = name
def run(self):
self.func(*self.args)
def super_play(file_,time):
for i in range(2):
print('yang' + file_ + ctime())
sleep(time)
lists = {'dsf':3,'sdfsf':5,'sfsgee3':4}
threads = []
files = range(len(lists))
for file_,time in lists.items():
t = MyThread(super_play,(file_,time),super_play.__name__)
threads.append(t)
if __name__ == '__main__':
for i in files:
threads[i].start()
for i in files:
threads[i].join()
print('end' + ctime())

186
runtest_threading.py Normal file
View File

@ -0,0 +1,186 @@
import unittest,time,os
import smtplib
from email.mime.text import MIMEText
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from HTMLTestRunner import HTMLTestRunner
from test_case.transaction.record_outcome_spec import RecordOutcomeSpec
from test_case.transaction.record_income_spec import RecordIncomeSpec
from test_case.transaction.record_transfer_spec import RecordTransterSpec
from test_case.transaction.outcome_voucher_spec import OutcomeVoucherSpec
from test_case.invoice.record_input_invoice_spec import RecordInputInvoiceSpec
from test_case.invoice.record_output_invoice_spec import RecordOutputInvoiceSpec
from test_case.finance.voucher.generate_voucher_spec import GenerateVoucherSpec
from test_case.fixedassets.record_fixed_spec import RecordFixedSpec
from test_case.fixedassets.record_intangible_spec import RecordIntangibleSpec
from test_case.finance.voucher.record_business_spec import RecordBusinessSpec
from test_case.business_flow.positive_flow_spec import PositiveFlowSpec
from test_case.business_flow.positive_flow_specb import PositiveFlowSpec1
# from test_case.dashbaord.assistant_dashbaord_spec import AssistantDashbaordSPec
from test_case.dashbaord.assistant_dashbaord_spec import AssistantDashbaordSPec
import threading
from selenium.webdriver import Remote
#发送邮件
def send_mail(file_new):
f = open(file_new,'rb')
mail_body = f.read()
f.close()
smtpserver = 'smtp.163.com'
user = '18514509382@163.com'
password = 'yang115817'
sender = '18514509382@163.com'
receiver = 'yangchunhong@concordya.com'
msg = MIMEMultipart()
msg['From'] = '18514509382@163.com'
msg['Subject'] = Header(u'自动化测试报告','utf8').encode()
msg['To'] = 'yangchunhong@concordya.com'
msg.attach(MIMEText(mail_body,'html','utf-8'))
smtp = smtplib.SMTP(smtpserver,25)
smtp.login(user,password)
smtp.sendmail(sender,receiver,msg.as_string())
smtp.quit()
#查找最新的测试报告
def find_new_report(testReport):
lists = os.listdir(testReport)
lists.sort(key=lambda fn:os.path.getmtime(testReport + '//' + fn))
file_new = os.path.join(testReport,lists[-1])
return file_new
def runTest(testSuite,name):
now = time.strftime('%Y-%m-%d %H_%M_%S')
report_dir = './report'
filename = report_dir + '/' + now + '_' + name + '_result.html'
testReport = open(filename,'wb')
# runner = HTMLTestRunner(stream = testReport,title = "管有账测试报告",description='测试用例执行情况:')
runner = unittest.TextTestRunner()
runner.run(testSuite)
testReport.close()
#记固定资产
def runRecordFixedSpec(testCase):
testSuite = unittest.TestSuite()
testSuite.addTest(RecordFixedSpec(testCase))
runTest(testSuite,'RecordFixedSpec')
#记无形资产
def runRecordIntangibleSpec(testCase):
testSuite = unittest.TestSuite()
testSuite.addTest(RecordIntangibleSpec(testCase))
runTest(testSuite,'RecordIntangibleSpec')
#导入
def importFile(testCase):
testSuite = unittest.TestSuite()
testSuite.addTest(AssistantDashbaordSPec(testCase))
runTest(testSuite,'RecordFixedSpec')
#记收入
def runRecordIncomeSpec():
testSuite = unittest.TestSuite()
testSuite.addTest(RecordIncomeSpec('test8'))
runTest(testSuite,'RecordFixedSpec')
#记支出
def runRecordOutcomeSpec():
testSuite = unittest.TestSuite()
testSuite.addTest(RecordOutcomeSpec('test8'))
runTest(testSuite,'RecordFixedSpec')
#记账户互转
def runRecordTransterSpec():
testSuite = unittest.TestSuite()
testSuite.addTest(RecordTransterSpec('test8'))
runTest(testSuite,'RecordFixedSpec')
#记收票
def runRecordInputInvoiceSpec(testCase):
testSuite = unittest.TestSuite()
testSuite.addTest(RecordInputInvoiceSpec(testCase))
runTest(testSuite,'RecordFixedSpec')
#记开票
def runRecordOutputInvoiceSpec(testCase):
testSuite = unittest.TestSuite()
testSuite.addTest(RecordOutputInvoiceSpec(testCase))
runTest(testSuite,'RecordFixedSpec')
#流程
def runPositive(testCase):
testSuite = unittest.TestSuite()
testSuite.addTest(PositiveFlowSpec1(testCase))
runTest(testSuite,'RecordFixedSpec')
if __name__ == '__main__':
threads = []
#流程
t1 = threading.Thread(target=runPositive,args=('test1',))
t2 = threading.Thread(target=runPositive,args=('test2',))
t3 = threading.Thread(target=runPositive,args=('test3',))
t4 = threading.Thread(target=runPositive,args=('test4',))
t5 = threading.Thread(target=runPositive,args=('test5',))
t6 = threading.Thread(target=runPositive,args=('test6',))
t7 = threading.Thread(target=runPositive,args=('test7',))
t8 = threading.Thread(target=runPositive,args=('test8',))
t9 = threading.Thread(target=runPositive,args=('test9',))
t10 = threading.Thread(target=runPositive,args=('test10',))
# threads = [t1,t2,t3,t4]
threads = [t5,t6,t7,t8]
#导入
# t1 = threading.Thread(target=importFile,args=('test1',))
# t2 = threading.Thread(target=importFile,args=('test2',))
# t3 = threading.Thread(target=importFile,args=('test3',))
# threads = [t1,t2,t3]
# # for t in threads:
# # t.start()
# # for t in threads:
# # t.join()
# # threads.append(t2)
# # #记收支
# specList = [runRecordIncomeSpec,runRecordOutcomeSpec]
# for i in specList:
# t = threading.Thread(target=i)
# threads.append(t)
# # # #记固定资产
# t1 = threading.Thread(target=runRecordFixedSpec,args=('test1',))
# t2 = threading.Thread(target=runRecordFixedSpec,args=('test2',))
# t3 = threading.Thread(target=runRecordIntangibleSpec,args=('test1',))
# t4 = threading.Thread(target=runRecordIntangibleSpec,args=('test2',))
# threads = [t1,t2,t3,t4]
#记收票
# t1 = threading.Thread(target=runRecordInputInvoiceSpec,args=('test2',))
# t2 = threading.Thread(target=runRecordOutputInvoiceSpec,args=('test2',))
# t2 = threading.Thread(target=runRecordOutputInvoiceSpec,args=('test1',))
# t3 = threading.Thread(target=runRecordOutputInvoiceSpec,args=('test2',))
# threads = [t1,t2]
for t in threads:
t.start()
# t.join()
for t in threads:
t.join()

62
test11.py Normal file
View File

@ -0,0 +1,62 @@
import threading
import time
from selenium import webdriver
# from queue import Queue
import queue
import time
import unittest
class MyTest(unittest.TestCase):
def setUp(self):
global driver
driver = webdriver.Chrome()
def tearDown(self):
driver.quit()
def test_baidu(self):
driver.get('http://www.baidu.com')
def test_bing(self):
driver.get('http://www.bing.com')
class MyThread(threading.Thread):
def __init__(self, func, args=(), name=''):
super(MyThread, self).__init__(target=func, args=args, name=name)
self.name = name
self.func = func
self.args = args
def run(self):
while True:
print('jjkjjllljjl')
if myqueue.empty() == False:
suite = myqueue.get()
self.func.run(suite)
else:
break
testcase=['test_baidu','test_bing']
myqueue = queue.Queue(maxsize = 10)
# threads = []
for i in testcase:
suite = unittest.TestSuite()
suite.addTest(MyTest(i))
myqueue.put(suite)
# t = threading.Thread(target=suite)
# threads.append(t)
def test():
runner = unittest.TextTestRunner()
n=1
for i in range(n):
t = MyThread(runner)
t.start()
if __name__ == '__main__':
test()

View File

@ -0,0 +1,155 @@
import time
import sys
import os
import logging
class AccountPage():
#元素定位器
add_accountbutton_id = 'addAccountButton'
input_accountName_id = 'input-accountName'
input_bankName_id = 'input-bankName'
input_subbranch_id = 'input-subbranch'
input_accountNumber_id = 'input-accountNumber'
input_description_id = 'input-description'
saveButton_id = 'saveButton'
# 微信账户名称元素定位
add_weixin_xpath = '//*[@id="body"]/account/gpw-account-details-modal/div/div/div/div[2]/div/tabset/ul/li[2]/a/span'
input_accountName_id_weixin = 'input-accountName3'
input_accountNumber_id_weixin = 'input-accountNumber3'
input_description_id_weixin = 'input-description3'
# 支付宝账户名称元素定位
add_zhifubao_xpath = '//*[@id="body"]/account/gpw-account-details-modal/div/div/div/div[2]/div/tabset/ul/li[3]/a/span'
input_accountName_id_zhifubao = 'input-accountName4'
input_accountNumber_id_zhifubao = 'input-accountNumber4'
input_description_id_zhifubao = 'input-description4'
def __init__(self, driver):
self.driver = driver
# 进入账户列表
def goToAccountModule(self, baseUrl):
subUrl = '/app/account'
self.driver.get(baseUrl + subUrl)
# 打开添加账户窗口
def openAddAcountPage(self):
try:
self.driver.find_element_by_id(self.add_accountbutton_id).click()
time.sleep(5)
except Exception as e:
print ('===================打开添加账户窗口失败==================')
logging.exception(e)
# 跳转到添加微信窗口
def gotoAddWeixinModule(self, parameter_list):
self.driver.find_element_by_xpath(self.add_weixin_xpath).click()
# 跳转到添加支付宝窗口
def gotoAddWeixinModule(self, parameter_list):
self.driver.find_element_by_xpath(self.add_zhifubao_xpath).click()
# 输入银行账户名称
def InputaccountName(self,InputaccountName):
input_accountName = self.driver.find_element_by_id(self.input_accountName_id)
input_accountName.send_keys(InputaccountName)
# 输入开户银行名称
def InputbankName(self, InputbankName):
input_bankName = self.driver.find_element_by_id(self.input_bankName_id)
input_bankName.send_keys(InputbankName)
# 输入支行
def Inputsubbranch(self, Inputsubbranch):
input_subbranch = self.driver.find_element_by_id(self.input_subbranch_id)
input_subbranch.send_keys(Inputsubbranch)
# 输入账号
def InputaccountNumber(self, InputaccountNumber):
input_accountNumber = self.driver.find_element_by_id(self.input_accountNumber_id)
input_accountNumber.send_keys(InputaccountNumber)
# 输入银行备注
def Inputdescription(self, Inputdescription):
input_description = self.driver.find_element_by_id(self.input_description_id)
input_description.send_keys(Inputdescription)
# 输入微信账户名称
def InputaccountNameWeixin(self, InputaccountNameWeixin):
input_accountName_weixin = self.driver.find_element_by_id(self.input_accountName_id_weixin)
input_accountName_weixin.send_keys(InputaccountNameWeixin)
# 输入微信账号
def InputaccountNumberWeixin(self, InputaccountNumberWeixin):
input_accountNumber = self.driver.find_element_by_id(self.input_accountNumber_id_weixin)
input_accountNumber.send_keys(InputaccountNumberWeixin)
# 输入微信备注
def InputdescriptionWweixin(self, InputdescriptionWeixin):
input_description = self.driver.find_element_by_id(self.input_description_id_weixin)
input_description.send_keys(InputdescriptionWeixin)
# 输入支付宝账户名称
def InputaccountNameWeixin(self, InputaccountNameZhifubao):
input_accountName_weixin = self.driver.find_element_by_id(self.input_accountName_id_zhifubao)
input_accountName_weixin.send_keys(InputaccountNameZhifubao)
# 输入支付宝账号
def InputaccountNumberWeixin(self, InputaccountNumberZhifubao):
input_accountNumber = self.driver.find_element_by_id(self.input_accountNumber_id_zhifubao)
input_accountNumber.send_keys(InputaccountNumberZhifubao)
# 输入支付宝备注
def InputdescriptionWweixin(self, InputdescriptionZhifubao):
input_description = self.driver.find_element_by_id(self.input_description_id_zhifubao)
input_description.send_keys(InputdescriptionZhifubao)
# 点击保存按钮
def SaveButton(self):
save_Button = self.driver.find_element_by_id(self.saveButton_id)
save_Button.click()
# 添加银行账户
def test_add_bank_account(self,account_data):
# self.driver.get(page_url)
self.InputaccountName(account_data[0])
self.InputbankName(account_data[1])
self.Inputsubbranch(account_data[2])
self.InputaccountNumber(account_data[3])
self.Inputdescription(account_data[4])
self.SaveButton()
# 添加微信账户
def test_add_weixin_account(self,account_data_1):
# self.driver.get(page_url)
self.InputaccountNameWeixin(account_data_1[0])
self.InputaccountNumberWeixin(account_data_1[1])
self.InputdescriptionWeixin(account_data_1[2])
self.SaveButton()
# 添加支付宝账户
def test_add_zhifubao_account(self, account_data_2):
self.InputaccountNameZhifubao(account_data_2[0])
self.InputaccountNumberZhifubao(account_data_2[1])
self.InputdescriptionZhifubao(account_data_2[2])
self.SaveButton()

View File

@ -0,0 +1,56 @@
import time
import os
import sys
from selenium import webdriver
from account_page import AccountPage
import unittest
from account_page import AccountPage
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../../'))
from test_case.login.login_page import LoginPage
from util.enter_company_util import EnterCompany
from config import *
from test_data.account_data import *
class RecordAcountSpec(unittest.TestCase):
''' 新增账户测试 '''
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.maximize_window()
# baseUrl = 'https://web-gyz-stage.guanplus.com'
# self.driver.get(baseUrl)
EnterCompany(self.driver,Environment)
account_page = AccountPage(self.driver)
account_page.goToAccountModule(BaseUrl)
account_page.openAddAcountPage()
time.sleep(3)
'''添加银行账户'''
def test_addaccount_1(self):
account_page = AccountPage(self.driver)
account_page.test_add_bank_account(account_data)
time.sleep(3)
'''添加微信账户'''
def test_addaccount_2(self):
account_page = AccountPage(self.driver)
account_page.test_add_weixin_account(account_data_1)
'''添加支付宝账户'''
def test_addaccount_3(self):
account_page = AccountPage(self.driver)
account_page.test_add_zhifubao_account(account_data_2)
def tearDown(self):
self.driver.implicitly_wait(6)
if __name__ == '__main__':
unittest.main()

View File

@ -58,6 +58,7 @@ class PositiveFlowSpec(unittest.TestCase):
print('[ERROR:初始化环境]')
self.skipTest(PositiveFlowSpec,'初始化环境失败')
logging.exception(e)
# pass
@classmethod
def tearDownClass(self):
@ -236,28 +237,24 @@ class PositiveFlowSpec(unittest.TestCase):
calljes = CallJournalEntrySearchApi()
auComAcc = [auComDataList[0],auComDataList[1],accountBookId[0]]
calljes.callJournalEntrySearchApi(auComAcc,)
# pageCount = calljes.get_pageCount()
pageCount = 3
pageCount = calljes.get_pageCount()
# pageCount = 3
journalPages = self.journalListGenerator(auComAcc,pageCount)
#读取预期的凭证数据
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '凭证.xlsx')
sh = wb.sheet_by_name(u'(一般纳税人)流水单生成凭证校验')
excelRows = sh.nrows
pageIndex = 1
pagesList = []
for page in journalPages:
startRowIndex = 20*(pageIndex - 1) + 1
endRowIndex = min((startRowIndex + 20),excelRows)
print('startRowIndex:'+ str(startRowIndex) + ' endRowIndex:' + str(endRowIndex))
for expectResult,actualResult in zip(range(startRowIndex,endRowIndex),page):
sourceRowList = sh.row_values(expectResult)
# print(sourceRowList)
# print(actualResult)
self.assertEqual(sourceRowList[0],actualResult['journalNumber'])
self.assertEqual(sourceRowList[1],actualResult['accountCode'])
self.assertEqual(sourceRowList[2],actualResult['accountName'])
self.assertEqual(sourceRowList[3],actualResult['dcDirection'])
self.assertEqual(sourceRowList[4],actualResult['amount'])
pageIndex += 1
for line in page:
pagesList.append(line)
for expectResult,actualResult in zip(range(1,sh.nrows),pagesList):
sourceRowList = sh.row_values(expectResult)
self.assertEqual(sourceRowList[0],actualResult['journalNumber'])
self.assertEqual(sourceRowList[1],actualResult['accountCode'])
self.assertEqual(sourceRowList[2],actualResult['accountName'])
self.assertEqual(sourceRowList[3],actualResult['dcDirection'])
self.assertEqual(sourceRowList[4],actualResult['amount'])
journalPages.close()
@ -268,4 +265,6 @@ class PositiveFlowSpec(unittest.TestCase):
yield CallJournalEntrySearchApi().getJournalList(auComAcc,str(n))
n += 1
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,297 @@
import unittest
import sys
import os
from selenium import webdriver
import time
import random
from HTMLTestRunner import HTMLTestRunner
from datetime import datetime
import logging
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../../'))
from util.enter_company_util import EnterCompany
from util.generate_random_util import GenerateRandom
from util.category_map_util import CategoryMap
from util.create_company_util import CreateCompay
from util.decorator_util import exit_test
from config import *
import xlrd
from openpyxl import load_workbook
from test_case.login.login_page import LoginPage
from test_case.transaction.transaction_page import TransactionPage
from test_case.invoice.invoice_page import InvoicePage
from test_case.fixedassets.fixedassets_page import FixedassetsPage
from test_case.call_api.call_account_token_api import CallAccountTokenApi
from test_case.call_api.call_accountbook_search_api import CallAccountBookSearchApi
from test_case.call_api.call_journalEntry_search_api import CallJournalEntrySearchApi
from selenium.webdriver.common.action_chains import ActionChains
from nose.plugins.plugintest import run_buffered as run
from nose.plugins.multiprocess import MultiProcess
class PositiveFlowSpec1(unittest.TestCase):
''' 业务流程测试 '''
def setUp(self):
self.driver = webdriver.Chrome()
# self.driver = webdriver.PhantomJS()
EnterCompany(self.driver,Environment)
def tearDown(self):
self.driver.quit()
# def test0(self):
# '''创建公司'''
# #创建公司->分配角色->启用期初账->进入账套
# cc = CreateCompay(self.driver)
# cc.get(BaseUrl)
# wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '创建公司.xlsx')
# loginSh = wb.sheet_by_name(u'登陆账号')
# loginRow = loginSh.row_values(1)
# roleSh = wb.sheet_by_name(u'设置角色')
# roleRow = roleSh.row_values(1)
# createCompanySh = wb.sheet_by_name(u'创建公司测试数据')
# createCompanyRow = createCompanySh.row_values(1)
# now = datetime.now()
# createCompanyRow[0]=createCompanyRow[0]+now.strftime('%m%d%H%M')
# createCompanyRow[7]=GenerateRandom().generateRandom()
# goToCompanyPara = [loginRow,createCompanyRow,roleRow]
# cc.goToCompany(goToCompanyPara)
# #创建三个账户:招商银行,羊羊羊微信,羊羊羊支付宝
# cc.goToCreateAccountPage(BaseUrl)
# accountSh = wb.sheet_by_name(u'创建账户')
# for i in range(1,accountSh.nrows):
# accountRow = accountSh.row_values(i)
# cc.createAccount(accountRow[0],accountRow[1])
# cc.goToCreateAccountPage(BaseUrl)
def test1(self):
'''记所有类别的-收入'''
transaction_page = TransactionPage(self.driver,'income')
transaction_page.goToTransactionModule(BaseUrl)
transaction_page.goToTransactionPage('记收入')
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '收支.xlsx')
sh = wb.sheet_by_name(u'记收入测试数据')
for i in range(1,sh.nrows):
sourceRowList = sh.row_values(i)
targetList = CategoryMap().incomeCategoryMapList(sourceRowList)
transaction_page.recordTransaction(targetList[:3],targetList[3:])
transaction_page.goToTransactionModule(BaseUrl)
self.assertEqual(BaseUrl + '/app/transaction/list',self.driver.current_url)
def test2(self):
'''记所有类别的-支出'''
transaction_page = TransactionPage(self.driver,'outcome')
transaction_page.goToTransactionModule(BaseUrl)
transaction_page.goToTransactionPage('记支出')
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '收支.xlsx')
sh = wb.sheet_by_name(u'记支出测试数据')
for i in range(1,sh.nrows):
sourceRowList = sh.row_values(i)
targetList = CategoryMap().outcomeCategeoryMapList(sourceRowList)
transaction_page.recordTransaction(targetList[:3],targetList[3:])
transaction_page.goToTransactionModule(BaseUrl)
self.assertEqual(BaseUrl + '/app/transaction/list',self.driver.current_url)
def test3(self):
'''记四个类型-账户互转[招商银行,现金,羊羊羊微信,羊羊羊支付宝]'''
transaction_page = TransactionPage(self.driver,'accounttransfers')
transaction_page.goToTransactionModule(BaseUrl)
transaction_page.goToTransactionPage('记账户互转')
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '收支.xlsx')
sh = wb.sheet_by_name(u'记账户互转测试数据')
for i in range(1,sh.nrows):
sourceRowList = sh.row_values(i)
transaction_page.recordTransfer(sourceRowList)
transaction_page.goToTransactionModule(BaseUrl)
self.assertEqual(BaseUrl + '/app/transaction/list',self.driver.current_url)
def test4(self):
'''记收票-专票'''
invoice_page = InvoicePage(self.driver,'input')
invoice_page.goToInvoice(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '发票.xlsx')
sh = wb.sheet_by_name(u'记收专票测试数据')
invoiceNumList = GenerateRandom().invoiceNumList(sh.nrows-1)
for i,invoiceNum in zip(range(1,sh.nrows),invoiceNumList):
sourceRowList = sh.row_values(i)
targetList = CategoryMap().inputInvoiceCategeorySpecMapList(sourceRowList)
invoice_page.recordSpecialIncomeInvoice(targetList[:3],invoiceNum,targetList[3:])
invoice_page.goToInvoiceList(BaseUrl)
self.assertEqual(BaseUrl + '/app/invoice/input-invoice',self.driver.current_url)
def test5(self):
'''记收票-普票'''
invoice_page = InvoicePage(self.driver,'input')
invoice_page.goToInvoice(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '发票.xlsx')
sh = wb.sheet_by_name(u'记收普票测试数据')
for i in range(1,sh.nrows):
sourceRowList = sh.row_values(i)
targetList = CategoryMap().inputInvoiceCategeoryCommMapList(sourceRowList)
invoice_page.recordCommonIncomeInvoice(targetList[:3],targetList[3:])
invoice_page.goToInvoiceList(BaseUrl)
self.assertEqual(BaseUrl + '/app/invoice/input-invoice',self.driver.current_url)
def test6(self):
'''记开票'''
invoice_page = InvoicePage(self.driver,'output')
invoice_page.goToInvoice(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '发票.xlsx')
sh = wb.sheet_by_name(u'记开票测试数据')
invoiceNumList = GenerateRandom().invoiceNumList(sh.nrows-1)
for i,invoiceNum in zip(range(1,sh.nrows),invoiceNumList):
sourceRowList = sh.row_values(i)
targetList = CategoryMap().outputInvoiceCategeoryMapList(sourceRowList)
invoice_page.recordOutputInvoice(targetList[:4],invoiceNum,targetList[4:])
invoice_page.goToInvoiceList(BaseUrl)
self.assertEqual(BaseUrl + '/app/invoice/output-invoice',self.driver.current_url)
def test7(self):
'''记固定资产-普票'''
fixedassets_page = FixedassetsPage(self.driver,'fixed')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '固定资产.xlsx')
sh = wb.sheet_by_name(u'记固定资产普票测试数据')
for i in range(1,sh.nrows):
sourceRowList = sh.row_values(i)
targetPara = [sourceRowList[:4],sourceRowList[4:]]
fixedassets_page.recordFixedassetsComm(targetPara)
fixedassets_page.goToFixedassetsList(BaseUrl)
self.assertEqual(BaseUrl + '/app/fixed-assets/list',self.driver.current_url)
def test8(self):
'''记固定资产-专票'''
fixedassets_page = FixedassetsPage(self.driver,'fixed')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '固定资产.xlsx')
sh = wb.sheet_by_name(u'记固定资产专票测试数据')
invoiceNumList = GenerateRandom().invoiceNumList(sh.nrows-1)
for i,invoiceNum in zip(range(1,sh.nrows),invoiceNumList):
sourceRowList = sh.row_values(i)
targetPara = [sourceRowList[:5],sourceRowList[5:]]
fixedassets_page.recordFixedassetsSpec(targetPara,invoiceNum)
fixedassets_page.goToFixedassetsList(BaseUrl)
self.assertEqual(BaseUrl + '/app/fixed-assets/list',self.driver.current_url)
def test9(self):
'''记无形资产-普票'''
fixedassets_page = FixedassetsPage(self.driver,'intangible')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '固定资产.xlsx')
sh = wb.sheet_by_name(u'记无形资产普票测试数据')
for i in range(1,sh.nrows):
sourceRowList = sh.row_values(i)
targetPara = [sourceRowList[:4],sourceRowList[4:]]
fixedassets_page.recordFixedassetsComm(targetPara)
fixedassets_page.goToFixedassetsList(BaseUrl)
self.assertEqual(BaseUrl + '/app/fixed-assets/intangible-list',self.driver.current_url)
def test10(self):
'''记无形资产-专票'''
fixedassets_page = FixedassetsPage(self.driver,'intangible')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '固定资产.xlsx')
sh = wb.sheet_by_name(u'记无形资产专票测试数据')
invoiceNumList = GenerateRandom().invoiceNumList(sh.nrows-1)
for i,invoiceNum in zip(range(1,sh.nrows),invoiceNumList):
sourceRowList = sh.row_values(i)
targetPara = [sourceRowList[:5],sourceRowList[5:]]
fixedassets_page.recordFixedassetsSpec(targetPara,invoiceNum)
fixedassets_page.goToFixedassetsList(BaseUrl)
self.assertEqual(BaseUrl + '/app/fixed-assets/intangible-list',self.driver.current_url)
def test11(self):
'''凭证校验'''
#获取Authorization和company_id
callAccountToken = CallAccountTokenApi()
auComDataList = callAccountToken.getAuthorizationComid()
#获取accountbook_id
callAccountBookSearch = CallAccountBookSearchApi()
accountBookDict = callAccountBookSearch.getAccountBook(auComDataList)
wb1 = load_workbook('写入数据.xlsx')
sheet = wb1.get_sheet_by_name('已创建的公司')
companyName = sheet['A2'].value
accountBookId = accountBookDict[companyName]
wb1.close()
#分页获取凭证列表数据
calljes = CallJournalEntrySearchApi()
auComAcc = [auComDataList[0],auComDataList[1],accountBookId[0]]
calljes.callJournalEntrySearchApi(auComAcc,)
pageCount = calljes.get_pageCount()
# pageCount = 3
journalPages = self.journalListGenerator(auComAcc,pageCount)
#读取预期的凭证数据
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '凭证.xlsx')
sh = wb.sheet_by_name(u'(一般纳税人)流水单生成凭证校验')
pagesList = []
for page in journalPages:
for line in page:
pagesList.append(line)
for expectResult,actualResult in zip(range(1,sh.nrows),pagesList):
sourceRowList = sh.row_values(expectResult)
self.assertEqual(sourceRowList[0],actualResult['journalNumber'])
self.assertEqual(sourceRowList[1],actualResult['accountCode'])
self.assertEqual(sourceRowList[2],actualResult['accountName'])
self.assertEqual(sourceRowList[3],actualResult['dcDirection'])
self.assertEqual(sourceRowList[4],actualResult['amount'])
journalPages.close()
#凭证分页生成器
def journalListGenerator(self,auComAcc,pageCount):
n = 1
while n < pageCount + 1:
yield CallJournalEntrySearchApi().getJournalList(auComAcc,str(n))
n += 1
if __name__ == '__main__':
unittest.main()
# driver = webdriver.Chrome()
# driver.maximize_window()
# p = PositiveFlowSpec(driver)
# p.test0()
# p.test1()
# user_text_id = 'usernameInput'
# pass_text_id = 'passwordInput'
# login_button_id = 'loginButton'
# # dc = {'browserName':browser}
# # driver = webdriver.Remote(command_executor=host,desired_capabilities=dc)
# driver.get('https://web-gyz-stage.guanplus.com')
# driver.find_element_by_id(user_text_id).send_keys('18514509382')
# driver.find_element_by_id(pass_text_id).send_keys('qq123456')
# driver.find_element_by_id(login_button_id).click()
# time.sleep(10)
# driver.find_element_by_link_text('羊羊羊09051855').click()
# time.sleep(10)
# startButtonLocator = 'breadcrumb'
# locatorElement = driver.find_element_by_class_name(startButtonLocator)
# # locatorElement = driver.find_element_by_xpath('//*[@id="body"]/finance/div/beginning-period/div/div[2]/div/div[1]/ol/li[2]/span')
# actions = ActionChains(driver)
# actions.move_to_element(locatorElement).perform()
# elementButton = driver.find_element_by_xpath('//*[@id="body"]/finance/div/beginning-period/div/div[3]/div[2]/div[2]/div[3]/button')
# elementButton.click()
# time.sleep(5)
# driver.quit()

View File

@ -63,7 +63,7 @@ class CallJournalEntrySearchApi(object):
checkJournalItemDict['accountCode'] = j['account']['id']
checkJournalItemDict['accountName'] = j['account']['name']
checkJournalItemDict['dcDirection'] = j['debitCreditType']
checkJournalItemDict['amount'] = str(round(int(j['amount'])))
checkJournalItemDict['amount'] = str(j['amount'])
checkJournalList.append(checkJournalItemDict)
return checkJournalList

View File

@ -7,7 +7,7 @@ class AssistantDashbaordPage(object):
def __init__(self,driver):
self.driver = driver
#进入会计首页
#进入助理首页
def goAssistanDashbaordPage(self,url):
self.driver.get(url + '/app/home-page/assist')
sleep(2)

View File

@ -15,10 +15,26 @@ from test_case.import_file.import_staff_file import ImportStaffFile
class AssistantDashbaordSPec(unittest.TestCase):
'''助理首页测试'''
@classmethod
def setUpClass(self):
self.driver = Driver
# self.driver = webdriver.Chrome()
# @classmethod
# def setUpClass(self):
# self.driver = Driver
# # self.driver = webdriver.Chrome()
# wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '创建公司.xlsx')
# loginSh = wb.sheet_by_name(u'登陆账号')
# loginData = loginSh.row_values(1)
# wb1 = load_workbook('写入数据.xlsx')
# sheet = wb1.get_sheet_by_name('已创建的公司')
# companyName = sheet['A2'].value
# loginData.append(companyName)
# EnterCompany(self.driver,[BaseUrl,loginData])
# @classmethod
# def tearDownClass(self):
# self.driver.quit()
def setUp(self):
# self.driver = Driver
self.driver = webdriver.Chrome()
self.driver.maximize_window()
wb = xlrd.open_workbook(os.path.dirname(__file__) + '/../../test_data/' + '创建公司.xlsx')
loginSh = wb.sheet_by_name(u'登陆账号')
loginData = loginSh.row_values(1)
@ -28,8 +44,7 @@ class AssistantDashbaordSPec(unittest.TestCase):
loginData.append(companyName)
EnterCompany(self.driver,[BaseUrl,loginData])
@classmethod
def tearDownClass(self):
def tearDown(self):
self.driver.quit()
def test1(self):
@ -37,7 +52,7 @@ class AssistantDashbaordSPec(unittest.TestCase):
dashboardPage = AssistantDashbaordPage(self.driver)
dashboardPage.clickImportOutputInvoiceButton()
importFile = ImportOutputInvoiceFile(self.driver)
importFile.importOutputInvoiceFile('F:\\autoTest_workspace\\python_code\\e2e-test\\test_data\\导入开票(一般纳税人).xlsx')
importFile.importOutputInvoiceFile('F:\\autoTest_workspace\\python_code\\e2e-test\\test_data\\一般纳税人开票导入.xlsx')
self.assertEqual(BaseUrl + '/app/invoice/output-invoice',self.driver.current_url)
def test2(self):

View File

Binary file not shown.

View File

@ -67,12 +67,21 @@ class FixedassetsPage(object):
self.driver.find_element_by_xpath(classifyLocator).click()
time.sleep(2)
self.driver.find_element_by_link_text(itemsPara[1]).click()
amountLocator = '//*[@id="body"]/app-assets-tab/app-'+ self.fixedassetsType +'/div/div[2]/div[3]/div/table/tbody/tr/td[3]/input'
sumLocator = '//*[@id="body"]/app-assets-tab/app-'+ self.fixedassetsType + '/div/div[2]/div[3]/div/table/tbody/tr/td[4]/bp-input/input'
remarkLocator = '//*[@id="body"]/app-assets-tab/app-'+ self.fixedassetsType +'/div/div[2]/div[3]/div/table/tbody/tr/td[5]/input'
for locator,paraValue in zip([amountLocator,sumLocator,remarkLocator],itemsPara[2:]):
self.driver.find_element_by_xpath(locator).clear()
self.driver.find_element_by_xpath(locator).send_keys(paraValue)
# amountLocator = '//*[@id="body"]/app-assets-tab/app-'+ self.fixedassetsType +'/div/div[2]/div[3]/div/table/tbody/tr/td[3]/input'
# sumLocator = '//*[@id="body"]/app-assets-tab/app-'+ self.fixedassetsType + '/div/div[2]/div[3]/div/table/tbody/tr/td[4]/bp-input/input'
# remarkLocator = '//*[@id="body"]/app-assets-tab/app-'+ self.fixedassetsType +'/div/div[2]/div[3]/div/table/tbody/tr/td[5]/input'
# for locator,paraValue in zip([amountLocator,sumLocator,remarkLocator],itemsPara[2:]):
# self.driver.find_element_by_xpath(locator).clear()
# self.driver.find_element_by_xpath(locator).send_keys(paraValue)
amountElement = self.driver.find_element_by_class_name('input-amount').find_element_by_tag_name('input')
amountElement.clear()
amountElement.send_keys(itemsPara[2])
sumElements = self.driver.find_element_by_class_name("max-input-amount").find_element_by_tag_name('ng2-numeric-input').find_elements_by_tag_name('input')
sumElements[0].click()
sumElements[1].send_keys(itemsPara[3])
remarkElement = self.driver.find_element_by_class_name('input-amount').find_element_by_xpath('..').find_element_by_class_name('operation').find_element_by_tag_name('input')
remarkElement.clear()
remarkElement.send_keys(itemsPara[4])
#点击保存并新增按钮
def clickSaveAndAdd(self):

View File

@ -11,16 +11,29 @@ from util.enter_company_util import EnterCompany
from config import *
from util.category_map_util import CategoryMap
import xlrd
import threading
class RecordFixedSpec(unittest.TestCase):
''' 记固定资产测试 '''
def setUp(self):
# def setUp(self):
# # self.driver = webdriver.Chrome()
# self.driver = Driver
# EnterCompany(self.driver,Environment)
# fixedassets_page = FixedassetsPage(self.driver,'fixed')
# fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
@classmethod
def setUpClass(self):
# self.driver = Driver
self.driver = webdriver.Chrome()
EnterCompany(self.driver,Environment)
fixedassets_page = FixedassetsPage(self.driver,'fixed')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
@classmethod
def tearDownClass(self):
self.driver.quit()
def test1(self):
'''成功记录多笔固定资产-普票记录测试'''
@ -37,8 +50,9 @@ class RecordFixedSpec(unittest.TestCase):
def test2(self):
'''成功记录多笔固定资产-专票记录测试'''
fixedassets_page = FixedassetsPage(self.driver,'fixed')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
invoiceNumList = []
for i in range(0,10):
invoiceNumList.append(self.invoiceNum())
@ -60,9 +74,11 @@ class RecordFixedSpec(unittest.TestCase):
invoiceNum = invoiceNum + str(random.randint(0,9))
return invoiceNum
def tearDown(self):
self.driver.quit()
# def tearDown(self):
# self.driver.quit()
# print('end!!!!!!!!!!!!!!!')
if __name__ == '__main__':
unittest.main()

View File

@ -17,7 +17,17 @@ class RecordIntangibleSpec(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
# self.driver = Driver
EnterCompany(self.driver,Environment)
# user_text_id = 'usernameInput'
# pass_text_id = 'passwordInput'
# login_button_id = 'loginButton'
# self.driver.get('https://web-gyz-stage.guanplus.com')
# self.driver.find_element_by_id(user_text_id).send_keys('18514509382')
# self.driver.find_element_by_id(pass_text_id).send_keys('qq123456')
# self.driver.find_element_by_id(login_button_id).click()
# time.sleep(10)
# self.driver.find_element_by_link_text('多数据多账期0904').click()
fixedassets_page = FixedassetsPage(self.driver,'intangible')
fixedassets_page.goToRecordFixedassetsPage(BaseUrl)
@ -62,6 +72,7 @@ class RecordIntangibleSpec(unittest.TestCase):
def tearDown(self):
self.driver.quit()
# self.driver.close()
if __name__ == '__main__':

View File

@ -5,6 +5,7 @@ import os
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
# sys.path.append('F:\\autoTest_workspace\\python_code\\e2e-test\\test_case\\login')
# from login_page import LoginPage
@ -59,9 +60,13 @@ class ImportBankBillFile(object):
tableLocator = '//*[@id="body"]/setting/gpw-multi-sync/div[2]/div/div'
saveButtonLocator = '//*[@id="body"]/setting/gpw-multi-sync/div[2]/div/div/div/button[1]'
tableElementsList = self.driver.find_element_by_xpath(tableLocator).find_elements_by_tag_name('table')
mappingHeadElement = self.driver.find_element_by_class_name('title')
actions = ActionChains(self.driver)
actions.move_to_element(mappingHeadElement).perform()
for tableElement in tableElementsList:
tbodyTrsList = tableElement.find_element_by_tag_name('tbody').find_elements_by_tag_name('tr')
tdList = tbodyTrsList[1].find_elements_by_tag_name('td')
# tdList[3].find_element_by_tag_name('span').click()
tdList[3].click()
sleep(1)
self.setCategory(tdList[3])

View File

@ -20,8 +20,6 @@ class ImportOutputInvoiceFile(object):
alertLocator = '//*[@id="body"]/invoice/import-output-invoice/div[1]/div[1]/alert/div'
self.driver.find_element_by_id(self.importInputId).send_keys(file)
sleep(20)
alertInfo = self.driver.switch_to_alert().text
print('alertInfo:' + alertInfo)
# try:
# if '导入的文件不符合当前模板' == self.driver.find_element_by_xpath(alertLocator).text:
# print('[error: 导入的文件不符合当前模板]')

View File

@ -124,17 +124,19 @@ class InvoicePage(object):
def setRemark(self,remark=None):
if 'input' == self.invoiceType:
if '普票' == invoiceClassfiy:
remarkXpath = '//*[@id="body"]/tab/new-'+ self.invoiceType +'-invoice/div/div[2]/ul/table/tbody/tr[1]/td[5]/input'
remarkElement = self.driver.find_element_by_class_name("content-body ").find_element_by_tag_name('table').find_element_by_tag_name('tbody').find_elements_by_tag_name('tr')[0].find_elements_by_tag_name('td')[4].find_element_by_tag_name('input')
elif '专票' == invoiceClassfiy:
remarkXpath = '//*[@id="body"]/tab/new-'+ self.invoiceType +'-invoice/div/div[2]/ul/table/tbody/tr[1]/td[6]/input'
remarkElement = self.driver.find_element_by_class_name("content-body ").find_element_by_tag_name('table').find_element_by_tag_name('tbody').find_elements_by_tag_name('tr')[0].find_elements_by_tag_name('td')[5].find_element_by_tag_name('input')
else:
print('====================================发票类别【invoiceClassfiy】设置错误==============================================')
elif 'output' == self.invoiceType:
remarkXpath = '//*[@id="body"]/tab/new-'+ self.invoiceType +'-invoice/div/div[2]/ul/table/tbody/tr[1]/td[5]/input'
remarkElement = self.driver.find_element_by_class_name("content-body ").find_element_by_tag_name('table').find_element_by_tag_name('tbody').find_elements_by_tag_name('tr')[0].find_elements_by_tag_name('td')[4].find_element_by_tag_name('input')
else:
print('=============================================发票类别【invoiceType】设置错误============================================================')
self.driver.find_element_by_xpath(remarkXpath).clear()
self.driver.find_element_by_xpath(remarkXpath).send_keys(remark)
# self.driver.find_element_by_xpath(remarkElement).clear()
# self.driver.find_element_by_xpath(remarkElement).send_keys(remark)
remarkElement.clear()
remarkElement.send_keys(remark)
#点击保存按钮
def clickSaveButton(self):
@ -158,8 +160,13 @@ class InvoicePage(object):
#普票-设置收票的记账日期,发票类型,对方信息 publicInvoice 是一个list,[记账日期,发票类型,对方信息]
def setCommonPublicInvoice(self,commonPublicInvoice):
date_button_xpath = '//*[@id="datePiker"]/span/span[2]'
SetDate(self.driver,date_button_xpath,commonPublicInvoice[0])
# date_button_xpath = '//*[@id="datePiker"]/span/span[2]'
# SetDate(self.driver,date_button_xpath,commonPublicInvoice[0])
dateButtonLocator = self.driver.find_elements_by_class_name("col-md-3")[0].find_element_by_tag_name('p-calendar')
dateButtonLocator.click()
time.sleep(2)
self.driver.find_element_by_link_text(commonPublicInvoice[0]).click()
time.sleep(2)
self.setInvoiceType(commonPublicInvoice[1])
self.setOtherInfo(commonPublicInvoice[2])
@ -180,8 +187,13 @@ class InvoicePage(object):
#专票-设置收票的记账日期,发票类型,对方信息,发票号码 publicInvoice 是一个list,[记账日期,发票类型,对方信息,发票号码]
def setSpecialPublicInvoice(self,publicInvoice,invoiceNum):
date_button_xpath = '//*[@id="datePiker"]/span/span[2]'
SetDate(self.driver,date_button_xpath,publicInvoice[0])
# date_button_xpath = '//*[@id="datePiker"]/span/span[2]'
# SetDate(self.driver,date_button_xpath,publicInvoice[0])
dateButtonLocator = self.driver.find_elements_by_class_name("col-md-3")[0].find_element_by_tag_name('p-calendar')
dateButtonLocator.click()
time.sleep(2)
self.driver.find_element_by_link_text(publicInvoice[0]).click()
time.sleep(2)
self.setInvoiceType(publicInvoice[1])
self.setOtherInfo(publicInvoice[2])
self.setInvoiceNum(invoiceNum)
@ -194,7 +206,12 @@ class InvoicePage(object):
#设置开票-记账日期,发票类别,发票状态,对方信息,发票号码 outputPublic [记账日期,发票类别,发票状态,对方信息] outputInvoiceNum 发票号码
def setOutputInvoicePublic(self,outputPublic,outputInvoiceNum):
SetDate(self.driver,'//*[@id="datePiker"]/span/span[2]',outputPublic[0])
# SetDate(self.driver,'//*[@id="datePiker"]/span/span[2]',outputPublic[0])
dateButtonLocator = self.driver.find_elements_by_class_name("col-md-3")[0].find_element_by_tag_name('p-calendar')
dateButtonLocator.click()
time.sleep(2)
self.driver.find_element_by_link_text(outputPublic[0]).click()
time.sleep(2)
self.setInvoiceType(outputPublic[1])
self.setInvoiceStatus(outputPublic[2])
self.setOtherInfo(outputPublic[3])

View File

@ -18,8 +18,8 @@ class RecordInputInvoiceSpec(unittest.TestCase):
''' 记收票测试 '''
def setUp(self):
# self.driver = webdriver.Chrome()
self.driver = Driver
self.driver = webdriver.Chrome()
# self.driver = Driver
EnterCompany(self.driver,Environment)
invoice_page = InvoicePage(self.driver,'input')
invoice_page.goToInvoice(BaseUrl)

View File

@ -17,7 +17,8 @@ class RecordOutputInvoiceSpec(unittest.TestCase):
''' 记开票测试 '''
def setUp(self):
self.driver = webdriver.Chrome()
# self.driver = webdriver.Chrome()
self.driver = Driver
EnterCompany(self.driver,Environment)
invoice_page = InvoicePage(self.driver,'output')
invoice_page.goToInvoice(BaseUrl)

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
# element location
# 用户名 input id
username_elem = 'usernameInput'
# 密码 input id
password_elem = 'passwordInput'
# 登录按钮 id
login_btn_elem = 'loginButton'
# 个人信息名 xpath
personal_name_elem = '//*[@id="personalInfoDropdownMenu"]/span'

View File

@ -1,44 +1,46 @@
import time
from .login_elem import *
# 更新于2017-09-06
class LoginPage(object):
# login -> 无用的注释
# element location
user_text_id = 'usernameInput'
pass_text_id = 'passwordInput'
login_button_id = 'loginButton'
def __init__(self,url,driver):
def __init__(self, url, driver):
self.url = url
self.driver = driver
def login(self,account):
#open url
self.driver.get(self.url)
#locate username
username_text = self.driver.find_element_by_id(self.user_text_id)
#clear username text
# 输入用户名
def type_username(self, username):
username_text = self.driver.find_element_by_id(username_elem)
username_text.clear()
#input username
username_text.send_keys(account[0])
#locate password
password_text = self.driver.find_element_by_id(self.pass_text_id)
#clear password
username_text.send_keys(username)
# 输入密码
def type_password(self, password):
password_text = self.driver.find_element_by_id(password_elem)
password_text.clear()
#input password
password_text.send_keys(account[1])
#locate login button
login_button = self.driver.find_element_by_id(self.login_button_id)
#click login button
password_text.send_keys(password)
# 点击登录
def click_login_btn(self):
login_button = self.driver.find_element_by_id(login_btn_elem)
login_button.click()
#delay
time.sleep(20)
# if self.driver.current_url == self.url + '/app/home-page/accounting':
# print('Accountant login success !')
# elif self.driver.current_url == self.url + '/app/home-page/assist':
# print('Assist login success !')
# else:
# print('login failed !')
# 个人信息名称
def personal_name_show(self):
personal_name = self.driver.find_element_by_xpath(personal_name_elem)
return personal_name.text
# 登陆成功用户名展示
# login_data:username,password
def login(self,login_data):
print('aaa=>',self.driver)
self.driver.delete_cookie('OAUTH_TOKEN')
self.driver.get(self.url)
self.type_username(login_data[0])
self.type_password(login_data[1])
self.click_login_btn()
time.sleep(5)

View File

@ -3,23 +3,80 @@ import os
import unittest
import time
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
from login_page import LoginPage
from .login_page import LoginPage
from util.jsonToPython_util import JsonToPython
from selenium import webdriver
from test_data.cai.login_data import *
from comp_info import CompInfo
from util.alert_page import AlertPage
from util.danger_page import DangerPage
class LoginTest(unittest.TestCase):
class LoginSpec(unittest.TestCase):
def setUp(self):
self.url = 'https://web-gyz-stage.guanplus.com'
# self.driver = webdriver.Chrome()
self.driver = webdriver.PhantomJS()
self.driver.implicitly_wait(6)
self.driver.implicitly_wait(30)
def test_login(self):
loginPage = LoginPage(self.url, self.driver)
loginPage.login(['18514509382','qq123456'])
self.assertEqual("杨春红",self.driver.find_element_by_xpath('//*[@id="personalInfoDropdownMenu"]/span').text)
def test_verify_login(self):
"""登录管有帐"""
loginpage = LoginPage(CompInfo.BASE_URL, self.driver)
loginpage.login(VERIFY_LOGIN)
current_url = self.driver.current_url
self.assertIn('/app/company-list', current_url)
print('登录成功!')
def test_unexit_username(self):
""" 用户不存在 """
loginpage = LoginPage(CompInfo.BASE_URL, self.driver)
loginpage.login(UNEXIT_USERNAME)
alertpage = AlertPage(self.driver)
alert_msg = alertpage.get_alert_msg()
self.assertEqual(alert_msg, '此用户不存在')
def test_wrong_password(self):
""" 密码不正确 """
loginpage = LoginPage(CompInfo.BASE_URL, self.driver)
loginpage.login(WRONG_PASSWORD)
alertpage = AlertPage(self.driver)
alert_msg = alertpage.get_alert_msg()
self.assertEqual(alert_msg, '密码不正确')
def test_empty_username(self):
""" 用户名为空 """
loginpage = LoginPage(CompInfo.BASE_URL, self.driver)
loginpage.login(EMPTY_USERNAME)
dangerpage = DangerPage(self.driver)
danger_msg = dangerpage.get_text_danger_msg()
self.assertEqual(danger_msg, '请填写手机')
def test_empty_password(self):
""" 密码为空 """
loginpage = LoginPage(CompInfo.BASE_URL, self.driver)
loginpage.login(EMPTY_PASSWORD)
dangerpage = DangerPage(self.driver)
danger_msg = dangerpage.get_text_danger_msg()
self.assertEqual(danger_msg, '请填写密码')
def test_typeerror_username(self):
""" 手机格式不正确 """
loginpage = LoginPage(CompInfo.BASE_URL, self.driver)
loginpage.login(TYPEERROR_USERNAME)
dangerpage = DangerPage(self.driver)
danger_msg = dangerpage.get_text_danger_msg()
self.assertEqual(danger_msg, '手机格式不正确')
def tearDown(self):
self.driver.quit()

View File

@ -0,0 +1,31 @@
# element loc
# 编辑
edit_xpath = '//*[@id="body"]/setting/div[2]/div/gpw-company-billing/div/div/span[2]/a'
# 公司名称
comp_name_name = 'name'
comp_name_text_id = 'companyName'
# 法定代表人
legal_person_name_name = 'legalPersonName'
# 注册资本
registered_capital_name = 'registeredCapital'
# 省 下拉
priv_dropdown_name = 'province'
# 市 下拉
city_dropdown_name = 'city'
# 区 下拉
dist_dropdown_name = 'district'
# 详细地址
addr_input_name = 'address'
# 成立日期calender
begin_date_calen_xpath = '//*[@id="form"]/div[5]/div/p-calendar'
begin_date_dele_xpath = '//*[@id="form"]/div[5]/div[1]/p-calendar/span/span[1]'
# 纳税人识别号
tax_number_name = 'taxNumber'
# 行业dropdown
industry_dropdown_name = 'industry'
# 服务截止日期
service_deadline_xpath = '//*[@id="form"]/div[10]/div/p-calendar/span/span[2]'
# 保存按钮
save_css = '.btn-primary'
# 取消按钮
cancel_css = '.btn-secondar'

View File

@ -0,0 +1,204 @@
from selenium import webdriver
import time
from util.public_page import PublicPage
from .comp_billing_elem import *
# 帐套信息
# 创建于20170801
# caicai
class CompBillingPage:
def __init__(self, driver):
# self.driver = webdriver.Chrome()
self.driver = driver
# 点击编辑
def click_edit(self):
try:
publicPage = PublicPage(self.driver)
edit_loc = self.driver.find_element_by_xpath(edit_xpath)
publicPage.click_elem(edit_loc)
except expression as e:
print(
'[CompBillingPage] There was an exception when click_edit= %s', str(e))
# 设置公司名
def set_comp_name(self, comp_name):
try:
publicPage = PublicPage(self.driver)
comp_name_loc = self.driver.find_element_by_name(comp_name_name)
publicPage.set_value(comp_name_loc, comp_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when set_comp_name- %s', str(e))
# 获取公司名
def get_comp_name(self):
try:
publicPage = PublicPage(self.driver)
comp_name_loc = self.driver.find_element_by_id(comp_name_text_id)
publicPage.get_value(comp_name_loc)
except expression as e:
print(
'[CompBillingPage] There was an exception when get_comp_name= %s', str(e))
# 法定代表人
def set_legal_person_name(self, legal_person_name):
try:
publicPage = PublicPage(self.driver)
legal_person_name_loc = self.driver.find_element_by_name(
legal_person_name_name)
publicPage.set_value(legal_person_name_loc, legal_person_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when set_legal_person_name= %s', str(e))
# 注册资本
def set_registered_capital(self, registered_num):
try:
publicPage = PublicPage(self.driver)
registered_capital_loc = self.driver.find_element_by_name(
registered_capital_name)
publicPage.set_value(registered_capital_loc, registered_num)
except expression as e:
print(
'[CompBillingPage] There was an exception when set_registered_capital= %s', str(e))
# 省份
def select_prov(self, prov_name):
try:
publicPage = PublicPage(self.driver)
drop_loc = self.driver.find_element_by_name(priv_dropdown_name)
publicPage.select_dropdown_item(drop_loc, prov_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when select_prov= %s', str(e))
def select_city(self, city_name):
try:
publicPage = PublicPage(self.driver)
drop_loc = self.driver.find_element_by_name(city_dropdown_name)
publicPage.select_dropdown_item(drop_loc, city_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when select_city= %s', str(e))
# 区
def select_distr(self, distr_name):
try:
publicPage = PublicPage(self.driver)
drop_loc = self.driver.find_element_by_name(dist_dropdown_name)
publicPage.select_dropdown_item(drop_loc, distr_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when select_distr= %s', str(e))
# 详细地址
def set_address(self, address_name):
try:
publicPage = PublicPage(self.driver)
address_name_loc = self.driver.find_element_by_name(
addr_input_name)
publicPage.set_value(address_name_loc, address_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when set_address= %s', str(e))
# 成立日期
def select_begin_date(self, day):
try:
publicPage = PublicPage(self.driver)
publicPage.select_date(begin_date_calen_xpath, day)
time.sleep(1)
except Exception as e:
logging.error('there was an exception %s', str(e))
# 删除成立日期
def dele_begin_date(self):
try:
publicPage = PublicPage(self.driver)
date_loc = self.driver.find_element_by_xpath(begin_date_dele_xpath)
publicPage.click_elem(date_loc)
except Exception as e:
print(
'[CompBillingPage] There was an exception when dele_begin_date= %s', str(e))
# 纳税人识别号
def set_tax_num(self, num):
try:
publicPage = PublicPage(self.driver)
tax_num_loc = self.driver.find_element_by_name(tax_number_name)
publicPage.set_value(tax_num_loc, num)
except expression as e:
print(
'[CompBillingPage] There was an exception when set_tax_num= %s', str(e))
# 行业
def select_industry(self, indus_name):
try:
publicPage = PublicPage(self.driver)
indust_loc = self.driver.find_element_by_name(
industry_dropdown_name)
publicPage.select_dropdown_item(indust_loc, indus_name)
except expression as e:
print(
'[CompBillingPage] There was an exception when select_industry= %s', str(e))
# 服务截止日期
def select_service_deadline(self, day):
try:
publicPage = PublicPage(self.driver)
publicPage.select_date(service_deadline_xpath, day)
time.sleep(1)
except Exception as e:
print(
'[CompBillingPage] There was an exception when select_service_deadline= %s', str(e))
# 保存
def save(self):
try:
publicPage = PublicPage(self.driver)
save_button = self.driver.find_element_by_css_selector(
self.save_css)
publicPage.clic
except Exception as e:
print('[CompBillingPage] There was an exception when save= %s', str(e))
# 取消
def cancel(self):
try:
publicPage = PublicPage(self.driver)
cancel_button = self.driver.find_element_by_css_selector(
self.cancel_css)
publicPage.scroll_to_elem(cancel_button)
return cancel_button.click()
except Exception as e:
print('[CompBillingPage] There was an exception when cancel= %s', str(e))
# 修改公司信息
def modify_comp_info(self, comp_info):
self.click_edit()
time.sleep(2)
self.set_comp_name(comp_info[0])
self.set_legal_person_name(comp_info[1])
self.set_registered_capital(comp_info[2])
self.select_prov(comp_info[3])
self.select_city(comp_info[4])
self.select_distr(comp_info[5])
self.set_address(comp_info[6])
self.select_begin_date(comp_info[7])
self.set_tax_num(comp_info[8])
self.select_industry(comp_info[9])
self.select_service_deadline(comp_info[10])
self.save()
time.sleep(2)

View File

@ -0,0 +1,35 @@
from selenium import webdriver
import unittest
import time
import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
from .util.enter_company_util import EnterCompany
from comp_info import CompInfo
from .util.public_page import PublicPage
from util.alert_page import AlertPage
from test_data.cai.comp_billing_data import CompBillingData
# 帐套信息
# 于2017-09-06-三
# caicai
class CompBillingSpec(unittest.TestCase):
# 进入公司
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.implicitly_wait(30)
self.driver.maximize_window()
enterCompany = EnterCompany(CompInfo.BASE_URL,self.driver)
enterCompany.enter_comp(CompInfo.ENTER_COMP_INFO_YB)
def test_edit_comp_info(self):
""" 编辑帐套信息测试"""
publicPage = PublicPage(self.driver)
alertPage = AlertPage(self.driver)
page = CompBillingPage(self.driver)
page.modify_comp_info(CompBillingData.MODIFY_COMP_INFO)
alertPage.get_alert_msg()
comp_name = page.get_comp_name()
self.assertEqual(comp_name, CompBillingData.MODIFY_COMP_INFO[0])

View File

@ -0,0 +1,24 @@
# element loc
# 页面url
# 帐套信息url
comp_billing_url = '/app/setting/company-billing'
# 往来明细url
contact_url = '/app/setting/contact'
# 用户管理url
mutil_user_url = '/app/setting/multi-user'
# 股东设置url
partner_set_url = '/app/setting/partner-set'
# 税率设置url
tax_rate_url = '/app/setting/tax-rate'
# --页面元素
# 帐套信息页面标记xpath
comp_billing_xpath = '//*[@id="body"]/setting/div[2]/div/gpw-company-billing/div/div/span[1]'
# 往来页面标记xpath
contact_xpath = '//*[@id="addContactButton"]'
# 用户管理页面xpath
multi_user_xpath = '//*[@id="body"]/setting/div[2]/div/gpw-multi-user/div/table/thead/tr/th[4]'
# 股东设置页面标记 xpath
partner_set_xpath = '//*[@id="body"]/setting/div[2]/div/app-partner-set/div[1]/div/button'
# 税率设置页面标记 xpath
tax_rate_xpath = '//*[@id="taxRatePage"]/span'

View File

@ -0,0 +1,68 @@
import time
from util.public_page import PublicPage
from .setting_elem import *
# 设置page
# 创建于2017-8
# caicai
class SettingPage(object):
def __init__(self,driver):
self.driver = driver
# 去帐套信息页面(管理员角色)
def go_to_setting_page(self, base_url):
try:
publicPage = PublicPage(self.driver)
self.driver.get(base_url + comp_billing_url)
time.sleep(3)
comp_billing_loc = self.driver.find_element_by_xpath(comp_billing_xpath)
publicPage.is_element_present(comp_billing_loc)
except Exception as e:
print('[SettingPage] There was an exception when go_to_setting_page= %s',str(e))
# 去往来信息页面
def go_to_contact_page(self, base_url):
try:
publicPage = PublicPage(self.driver)
self.driver.get(base_url + contact_url)
time.sleep(3)
add_loc = self.driver.find_element_by_xpath(contact_xpath)
publicPage.is_element_present(add_loc)
except Exception as e:
print('[SettingPage] There was an exception when go_to_contact_page= %s',str(e))
# 去用户管理页面
def go_to_mutil_user_page(self, base_url):
try:
publicPage = PublicPage(self.driver)
self.driver.get(base_url + mutil_user_url)
time.sleep(3)
start_loc = self.driver.find_element_by_xpath(multi_user_xpath)
publicPage.is_element_present(start_loc)
except Exception as e:
print('[SettingPage] There was an exception when go_to_mutil_user_page= %s',str(e))
# 去股东页面
def go_to_partner_set_page(self, base_url):
try:
publicPage = PublicPage(self.driver)
self.driver.get(base_url + partner_set_url)
time.sleep(3)
add_loc = self.driver.find_element_by_xpath(partner_set_url)
publicPage.is_element_present(start_loc)
except Exception as e:
print('[SettingPage] There was an exception when go_to_partner_set_page= %s',str(e))
# 去税率设置页面
def go_to_tax_rate_page(self, base_url):
try:
publicPage = PublicPage(self.driver)
self.driver.get(base_url + tax_rate_url)
time.sleep(3)
tax_loc = self.driver.find_element_by_xpath(tax_rate_url)
publicPage.is_element_present(tax_loc)
except Exception as e:
print('[SettingPage] There was an exception when go_to_tax_rete_page= %s',str(e))

View File

@ -0,0 +1,71 @@
from selenium import webdriver
import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
import unittest
from util.enter_comp_page import EnterCompPage
from .setting_page import SettingPage
from .setting_elem import *
from comp_info import CompInfo
# 设置页面
# 创建于2017-09-06-三
# caicai
class SettingSpec(unittest.TestCase):
'''
设置页面测试用例
'''
def setUp(self):
# self.driver = webdriver.Chrome()
self.driver = webdriver.PhantomJS()
self.driver.implicitly_wait(30)
enterCompPage = EnterCompPage(CompInfo.BASE_URL,self.driver)
enterCompPage.enter_comp(CompInfo.ENTER_COMP_INFO_YB)
# url跳转测试
def test_go_to_comp_billing_page(self):
"""测试-去帐套信息页面"""
page = SettingPage(self.driver)
page.go_to_setting_page(CompInfo.BASE_URL)
current_url = self.driver.current_url
self.assertIn(comp_billing_url,current_url)
def test_go_to_contact_page(self):
"""测试-去往来信息页面"""
page = SettingPage(self.driver)
page.go_to_contact_page(CompInfo.BASE_URL)
current_url = self.driver.current_url
self.assertIn(contact_url,current_url)
def test_go_to_mutil_user_page(self):
"""测试-去用户管理页面"""
page = SettingPage(self.driver)
page.go_to_mutil_user_page(CompInfo.BASE_URL)
current_url = self.driver.current_url
self.assertIn(mutil_user_url,current_url)
def test_go_to_partner_set_page(self):
"""测试-去股东页面"""
page = SettingPage(self.driver)
page.go_to_partner_set_page(CompInfo.BASE_URL)
current_url = self.driver.current_url
self.assertIn(partner_set_url,current_url)
def test_go_to_tax_rate_page(self):
"""测试-去股东页面"""
page = SettingPage(self.driver)
page.go_to_tax_rate_page(CompInfo.BASE_URL)
current_url = self.driver.current_url
self.assertIn(tax_rate_url,current_url)
# tab 切换测试
def tearDown(self):
self.driver.quit()
if __name__ == '_main_':
unittest.main()

View File

@ -21,7 +21,7 @@ class RecordIncomeSpec(unittest.TestCase):
def setUp(self):
# self.driver = webdriver.Chrome()
self.driver = webdriver.PhantomJS()
self.driver = Driver
EnterCompany(self.driver,Environment)
transaction_page = TransactionPage(self.driver,'income')
transaction_page.goToTransactionModule(BaseUrl)

View File

@ -125,8 +125,14 @@ class TransactionPage:
#设置收支的记账日期,交易账户,对方信息 publicTransaction 是一个list,[记账日期,交易账户,对方信息]
def setPublicTransaction(self,publicTransaction):
date_button_xpath = '//*[@id="body"]/detail/'+ self.transactionType +'/div/div[2]/form/div[1]/div/p-calendar/span/span[2]'
SetDate(self.driver,date_button_xpath,publicTransaction[0])
# date_button_xpath = '//*[@id="body"]/detail/'+ self.transactionType +'/div/div[2]/form/div[1]/div/p-calendar/span/span[2]'
# date_button_xpath = '//*[@id="body"]/detail/'+ self.transactionType +'/div/div[2]/form/div[1]/div/p-calendar/span/span'
# SetDate(self.driver,date_button_xpath,publicTransaction[0])
dateButtonElement = self.driver.find_elements_by_class_name('col-sm-3')[0].find_element_by_tag_name('p-calendar')
dateButtonElement.click()
time.sleep(2)
self.driver.find_element_by_link_text(publicTransaction[0]).click()
time.sleep(2)
self.setAccount(publicTransaction[1])
self.setOtherInfo(publicTransaction[2])
@ -184,8 +190,14 @@ class TransactionPage:
#记账户互转-点击保存并新增 transferPara [记账日期,转出账户,转入账户,金额,备注]
def recordTransfer(self,transferPara):
dateButtonXPath = '//*[@id="body"]/detail/accounttransfers/div/div[2]/div/form/div[1]/p-calendar/span/span[2]'
SetDate(self.driver,dateButtonXPath,transferPara[0])
# dateButtonXPath = '//*[@id="body"]/detail/accounttransfers/div/div[2]/div/form/div[1]/p-calendar/span/span[2]'
dataButtonLocator = 'col-xs-12'
dateButtonElement = self.driver.find_element_by_class_name(dataButtonLocator).find_element_by_tag_name('form').find_elements_by_tag_name('div')[0].find_element_by_tag_name('p-calendar')
dateButtonElement.click()
time.sleep(2)
self.driver.find_element_by_link_text(transferPara[0]).click()
time.sleep(2)
# SetDate(self.driver,dateButtonXPath,transferPara[0])
self.setFundFlow(transferPara[1],transferPara[2])
self.setTransferMoney(transferPara[3])
self.setTransferRemark(transferPara[4])

Binary file not shown.

21
test_data/account_data.py Normal file
View File

@ -0,0 +1,21 @@
# url = 'https://web-gyz-stage.guanplus.com/app/account'
InputaccountName = '测试-招商银行'
InputbankName = '招商银行'
Inputsubbranch = '三元桥'
InputaccountNumber = '6666123441234'
Inputdescription = '备注'
InputaccountNameWeixin = '微信1'
InputaccountNumberWeixin = '15636017838'
InputdescriptionWeixin = '微信备注'
InputaccountNameZhifubao = '支付宝1'
InputaccountNumberZhifubao ='15636017838'
InputdescriptionZhifubao = '支付宝备注'
account_data = [InputaccountName, InputbankName, Inputsubbranch, InputaccountNumber, Inputdescription]
account_data_1 = [InputaccountNameWeixin, InputaccountNumberWeixin, InputdescriptionWeixin]
account_data_2 = [InputaccountNameZhifubao, InputaccountNumberZhifubao, InputdescriptionZhifubao]

Binary file not shown.

View File

@ -0,0 +1,20 @@
class CompBillingData(object):
COMP_NAME = ['auto_test1', 'auto_test']
LEGAL_PERSON_NAME = ['caicai', 'huangcaiyan']
REGISTERED_CAPITAL = ['10000.0001', '1234.5678']
PROV_NAME = ['北京市', '江西省']
CITY_NAME = ['市辖区', '赣州市']
DISTR_NAME = ['海淀区', '寻乌县']
ADDRESS = ['方圆大厦', '寻乌中学']
BEGIN_DATE = ['1', '15']
TAX_NUM = ['concordya123', '3424232433']
INDUST_NAME = ['其他', '批发、零售']
END_DATE = ['30', '25']
MODIFY_COMP_INFO = [COMP_NAME[0], LEGAL_PERSON_NAME[0], REGISTERED_CAPITAL[0],
PROV_NAME[0], CITY_NAME[0], DISTR_NAME[0], ADDRESS[0], BEGIN_DATE[0], TAX_NUM[0], INDUST_NAME[0], END_DATE[0]]
RESET_COMP_INFO = [COMP_NAME[1], LEGAL_PERSON_NAME[1], REGISTERED_CAPITAL[1],
PROV_NAME[1], CITY_NAME[1], DISTR_NAME[1], ADDRESS[1], BEGIN_DATE[1], TAX_NUM[1], INDUST_NAME[1], END_DATE[1]]

View File

@ -0,0 +1,34 @@
category_index = [0, 1]
input_invoice_general_data = [
'普票',
'(个)其他',
category_index,
'销售部门',
'1.5%',
'123',
'普票其他劳务费1.5%'
]
output_invoice_data = [
'普票',
'税控自开',
'(个)内部代表',
'00000010',
[0, 0],
'管理部门',
'17%',
'234',
'普票内部代表商品销售17%'
]
input_invoice_special_data = [
'专票',
'(个)其他',
'00000020',
[0, 0],
'管理部门',
'5%',
'其他',
'345',
'专票其他福利费5%'
]

View File

@ -0,0 +1,14 @@
# 正确登录
VERIFY_LOGIN=['13683139989','qq123456']
# 用户不存在
UNEXIT_USERNAME = ['13683139980','qq123456']
# 密码不正确
WRONG_PASSWORD = ['13683139989','qq1234567']
# 用户名为空
EMPTY_USERNAME = ['','QQ123456']
# 密码为空
EMPTY_PASSWORD = ['13683139989','']
# 手机格式不正确
TYPEERROR_USERNAME = ['123','qq123456']

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,20 @@
class CompBillingData(object):
COMP_NAME = ['auto_test1', 'auto_test']
LEGAL_PERSON_NAME = ['caicai', 'huangcaiyan']
REGISTERED_CAPITAL = ['10000.0001', '1234.5678']
PROV_NAME = ['北京市', '江西省']
CITY_NAME = ['市辖区', '赣州市']
DISTR_NAME = ['海淀区', '寻乌县']
ADDRESS = ['方圆大厦', '寻乌中学']
BEGIN_DATE = ['1', '15']
TAX_NUM = ['concordya123', '3424232433']
INDUST_NAME = ['其他', '批发、零售']
END_DATE = ['30', '25']
MODIFY_COMP_INFO = [COMP_NAME[0], LEGAL_PERSON_NAME[0], REGISTERED_CAPITAL[0],
PROV_NAME[0], CITY_NAME[0], DISTR_NAME[0], ADDRESS[0], BEGIN_DATE[0], TAX_NUM[0], INDUST_NAME[0], END_DATE[0]]
RESET_COMP_INFO = [COMP_NAME[1], LEGAL_PERSON_NAME[1], REGISTERED_CAPITAL[1],
PROV_NAME[1], CITY_NAME[1], DISTR_NAME[1], ADDRESS[1], BEGIN_DATE[1], TAX_NUM[1], INDUST_NAME[1], END_DATE[1]]

Binary file not shown.

BIN
test_data/cai/登录.xlsx Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More