├── .idea ├── encodings.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── modules.xml ├── mysite.iml ├── vcs.xml └── workspace.xml ├── CHANGELOG.md ├── README.md ├── api ├── Log │ ├── 1decac1a-58f3-11e9-bccc-bcee7b76a849.log │ ├── 292cd06e-c70c-11e9-b1d4-bcee7b76a849.log │ ├── 4af7fb94-58f3-11e9-a565-bcee7b76a849.log │ ├── 4fda2d94-2aa5-11e9-87fc-bcee7b76a849.log │ ├── 69cac542-58f3-11e9-9b71-bcee7b76a849.log │ ├── 6bbb1414-58f2-11e9-ac5f-bcee7b76a849.log │ ├── a9897370-58eb-11e9-9f6e-bcee7b76a849.log │ ├── be29c3a4-58f2-11e9-92f2-bcee7b76a849.log │ ├── d42dc024-58f3-11e9-b957-bcee7b76a849.log │ ├── de37529c-58f4-11e9-98eb-bcee7b76a849.log │ ├── f7dd0cf4-58f3-11e9-a190-bcee7b76a849.log │ ├── param.txt │ └── param_result.txt ├── Report │ ├── 1decac1a-58f3-11e9-bccc-bcee7b76a849.xlsx │ ├── 292cd06e-c70c-11e9-b1d4-bcee7b76a849.xlsx │ ├── 4af7fb94-58f3-11e9-a565-bcee7b76a849.xlsx │ ├── 4fda2d94-2aa5-11e9-87fc-bcee7b76a849.xlsx │ ├── 69cac542-58f3-11e9-9b71-bcee7b76a849.xlsx │ ├── 6bbb1414-58f2-11e9-ac5f-bcee7b76a849.xlsx │ ├── a9897370-58eb-11e9-9f6e-bcee7b76a849.xlsx │ ├── be29c3a4-58f2-11e9-92f2-bcee7b76a849.xlsx │ ├── d42dc024-58f3-11e9-b957-bcee7b76a849.xlsx │ ├── de37529c-58f4-11e9-98eb-bcee7b76a849.xlsx │ └── f7dd0cf4-58f3-11e9-a190-bcee7b76a849.xlsx ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-34.pyc │ ├── __init__.cpython-35.pyc │ ├── admin.cpython-34.pyc │ ├── admin.cpython-35.pyc │ ├── apps.cpython-34.pyc │ ├── apps.cpython-35.pyc │ ├── models.cpython-34.pyc │ ├── models.cpython-35.pyc │ ├── tasks.cpython-35.pyc │ ├── urls.cpython-34.pyc │ ├── urls.cpython-35.pyc │ ├── views.cpython-34.pyc │ └── views.cpython-35.pyc ├── admin.py ├── apps.py ├── base │ ├── BaseElementEnmu.py │ ├── BaseEmail.py │ ├── BaseExcel.py │ ├── BaseFile.py │ ├── BaseFuzzParams.py │ ├── BaseLog.py │ ├── BaseParams.py │ ├── BaseReport.py │ ├── BaseView.py │ ├── BaseViewCase.py │ ├── BaseViewDashBoard.py │ ├── BaseViewFuzz.py │ ├── BaseViewLogin.py │ ├── BaseViewModule.py │ ├── BaseViewTask.py │ ├── BaseViewTaskModule.py │ ├── __init__.py │ └── __pycache__ │ │ ├── BaseElementEnmu.cpython-34.pyc │ │ ├── BaseElementEnmu.cpython-35.pyc │ │ ├── BaseExcel.cpython-34.pyc │ │ ├── BaseExcel.cpython-35.pyc │ │ ├── BaseFile.cpython-34.pyc │ │ ├── BaseFile.cpython-35.pyc │ │ ├── BaseFuzzParams.cpython-35.pyc │ │ ├── BaseLog.cpython-34.pyc │ │ ├── BaseLog.cpython-35.pyc │ │ ├── BaseParams.cpython-34.pyc │ │ ├── BaseParams.cpython-35.pyc │ │ ├── BaseReport.cpython-35.pyc │ │ ├── BaseView.cpython-34.pyc │ │ ├── BaseView.cpython-35.pyc │ │ ├── BaseViewCase.cpython-35.pyc │ │ ├── BaseViewDashboard.cpython-35.pyc │ │ ├── BaseViewFuzz.cpython-35.pyc │ │ ├── BaseViewLogin.cpython-35.pyc │ │ ├── BaseViewModule.cpython-35.pyc │ │ ├── BaseViewTask.cpython-35.pyc │ │ ├── BaseViewTaskModule.cpython-35.pyc │ │ ├── __init__.cpython-34.pyc │ │ └── __init__.cpython-35.pyc ├── migrations │ ├── 0001_initial.py │ ├── 0002_task_extend.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-35.pyc │ │ ├── 0002_task_extend.cpython-35.pyc │ │ ├── __init__.cpython-34.pyc │ │ └── __init__.cpython-35.pyc ├── models.py ├── static │ ├── assets │ │ ├── brand │ │ │ ├── bootstrap-outline.svg │ │ │ ├── bootstrap-punchout.svg │ │ │ └── bootstrap-solid.svg │ │ ├── css │ │ │ ├── docs.min.css │ │ │ ├── docs.min.css.map │ │ │ ├── ie10-viewport-bug-workaround.css │ │ │ └── src │ │ │ │ ├── docs.css │ │ │ │ └── pygments-manni.css │ │ ├── flash │ │ │ └── ZeroClipboard.swf │ │ ├── img │ │ │ ├── components.png │ │ │ ├── devices.png │ │ │ ├── expo-lyft.jpg │ │ │ ├── expo-newsweek.jpg │ │ │ ├── expo-riot.jpg │ │ │ ├── expo-vogue.jpg │ │ │ └── sass-less.png │ │ └── js │ │ │ ├── customize.min.js │ │ │ ├── docs.min.js │ │ │ ├── ie-emulation-modes-warning.js │ │ │ ├── ie10-viewport-bug-workaround.js │ │ │ ├── ie8-responsive-file-warning.js │ │ │ ├── raw-files.min.js │ │ │ ├── src │ │ │ ├── application.js │ │ │ └── customizer.js │ │ │ └── vendor │ │ │ ├── Blob.js │ │ │ ├── FileSaver.js │ │ │ ├── ZeroClipboard.min.js │ │ │ ├── anchor.min.js │ │ │ ├── autoprefixer.js │ │ │ ├── holder.min.js │ │ │ ├── jquery.min.js │ │ │ ├── jszip.min.js │ │ │ ├── less.min.js │ │ │ └── uglify.min.js │ ├── css │ │ └── dashboard.css │ ├── dist │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ └── js │ │ ├── Highcharts-7.1.2 │ │ ├── exporting.js │ │ ├── highColumn.js │ │ ├── highLine.js │ │ └── highcharts.js │ │ ├── case.js │ │ ├── common.js │ │ ├── dashBoard.js │ │ ├── detail.js │ │ ├── fuzz.js │ │ ├── index.js │ │ ├── jquery-1.12.4.js │ │ ├── jquery-1.12.4.min.js │ │ ├── jquery-validation-1.17.0 │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ └── messages_zh.js │ │ ├── login.js │ │ ├── module.js │ │ ├── task.js │ │ └── taskModule.js ├── tasks.py ├── templates │ ├── api │ │ ├── alert.html │ │ ├── case.html │ │ ├── dashBoard.html │ │ ├── del.html │ │ ├── edit-case.html │ │ ├── edit-fuzz.html │ │ ├── edit-module.html │ │ ├── edit-task-module.html │ │ ├── edit-task.html │ │ ├── foot.html │ │ ├── fuzz.html │ │ ├── header.html │ │ ├── index.html │ │ ├── login.html │ │ ├── module.html │ │ ├── nav-left.html │ │ ├── nav-top.html │ │ ├── reportDetail.html │ │ ├── task.html │ │ └── taskModule.html │ └── index.html ├── templatetags │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-34.pyc │ │ ├── __init__.cpython-35.pyc │ │ ├── pagetag.cpython-34.pyc │ │ └── pagetag.cpython-35.pyc │ └── pagetag.py ├── tests.py ├── urls.py └── views.py ├── celery_redis_win.md ├── db.sqlite3 ├── djangoApi ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-34.pyc │ ├── __init__.cpython-35.pyc │ ├── celery.cpython-35.pyc │ ├── settings.cpython-34.pyc │ ├── settings.cpython-35.pyc │ ├── urls.cpython-34.pyc │ ├── urls.cpython-35.pyc │ ├── views.cpython-35.pyc │ ├── wsgi.cpython-34.pyc │ └── wsgi.cpython-35.pyc ├── celery.py ├── settings.py ├── urls.py ├── views.py └── wsgi.py ├── img ├── dashborad.png ├── fuzz.jpg └── report.jpg ├── lib ├── pict33.rar └── requirements.txt ├── manage.py ├── ui ├── Report │ ├── 0205b734-bbf0-11e9-a4c8-bcee7b76a849.xlsx │ ├── 0b45d006-bbf2-11e9-ad81-bcee7b76a849.xlsx │ ├── 0b5e785e-bb74-11e9-aae9-bcee7b76a849.xlsx │ ├── 1186a600-bbe8-11e9-9dd4-bcee7b76a849.xlsx │ ├── 14490b0c-bbe7-11e9-b2ad-bcee7b76a849.xlsx │ ├── 39780022-bbf4-11e9-899f-bcee7b76a849.xlsx │ ├── 41263490-bbee-11e9-96fa-bcee7b76a849.xlsx │ ├── 50f8e142-bbe8-11e9-8b0f-bcee7b76a849.xlsx │ ├── 5758f4be-bbf2-11e9-9aed-bcee7b76a849.xlsx │ ├── 5b6ddcd8-bbf5-11e9-8b54-bcee7b76a849.xlsx │ ├── 5f5f5386-bb73-11e9-afab-bcee7b76a849.xlsx │ ├── 6fc8f386-2aa6-11e9-83c0-bcee7b76a849.xlsx │ ├── 71662d9e-bb72-11e9-b1ee-bcee7b76a849.xlsx │ ├── 77893022-bb77-11e9-a265-bcee7b76a849.xlsx │ ├── 8f8628a4-bb76-11e9-adeb-bcee7b76a849.xlsx │ ├── 9b97f718-bbe3-11e9-983f-bcee7b76a849.xlsx │ ├── abe9aedc-bbec-11e9-a1e5-bcee7b76a849.xlsx │ ├── b9e126ee-bbf3-11e9-ba41-bcee7b76a849.xlsx │ ├── bf169dc6-bbf0-11e9-ad33-bcee7b76a849.xlsx │ ├── c2b939b8-bbed-11e9-92ae-bcee7b76a849.xlsx │ ├── c474154c-bbe6-11e9-8fa6-bcee7b76a849.xlsx │ ├── cdca2dd8-bbe7-11e9-804e-bcee7b76a849.xlsx │ ├── d242d906-bbe0-11e9-b963-bcee7b76a849.xlsx │ ├── d3a0feec-bbf4-11e9-8229-bcee7b76a849.xlsx │ ├── d8fdf1d0-bb72-11e9-8ceb-bcee7b76a849.xlsx │ ├── e1e8c018-bbee-11e9-aca6-bcee7b76a849.xlsx │ ├── ebcc39c6-bbec-11e9-8e60-bcee7b76a849.xlsx │ └── f0760800-bb76-11e9-a8e3-bcee7b76a849.xlsx ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── admin.cpython-35.pyc │ ├── apps.cpython-35.pyc │ ├── models.cpython-35.pyc │ ├── urls.cpython-35.pyc │ └── views.cpython-35.pyc ├── admin.py ├── apps.py ├── base │ ├── BaseElementEnmu.py │ ├── BaseError.py │ ├── BaseExcel.py │ ├── BaseFile.py │ ├── BaseLog.py │ ├── BaseOperate.py │ ├── BasePage.py │ ├── BaseReport.py │ ├── BaseView.py │ ├── BaseViewCase.py │ ├── BaseViewCaseCommonCase.py │ ├── BaseViewCheck.py │ ├── BaseViewCommonCase.py │ ├── BaseViewCommonCaseStep.py │ ├── BaseViewDashBoard.py │ ├── BaseViewLogin.py │ ├── BaseViewModule.py │ ├── BaseViewSetting.py │ ├── BaseViewStep.py │ ├── BaseViewTask.py │ ├── BaseViewTaskModule.py │ ├── __init__.py │ └── __pycache__ │ │ ├── BaseElementEnmu.cpython-35.pyc │ │ ├── BaseError.cpython-35.pyc │ │ ├── BaseExcel.cpython-35.pyc │ │ ├── BaseFile.cpython-35.pyc │ │ ├── BaseLog.cpython-35.pyc │ │ ├── BaseOperate.cpython-35.pyc │ │ ├── BasePage.cpython-35.pyc │ │ ├── BaseReport.cpython-35.pyc │ │ ├── BaseView.cpython-35.pyc │ │ ├── BaseViewCase.cpython-35.pyc │ │ ├── BaseViewCaseCommonCase.cpython-35.pyc │ │ ├── BaseViewCheck.cpython-35.pyc │ │ ├── BaseViewCommonCase.cpython-35.pyc │ │ ├── BaseViewCommonCaseStep.cpython-35.pyc │ │ ├── BaseViewDashboard.cpython-35.pyc │ │ ├── BaseViewLogin.cpython-35.pyc │ │ ├── BaseViewModule.cpython-35.pyc │ │ ├── BaseViewSetting.cpython-35.pyc │ │ ├── BaseViewStep.cpython-35.pyc │ │ ├── BaseViewTask.cpython-35.pyc │ │ ├── BaseViewTaskModule.cpython-35.pyc │ │ └── __init__.cpython-35.pyc ├── lib │ └── chromedriver.exe ├── migrations │ ├── 0001_initial.py │ ├── 0002_steps_sort.py │ ├── 0003_casecommoncase_commoncase_commoncasestep.py │ ├── 0004_reportitem_img.py │ ├── 0005_reportitem_extend.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-35.pyc │ │ ├── 0002_steps_sort.cpython-35.pyc │ │ ├── 0003_casecommoncase_commoncase_commoncasestep.cpython-35.pyc │ │ ├── 0004_reportitem_img.cpython-35.pyc │ │ ├── 0005_reportitem_extend.cpython-35.pyc │ │ └── __init__.cpython-35.pyc ├── models.py ├── static │ ├── assets │ │ ├── brand │ │ │ ├── bootstrap-outline.svg │ │ │ ├── bootstrap-punchout.svg │ │ │ └── bootstrap-solid.svg │ │ ├── css │ │ │ ├── docs.min.css │ │ │ ├── docs.min.css.map │ │ │ ├── ie10-viewport-bug-workaround.css │ │ │ └── src │ │ │ │ ├── docs.css │ │ │ │ └── pygments-manni.css │ │ ├── flash │ │ │ └── ZeroClipboard.swf │ │ ├── img │ │ │ ├── components.png │ │ │ ├── devices.png │ │ │ ├── expo-lyft.jpg │ │ │ ├── expo-newsweek.jpg │ │ │ ├── expo-riot.jpg │ │ │ ├── expo-vogue.jpg │ │ │ └── sass-less.png │ │ └── js │ │ │ ├── customize.min.js │ │ │ ├── docs.min.js │ │ │ ├── ie-emulation-modes-warning.js │ │ │ ├── ie10-viewport-bug-workaround.js │ │ │ ├── ie8-responsive-file-warning.js │ │ │ ├── raw-files.min.js │ │ │ ├── src │ │ │ ├── application.js │ │ │ └── customizer.js │ │ │ └── vendor │ │ │ ├── Blob.js │ │ │ ├── FileSaver.js │ │ │ ├── ZeroClipboard.min.js │ │ │ ├── anchor.min.js │ │ │ ├── autoprefixer.js │ │ │ ├── holder.min.js │ │ │ ├── jquery.min.js │ │ │ ├── jszip.min.js │ │ │ ├── less.min.js │ │ │ └── uglify.min.js │ ├── css │ │ └── dashboard.css │ ├── dist │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ └── js │ │ ├── Highcharts-7.1.2 │ │ ├── exporting.js │ │ ├── highColumn.js │ │ ├── highLine.js │ │ └── highcharts.js │ │ ├── case-common-case.js │ │ ├── case1.js │ │ ├── check.js │ │ ├── common-case-step.js │ │ ├── common-case.js │ │ ├── common1.js │ │ ├── dashBoard.js │ │ ├── index1.js │ │ ├── jquery-1.12.4.js │ │ ├── jquery-1.12.4.min.js │ │ ├── jquery-validation-1.17.0 │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ └── messages_zh.js │ │ ├── login1.js │ │ ├── module1.js │ │ ├── setting.js │ │ ├── step.js │ │ ├── task1.js │ │ └── taskModule1.js ├── templates │ └── ui │ │ ├── alert.html │ │ ├── case-common-case.html │ │ ├── case.html │ │ ├── check.html │ │ ├── common-case-step.html │ │ ├── common-case.html │ │ ├── dashBoard.html │ │ ├── del.html │ │ ├── edit-case-common-case.html │ │ ├── edit-case.html │ │ ├── edit-check.html │ │ ├── edit-common-case-step.html │ │ ├── edit-common-case.html │ │ ├── edit-login.html │ │ ├── edit-module.html │ │ ├── edit-step.html │ │ ├── edit-task-module.html │ │ ├── edit-task.html │ │ ├── foot.html │ │ ├── header.html │ │ ├── index.html │ │ ├── login.html │ │ ├── module.html │ │ ├── nav-left.html │ │ ├── nav-top.html │ │ ├── reportDetail.html │ │ ├── setting.html │ │ ├── step.html │ │ ├── task.html │ │ └── taskModule.html ├── templatetags │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-35.pyc │ │ └── pagetag.cpython-35.pyc │ └── pagetag.py ├── tests.py ├── urls.py └── views.py └── use.md /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/mysite.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/CHANGELOG.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 项目名及简介 2 | * web自动化接口测试平台 3 | * 自动化UI测试平台 4 | 5 | ## 概述 6 | * python 3.4.x 7 | * django 2.0.8 8 | * jquery页面和后台交互 9 | * bootstrap3.3 页面框架 10 | * 接口自动生成模糊用例 11 | 12 | 13 | ## 如何使用 14 | 15 | ### 自动化接口测试 16 | 17 | - 在登录菜单维护登录信息 18 | - 新建模块 19 | - 新建用例 20 | - 管理模糊用例 21 | - 任务管理,关联模块,然后运行任务 22 | - 在DashBroad中查看报告 23 | 24 | ### 自动化UI测试 25 | 26 | - 维护设置信息 27 | - 新建登录用例 28 | - 维护模块-维护用例-维护步骤-维护检查点 29 | - 任务关联,关联模块,然后运行任务 30 | - 在DashBroad中查看报告 31 | 32 | ## 运行 33 | - 直接用本机ip或者127.0.0.0:8080访问即可 34 | 35 | ``` 36 | python manage.py runserver 0.0.0.0:8000 37 | 38 | ``` 39 | 40 | 41 | ## 结果展示 42 | 43 | ![dashborad.png](img/dashborad.png ) 44 | 45 | ![fuzz.jpg](img/fuzz.jpg "detail.jpg") 46 | ![report.jpg](img/report.jpg "detail.jpg") 47 | 48 | # 其他 49 | * [配置说明](use.md) 50 | * [changelog](CHANGELOG.md) 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /api/Log/1decac1a-58f3-11e9-bccc-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/1decac1a-58f3-11e9-bccc-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/292cd06e-c70c-11e9-b1d4-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/292cd06e-c70c-11e9-b1d4-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/4af7fb94-58f3-11e9-a565-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/4af7fb94-58f3-11e9-a565-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/4fda2d94-2aa5-11e9-87fc-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/4fda2d94-2aa5-11e9-87fc-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/69cac542-58f3-11e9-9b71-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/69cac542-58f3-11e9-9b71-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/6bbb1414-58f2-11e9-ac5f-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/6bbb1414-58f2-11e9-ac5f-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/a9897370-58eb-11e9-9f6e-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/a9897370-58eb-11e9-9f6e-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/be29c3a4-58f2-11e9-92f2-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/be29c3a4-58f2-11e9-92f2-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/d42dc024-58f3-11e9-b957-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/d42dc024-58f3-11e9-b957-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/de37529c-58f4-11e9-98eb-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/de37529c-58f4-11e9-98eb-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/f7dd0cf4-58f3-11e9-a190-bcee7b76a849.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/f7dd0cf4-58f3-11e9-a190-bcee7b76a849.log -------------------------------------------------------------------------------- /api/Log/param.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/param.txt -------------------------------------------------------------------------------- /api/Log/param_result.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Log/param_result.txt -------------------------------------------------------------------------------- /api/Report/1decac1a-58f3-11e9-bccc-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/1decac1a-58f3-11e9-bccc-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/292cd06e-c70c-11e9-b1d4-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/292cd06e-c70c-11e9-b1d4-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/4af7fb94-58f3-11e9-a565-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/4af7fb94-58f3-11e9-a565-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/4fda2d94-2aa5-11e9-87fc-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/4fda2d94-2aa5-11e9-87fc-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/69cac542-58f3-11e9-9b71-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/69cac542-58f3-11e9-9b71-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/6bbb1414-58f2-11e9-ac5f-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/6bbb1414-58f2-11e9-ac5f-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/a9897370-58eb-11e9-9f6e-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/a9897370-58eb-11e9-9f6e-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/be29c3a4-58f2-11e9-92f2-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/be29c3a4-58f2-11e9-92f2-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/d42dc024-58f3-11e9-b957-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/d42dc024-58f3-11e9-b957-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/de37529c-58f4-11e9-98eb-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/de37529c-58f4-11e9-98eb-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/Report/f7dd0cf4-58f3-11e9-a190-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/Report/f7dd0cf4-58f3-11e9-a190-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__init__.py -------------------------------------------------------------------------------- /api/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /api/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /api/__pycache__/admin.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/admin.cpython-34.pyc -------------------------------------------------------------------------------- /api/__pycache__/admin.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/admin.cpython-35.pyc -------------------------------------------------------------------------------- /api/__pycache__/apps.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/apps.cpython-34.pyc -------------------------------------------------------------------------------- /api/__pycache__/apps.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/apps.cpython-35.pyc -------------------------------------------------------------------------------- /api/__pycache__/models.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/models.cpython-34.pyc -------------------------------------------------------------------------------- /api/__pycache__/models.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/models.cpython-35.pyc -------------------------------------------------------------------------------- /api/__pycache__/tasks.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/tasks.cpython-35.pyc -------------------------------------------------------------------------------- /api/__pycache__/urls.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/urls.cpython-34.pyc -------------------------------------------------------------------------------- /api/__pycache__/urls.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/urls.cpython-35.pyc -------------------------------------------------------------------------------- /api/__pycache__/views.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/views.cpython-34.pyc -------------------------------------------------------------------------------- /api/__pycache__/views.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/__pycache__/views.cpython-35.pyc -------------------------------------------------------------------------------- /api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ApiConfig(AppConfig): 5 | name = 'api' 6 | -------------------------------------------------------------------------------- /api/base/BaseElementEnmu.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | import os 5 | 6 | PATH = lambda p: os.path.abspath( 7 | os.path.join(os.path.dirname(__file__), p) 8 | ) 9 | 10 | 11 | class Element(object): 12 | REPORT_FILE = PATH("../Report/") # 测试报告 13 | PICT_PARAM = PATH("../Log/param.txt") # 写入pict需要的参数 14 | PICT_PARAM_RESULT = PATH("../Log/param_result.txt") # pict生成后的数据 15 | 16 | ERROR_EMPTY = "error_empty" 17 | ERROR_VALUE = "error_value" 18 | RIGHT_VALUE = "right_value" 19 | C_CHECK = {"passed": 0, "failed": -1, "no_check": -2} 20 | -------------------------------------------------------------------------------- /api/base/BaseEmail.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from email.header import Header 3 | from email.mime.text import MIMEText 4 | from email.utils import parseaddr, formataddr 5 | from email.mime.multipart import MIMEMultipart 6 | from email.mime.application import MIMEApplication 7 | import smtplib 8 | import os 9 | PATH = lambda p: os.path.abspath( 10 | os.path.join(os.path.dirname(__file__), p) 11 | ) 12 | def _format_addr(s): 13 | name, addr = parseaddr(s) 14 | return formataddr((Header(name, 'utf-8').encode(), addr)) 15 | def send_mail(**kwargs): 16 | ''' 17 | :param f: 附件路径 18 | :param to_addr:发给的人 [] 19 | :return: 20 | ''' 21 | from_addr = kwargs["mail_user"] 22 | password = kwargs["mail_pass"] 23 | # to_addr = "ashikun@126.com" 24 | smtp_server = kwargs["mail_host"] 25 | 26 | msg = MIMEMultipart() 27 | 28 | # msg = MIMEText('hello, send by Python...', 'plain', 'utf-8') 29 | msg['From'] = _format_addr('来自<%s>接口测试' % from_addr) 30 | msg['To'] = _format_addr(' <%s>' % kwargs["to_addr"]) 31 | msg['Subject'] = Header(kwargs["header_msg"], 'utf-8').encode() 32 | msg.attach(MIMEText(kwargs["attach"], 'plain', 'utf-8')) 33 | 34 | if kwargs.get("report", "0") != "0": 35 | part = MIMEApplication(open(kwargs["report"], 'rb').read()) 36 | part.add_header('Content-Disposition', 'attachment', filename=('gb2312', '', kwargs["report_name"])) 37 | msg.attach(part) 38 | 39 | server = smtplib.SMTP_SSL(smtp_server, kwargs["port"]) 40 | server.set_debuglevel(1) 41 | server.login(from_addr, password) 42 | server.sendmail(from_addr, kwargs["to_addr"], msg.as_string()) 43 | server.quit() 44 | if __name__ == '__main__': 45 | to_addr = ["284772894@qq.com"] 46 | mail_host = "smtp.qq.com" 47 | mail_user = "284772894@qq.com" 48 | mail_pass = "oftllbhnknegbjhb" 49 | port = "465" 50 | header_msg = "接口测试" 51 | attach = "接口测试" 52 | report = PATH("../Log/report.xlsx") 53 | send_mail(to_addr = to_addr, mail_host = mail_host, mail_user=mail_user, port=port, mail_pass=mail_pass, header_msg=header_msg, report=report, attach=attach, report_name="接口测试报告") 54 | -------------------------------------------------------------------------------- /api/base/BaseFile.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | 4 | ''' 5 | 操作文件 6 | ''' 7 | 8 | 9 | class BaseFile(object): 10 | def __init__(self): 11 | pass 12 | 13 | @staticmethod 14 | def check_file(path): 15 | if not os.path.isfile(path): 16 | # sys.exit() 17 | return False 18 | else: 19 | return True 20 | 21 | @staticmethod 22 | def mk_file(path): 23 | with open(path, 'w', encoding="utf-8") as f: 24 | print("创建文件成功") 25 | 26 | @staticmethod 27 | def mk_write(path, line): 28 | time.sleep(1) 29 | with open(path, 'a') as fileHandle: 30 | fileHandle.write(line + "\n") 31 | 32 | @staticmethod 33 | def mk_read(path): 34 | result = [] 35 | with open(path, 'r', encoding="utf-8") as fileHandle: 36 | file_list = fileHandle.readlines() 37 | for i in file_list: 38 | temp = [i.replace("\t", ",").strip("\n")] 39 | result.append(temp) 40 | return result 41 | 42 | @staticmethod 43 | def remove_file(path): 44 | if not os.path.isfile(path): 45 | os.remove(path) 46 | 47 | 48 | if __name__ == '__main__': 49 | pass 50 | -------------------------------------------------------------------------------- /api/base/BaseLog.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import time 3 | import os 4 | from time import sleep 5 | import threading 6 | 7 | PATH = lambda p: os.path.abspath( 8 | os.path.join(os.path.dirname(__file__), p) 9 | ) 10 | 11 | 12 | class Log: 13 | def __init__(self, devices): 14 | # global logger, result_path, log_path 15 | self.check_no = 0 16 | result_path = PATH("../log/") 17 | # log_path = os.path.join(result_path, (devices + time.strftime('%Y%m%d%H%M%S', time.localtime()))) 18 | self.log_path = os.path.join(result_path, devices) 19 | # if not os.path.exists(log_path): 20 | # os.makedirs(log_path) 21 | # self.check_no = 0 22 | self.logger = logging.getLogger() 23 | self.logger.setLevel(logging.INFO) 24 | 25 | # create handler,write log 26 | fh = logging.FileHandler(self.log_path) 27 | # Define the output format of formatter handler 28 | formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') 29 | fh.setFormatter(formatter) 30 | 31 | self.logger.addHandler(fh) 32 | 33 | def build_start_line(self, case_no): 34 | """build the start log 35 | :param case_no: 36 | :return: 37 | """ 38 | start_line = "---- " + case_no + " " + " " + \ 39 | " ----" 40 | # startLine = "---- " + case_no + " " + "START" + " " + \ 41 | # " ----" 42 | self.logger.info(start_line) 43 | 44 | def build_end_line(self, case_no): 45 | """build the end log 46 | :param case_no: 47 | :return: 48 | """ 49 | end_line = "---- " + case_no + " " + "END" + " " + \ 50 | " ----" 51 | self.logger.info(end_line) 52 | 53 | def write_result(self, result): 54 | """write the case result(OK or NG) 55 | :param result: 56 | :return: 57 | """ 58 | report_path = os.path.join(self.log_path, "report.txt") 59 | flogging = open(report_path, "a") 60 | try: 61 | flogging.write(result + "\n") 62 | finally: 63 | flogging.close() 64 | pass 65 | 66 | def result_ok(self, case_no): 67 | self.write_result(case_no + ": OK") 68 | 69 | def case_ng(self, case_no, reason): 70 | self.write_result(case_no + ": NG--" + reason) 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /api/base/BaseViewCase.py: -------------------------------------------------------------------------------- 1 | import ast 2 | from django.http import JsonResponse 3 | from django.http import HttpResponse 4 | from django.template import loader 5 | from django.views.decorators.csrf import csrf_exempt 6 | from ..models import Module, Case 7 | 8 | 9 | class BaseViewCase: 10 | 11 | @staticmethod 12 | def case(request, path, id): 13 | mo = Module.objects.get(pk=id) 14 | template = loader.get_template(path) 15 | context = {'case_list': mo.case_set.all(), "mid": id, "name": mo.name} 16 | return HttpResponse(template.render(context, request)) 17 | 18 | @staticmethod 19 | @csrf_exempt 20 | def case_new(kw): 21 | mo = Module.objects.get(pk=kw["mid"]) 22 | name = kw["name"] 23 | url = kw["url"] 24 | protocol = kw["protocol"] 25 | method = kw["method"] 26 | params = kw["params"] 27 | hope = kw["hope"] 28 | mo.case_set.create(name=name, url=url, protocol=protocol, method=method, params=params, hope=hope) 29 | result = {'code': 0, 'msg': '保存成功'} 30 | return JsonResponse(result) 31 | 32 | @staticmethod 33 | @csrf_exempt 34 | def case_edit(kw): 35 | c = Case.objects.get(pk=kw["cid"]) 36 | c.name = kw["name"] 37 | c.url = kw["url"] 38 | c.protocol = kw["protocol"] 39 | c.method = kw["method"] 40 | c.params = kw["params"] 41 | c.hope = kw["hope"] 42 | c.save() 43 | result = {'code': 0, 'msg': '编辑成功'} 44 | return JsonResponse(result) 45 | 46 | @staticmethod 47 | @csrf_exempt 48 | def case_del(id): 49 | c = Case.objects.get(pk=id) 50 | c.delete() 51 | result = {'code': 0, 'msg': '删除成功'} 52 | return JsonResponse(result) 53 | -------------------------------------------------------------------------------- /api/base/BaseViewLogin.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Login 9 | 10 | class BaseViewLogin: 11 | 12 | @staticmethod 13 | def login(request, path): 14 | template = loader.get_template(path) 15 | context = {'login': Login.objects.get(pk=1)} 16 | return HttpResponse(template.render(context, request)) 17 | 18 | @staticmethod 19 | @csrf_exempt 20 | def login_edit(kw): 21 | l = Login.objects.get(pk=1) 22 | l.url = kw["url"] 23 | l.params = kw["params"] 24 | l.save() 25 | result = {'code': 0, 'msg': '保存成功'} 26 | return JsonResponse(result) 27 | 28 | 29 | -------------------------------------------------------------------------------- /api/base/BaseViewModule.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | 9 | from ..models import Module 10 | 11 | 12 | class BaseViewModule: 13 | 14 | @staticmethod 15 | def module(request, path): 16 | template = loader.get_template(path) 17 | context = {'module_list': Module.objects.all()} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def module_new(name): 23 | Module(name=name).save() 24 | result = {'code': 0, 'msg': '保存成功'} 25 | return JsonResponse(result) 26 | 27 | @staticmethod 28 | @csrf_exempt 29 | def module_edit(kw): 30 | m_id = kw["id"] 31 | name = kw["name"] 32 | m = Module.objects.get(pk=m_id) 33 | m.name = name 34 | m.save() 35 | result = {'code': 0, 'msg': '编辑成功'} 36 | return JsonResponse(result) 37 | 38 | @staticmethod 39 | @csrf_exempt 40 | def module_del(id): 41 | m = Module.objects.get(pk=id) 42 | m.delete() 43 | result = {'code': 0, 'msg': '删除成功'} 44 | return JsonResponse(result) -------------------------------------------------------------------------------- /api/base/BaseViewTaskModule.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Task, TaskModule, Module 9 | 10 | 11 | class BaseViewTaskModule: 12 | 13 | @staticmethod 14 | def task_module(request, path, id): 15 | template = loader.get_template(path) 16 | ta = Task.objects.get(pk=id) 17 | context = {'ta_module_list': ta.taskmodule_set.all(), "tid": id, "module_list": Module.objects.all(), "name": ta.name} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def task_module_new(tid, name, mid): 23 | ta = Task.objects.get(pk=tid) 24 | ta.taskmodule_set.create(name=name, mid=mid) 25 | result = {'code': 0, 'msg': '保存成功'} 26 | return JsonResponse(result) 27 | 28 | @staticmethod 29 | @csrf_exempt 30 | def task_module_edit(kw): 31 | tm = TaskModule.objects.get(pk=kw["tmid"]) 32 | tm.name = kw["name"] 33 | tm.mid = kw["mid"] 34 | tm.save() 35 | result = {'code': 0, 'msg': '编辑成功'} 36 | return JsonResponse(result) 37 | 38 | @staticmethod 39 | @csrf_exempt 40 | def task_module_del(tmid): 41 | tm = TaskModule.objects.get(pk=tmid) 42 | tm.delete() 43 | result = {'code': 0, 'msg': '删除成功'} 44 | return JsonResponse(result) 45 | -------------------------------------------------------------------------------- /api/base/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__init__.py -------------------------------------------------------------------------------- /api/base/__pycache__/BaseElementEnmu.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseElementEnmu.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseElementEnmu.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseElementEnmu.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseExcel.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseExcel.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseExcel.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseExcel.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseFile.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseFile.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseFile.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseFile.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseFuzzParams.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseFuzzParams.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseLog.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseLog.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseLog.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseLog.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseParams.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseParams.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseParams.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseParams.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseReport.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseReport.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseView.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseView.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseView.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseView.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewCase.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewCase.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewDashboard.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewDashboard.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewFuzz.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewFuzz.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewLogin.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewLogin.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewModule.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewModule.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewTask.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewTask.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/BaseViewTaskModule.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/BaseViewTaskModule.cpython-35.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /api/base/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/base/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /api/migrations/0002_task_extend.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.4 on 2019-04-07 03:23 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='task', 15 | name='extend', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/migrations/__init__.py -------------------------------------------------------------------------------- /api/migrations/__pycache__/0001_initial.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/migrations/__pycache__/0001_initial.cpython-35.pyc -------------------------------------------------------------------------------- /api/migrations/__pycache__/0002_task_extend.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/migrations/__pycache__/0002_task_extend.cpython-35.pyc -------------------------------------------------------------------------------- /api/migrations/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/migrations/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /api/migrations/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/migrations/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /api/static/assets/brand/bootstrap-outline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /api/static/assets/brand/bootstrap-punchout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /api/static/assets/brand/bootstrap-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /api/static/assets/css/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-ms-viewport { width: device-width; } 12 | @-o-viewport { width: device-width; } 13 | @viewport { width: device-width; } 14 | -------------------------------------------------------------------------------- /api/static/assets/flash/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/flash/ZeroClipboard.swf -------------------------------------------------------------------------------- /api/static/assets/img/components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/components.png -------------------------------------------------------------------------------- /api/static/assets/img/devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/devices.png -------------------------------------------------------------------------------- /api/static/assets/img/expo-lyft.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/expo-lyft.jpg -------------------------------------------------------------------------------- /api/static/assets/img/expo-newsweek.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/expo-newsweek.jpg -------------------------------------------------------------------------------- /api/static/assets/img/expo-riot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/expo-riot.jpg -------------------------------------------------------------------------------- /api/static/assets/img/expo-vogue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/expo-vogue.jpg -------------------------------------------------------------------------------- /api/static/assets/img/sass-less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/img/sass-less.png -------------------------------------------------------------------------------- /api/static/assets/js/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /api/static/assets/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /api/static/assets/js/ie8-responsive-file-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2011-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8. 11 | if (window.location.protocol == 'file:') { 12 | window.alert('ERROR: Bootstrap\'s responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.') 13 | } 14 | -------------------------------------------------------------------------------- /api/static/assets/js/vendor/autoprefixer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/assets/js/vendor/autoprefixer.js -------------------------------------------------------------------------------- /api/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | 11 | /* 12 | * Global add-ons 13 | */ 14 | 15 | .sub-header { 16 | padding-bottom: 10px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Top navigation 22 | * Hide default border to remove 1px line. 23 | */ 24 | .navbar-fixed-top { 25 | border: 0; 26 | } 27 | 28 | /* 29 | * Sidebar 30 | */ 31 | 32 | /* Hide for mobile, show later */ 33 | .sidebar { 34 | display: none; 35 | } 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | .nav-sidebar > li > a { 59 | padding-right: 20px; 60 | padding-left: 20px; 61 | } 62 | .nav-sidebar > .active > a, 63 | .nav-sidebar > .active > a:hover, 64 | .nav-sidebar > .active > a:focus { 65 | color: #fff; 66 | background-color: #428bca; 67 | } 68 | 69 | 70 | /* 71 | * Main content 72 | */ 73 | 74 | .main { 75 | padding: 20px; 76 | } 77 | @media (min-width: 768px) { 78 | .main { 79 | padding-right: 40px; 80 | padding-left: 40px; 81 | } 82 | } 83 | .main .page-header { 84 | margin-top: 0; 85 | } 86 | 87 | 88 | /* 89 | * Placeholder dashboard ideas 90 | */ 91 | 92 | .placeholders { 93 | margin-bottom: 30px; 94 | text-align: center; 95 | } 96 | .placeholders h4 { 97 | margin-bottom: 0; 98 | } 99 | .placeholder { 100 | margin-bottom: 20px; 101 | } 102 | .placeholder img { 103 | display: inline-block; 104 | border-radius: 50%; 105 | } 106 | -------------------------------------------------------------------------------- /api/static/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /api/static/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /api/static/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /api/static/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/static/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /api/static/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /api/static/js/Highcharts-7.1.2/highColumn.js: -------------------------------------------------------------------------------- 1 | function highColumn(id, title, yAxis_title,data) { 2 | 3 | Highcharts.chart(id, { 4 | chart: { 5 | type: 'column' 6 | }, 7 | title: { 8 | text: title 9 | }, 10 | credits: { 11 | enabled: false 12 | }, 13 | subtitle: { 14 | text: '' 15 | }, 16 | xAxis: { 17 | // categories:["测试1","测试2"], 18 | type: 'category', 19 | labels: { 20 | rotation: -45, 21 | style: { 22 | fontSize: '13px', 23 | fontFamily: 'Verdana, sans-serif' 24 | } 25 | } 26 | }, 27 | yAxis: { 28 | min: 0, 29 | title: { 30 | text: yAxis_title 31 | } 32 | }, 33 | legend: { 34 | enabled: false 35 | }, 36 | tooltip: { 37 | pointFormat: '{point.y:.0f} ' 38 | }, 39 | series: [{ 40 | //name: 'Population', 41 | // data:[["shanghai", 24.2],["shanghai", 24.2]] 42 | data: data, 43 | dataLabels: { 44 | enabled: true, 45 | rotation: -90, 46 | color: '#FFFFFF', 47 | align: 'right', 48 | format: '{point.y:.0f}', // one decimal 49 | y: 10, // 10 pixels down from the top 50 | style: { 51 | fontSize: '13px', 52 | fontFamily: 'Verdana, sans-serif' 53 | } 54 | } 55 | }] 56 | }); 57 | } -------------------------------------------------------------------------------- /api/static/js/Highcharts-7.1.2/highLine.js: -------------------------------------------------------------------------------- 1 | function highLine(id,h_title,h_yaxis_title,h_tooltip,h_series){ 2 | $(id).highcharts({ 3 | // chart: { 4 | // type: 'line' 5 | // }, 6 | title: { 7 | text: h_title, 8 | x: -20 //center 9 | }, 10 | subtitle: { 11 | text: "", 12 | x: -20 13 | }, 14 | xAxis: { 15 | // labels: { 16 | // step: h_xaxis_setp 17 | // }, 18 | categories: "" 19 | }, 20 | yAxis: { 21 | title: { 22 | text: h_yaxis_title 23 | }, 24 | plotLines: [{ 25 | value: 0, 26 | width: 1, 27 | color: '#808080' 28 | }] 29 | }, 30 | tooltip: { 31 | valueSuffix: h_tooltip 32 | }, 33 | legend: { 34 | layout: 'vertical', 35 | align: 'right', 36 | verticalAlign: 'middle', 37 | borderWidth: 1 38 | }, 39 | series: h_series 40 | }); 41 | 42 | } -------------------------------------------------------------------------------- /api/static/js/common.js: -------------------------------------------------------------------------------- 1 | ;(function ($) { 2 | $.rpc = {}; 3 | $.rpc.req = function (url, type, data, cb) { 4 | $.ajax({ 5 | url: url , 6 | type:type, 7 | dataType:"json", 8 | timeout:500, 9 | error:function (xhr) { 10 | if ($.isFunction(cb)) { 11 | cb(null); 12 | } 13 | }, 14 | data:data, 15 | success:function (data) { 16 | if ($.isFunction(cb)) { 17 | cb(data); 18 | } 19 | } 20 | }); 21 | 22 | }; 23 | })(jQuery); 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /api/static/js/dashBoard.js: -------------------------------------------------------------------------------- 1 | 2 | $(function(){ 3 | $("#nav-left ul li:eq(2) a").css("color", "red") 4 | 5 | dashBoard_module_case() 6 | dashBoard_top10_task() 7 | dashBoard_top100_case_time() 8 | 9 | 10 | 11 | function dashBoard_module_case() { 12 | $.rpc.req("dashBoard_module_case","get",{},function(resp){ 13 | if (resp && resp["code"] == 0) { 14 | // alert("成功") 15 | // location.reload() 16 | // id, title, yAxis_title,data 17 | highColumn("module-case","模块下的用例", "模块下的用例",resp.data) 18 | } else { 19 | if (resp && resp["code"] ) { 20 | alert(resp.msg) 21 | } else { 22 | alert("请求失败") 23 | } 24 | // location.reload() 25 | } 26 | }) 27 | } 28 | 29 | function dashBoard_top10_task() { 30 | $.rpc.req("dashBoard_top10_task","get",{},function(resp){ 31 | if (resp && resp["code"] == 0) { 32 | var id = "#top10-task" 33 | var h_title = "前十个任务用例执行统计" 34 | var h_yaxis_title = "前十个任务用例执行统计" 35 | var h_tooltip = "" 36 | var h_series = resp.data 37 | highLine(id,h_title,h_yaxis_title,h_tooltip,h_series) 38 | } else { 39 | if (resp && resp["code"] ) { 40 | alert(resp.msg) 41 | } else { 42 | alert("请求失败") 43 | } 44 | // location.reload() 45 | } 46 | }) 47 | } 48 | // 前100个用例的耗时情况 49 | function dashBoard_top100_case_time() { 50 | $.rpc.req("dashBoard_top100_case_time","get",{},function(resp){ 51 | if (resp && resp["code"] == 0) { 52 | var id = "#top100-case" 53 | var h_title = "前100个用例的耗时情况" 54 | var h_yaxis_title = "前100个用例的耗时情况" 55 | var h_tooltip = "" 56 | var h_series = resp.data 57 | highLine(id,h_title,h_yaxis_title,h_tooltip,h_series) 58 | } else { 59 | if (resp && resp["code"] ) { 60 | alert(resp.msg) 61 | } else { 62 | alert("请求失败") 63 | } 64 | // location.reload() 65 | } 66 | }) 67 | } 68 | 69 | }) -------------------------------------------------------------------------------- /api/static/js/detail.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $("#nav-left ul li:eq(1) a").css("color", "red") 3 | }) -------------------------------------------------------------------------------- /api/static/js/index.js: -------------------------------------------------------------------------------- 1 | var id = 0 2 | $(function () { 3 | $("#nav-left ul li:eq(1) a").css("color", "red") 4 | 5 | $(".btn-del").click(function () { 6 | id = $(this).parents("tr").attr("id") 7 | $("#modal-del").modal("show") 8 | }) 9 | $("#btn-modal-confirm").click(function () { 10 | $.rpc.req("report_del","post",{"rid": id},function(resp){ 11 | if (resp && resp["code"] == 0) { 12 | alert("成功") 13 | location.reload() 14 | } else { 15 | if (resp && resp["code"] ) { 16 | alert(resp.msg) 17 | } else { 18 | alert("请求失败") 19 | } 20 | location.reload() 21 | } 22 | }) 23 | 24 | }) 25 | 26 | $(".btn-log").click(function(){ 27 | $.rpc.req("download_log","post",{ "log": $(this).attr("log")},function(resp){ 28 | if (resp && resp["code"] == 0) { 29 | window.location.href = resp["path"] 30 | } else { 31 | if (resp && resp["code"] ) { 32 | alert(resp.msg) 33 | } else { 34 | alert("请求失败") 35 | } 36 | location.reload() 37 | } 38 | }) 39 | }) 40 | 41 | $(".btn-excel").click(function(){ 42 | $.rpc.req("download_excel","post",{ "excel": $(this).attr("excel")},function(resp){ 43 | if (resp && resp["code"] == 0) { 44 | window.location.href = resp["path"] 45 | 46 | } else { 47 | if (resp && resp["code"] ) { 48 | alert(resp.msg) 49 | } else { 50 | alert("请求失败") 51 | } 52 | location.reload() 53 | } 54 | }) 55 | }) 56 | }) 57 | 58 | -------------------------------------------------------------------------------- /api/static/js/jquery-validation-1.17.0/messages_zh.js: -------------------------------------------------------------------------------- 1 | (function( factory ) { 2 | if ( typeof define === "function" && define.amd ) { 3 | define( ["jquery", "../jquery.validate"], factory ); 4 | } else if (typeof module === "object" && module.exports) { 5 | module.exports = factory( require( "jquery" ) ); 6 | } else { 7 | factory( jQuery ); 8 | } 9 | }(function( $ ) { 10 | 11 | /* 12 | * Translated default messages for the jQuery validation plugin. 13 | * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) 14 | */ 15 | $.extend( $.validator.messages, { 16 | required: "这是必填字段", 17 | remote: "请修正此字段", 18 | email: "请输入有效的电子邮件地址", 19 | url: "请输入有效的网址", 20 | date: "请输入有效的日期", 21 | dateISO: "请输入有效的日期 (YYYY-MM-DD)", 22 | number: "请输入有效的数字", 23 | digits: "只能输入数字", 24 | creditcard: "请输入有效的信用卡号码", 25 | equalTo: "你的输入不相同", 26 | extension: "请输入有效的后缀", 27 | maxlength: $.validator.format( "最多可以输入 {0} 个字符" ), 28 | minlength: $.validator.format( "最少要输入 {0} 个字符" ), 29 | rangelength: $.validator.format( "请输入长度在 {0} 到 {1} 之间的字符串" ), 30 | range: $.validator.format( "请输入范围在 {0} 到 {1} 之间的数值" ), 31 | max: $.validator.format( "请输入不大于 {0} 的数值" ), 32 | min: $.validator.format( "请输入不小于 {0} 的数值" ) 33 | } ); 34 | return $; 35 | })); -------------------------------------------------------------------------------- /api/static/js/login.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $("#nav-left ul li:eq(3) a").css("color", "red") 3 | 4 | function isJSON(str) { 5 | if (typeof str == 'string') { 6 | try { 7 | var obj=JSON.parse(str); 8 | if(typeof obj == 'object' && obj ){ 9 | return true; 10 | }else{ 11 | return false; 12 | } 13 | } catch(e) { 14 | console.log('error:'+str+'!!!'+e); 15 | return false; 16 | } 17 | } 18 | } 19 | 20 | $("#btn-confirm").click(function(){ 21 | 22 | if ( !isJSON($("#params").val())) { 23 | alert("请填入正确入参的json") 24 | return 25 | } 26 | 27 | validate() 28 | }) 29 | function validate() { 30 | $("#m-form").validate({   31 | onsubmit: true, // 是否在提交是验证 32 | onfocusout: false, // 是否在获取焦点时验证 33 | onkeyup: false, // 是否在敲击键盘时验证 34 | rules: {     //规则 35 | url: {required: true}, 36 | params: {required: true}, 37 | 38 | }, 39 | messages: { 40 | url: {required: "请输入url"}, 41 | params:{required: "请输入入参"}, 42 | }, 43 | submitHandler: function (form) { //通过之后回调 44 | EditCase() 45 | }, 46 | invalidHandler: function (form, validator) { 47 | return false; 48 | } 49 | }); 50 | } 51 | 52 | function EditCase() { 53 | $.ajax({   54 | url: 'login_edit', 55 |   type: "post", 56 |   dataType: "json", 57 |    data: {     58 | "url": $("#url").val(), 59 | "params": $("#params").val() 60 | }, 61 |   success: function (data) {   62 | console.log(data) 63 | if (data["code"] == 0) { 64 | location.reload() 65 | } 66 | }, 67 | error: function (e) { 68 | alert("失败") 69 | location.reload() 70 | } 71 | }) 72 | } 73 | }) 74 | 75 | -------------------------------------------------------------------------------- /api/tasks.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from celery import task 4 | 5 | 6 | 7 | @task 8 | def add(a,b): 9 | print("这是任务开始") 10 | print(a+b) 11 | time.sleep(10) 12 | print("这是任务结束") 13 | 14 | 15 | -------------------------------------------------------------------------------- /api/templates/api/alert.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api/templates/api/dashBoard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'api/header.html' %} 5 | 6 | 7 | {% include 'api/nav-top.html' %} 8 |
9 |
10 | {% include 'api/nav-left.html' %} 11 |
12 |

DashBoard

13 | 16 |
17 |
18 |
19 | 22 |
23 |
24 |
25 | 28 |
29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /api/templates/api/del.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api/templates/api/edit-module.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /api/templates/api/edit-task-module.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /api/templates/api/edit-task.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /api/templates/api/foot.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /api/templates/api/header.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | 自动化接口测试框架 9 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /api/templates/api/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'api/header.html' %} 5 | 6 | 7 | {% include 'api/nav-top.html' %} 8 | 9 |
10 |
11 | {% include 'api/nav-left.html' %} 12 |
13 |

登录

14 | 15 |
16 |
17 | 18 |
19 |
20 |
21 |
22 | 23 |
24 | 25 |
26 |
27 |
28 | 29 | 31 |
32 |
33 |
34 |
35 |
36 | {% include 'api/del.html' %} 37 | {% include 'api/edit-case.html' %} 38 | {% include 'api/foot.html' %} 39 | 40 | 41 | -------------------------------------------------------------------------------- /api/templates/api/module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'api/header.html' %} 5 | 6 | 7 | {% include 'api/nav-top.html' %} 8 | 9 |
10 |
11 | {% include 'api/nav-left.html' %} 12 |
13 | 14 |

模块

15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | {% if module_list %} 26 | {% for i in module_list %} 27 | 28 | 29 | 34 | 35 | 36 | {% endfor %} 37 | 38 | {% else %} 39 | 40 | 41 | 42 | 43 | {% endif %} 44 | 45 |
模块名操作
{{i.name}} 30 | 31 | 32 | 用例管理 33 |
无数据
46 |
47 |
48 |
49 |
50 | 51 | {% include 'api/del.html' %} 52 | {% include 'api/edit-module.html' %} 53 | {% include 'api/foot.html' %} 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /api/templates/api/nav-left.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api/templates/api/nav-top.html: -------------------------------------------------------------------------------- 1 | 2 | 26 | -------------------------------------------------------------------------------- /api/templates/api/task.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'api/header.html' %} 5 | 6 | 7 | {% include 'api/nav-top.html' %} 8 | 9 |
10 |
11 | {% include 'api/nav-left.html' %} 12 |
13 |

任务

14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% if task_list %} 25 | {% for i in task_list %} 26 | 27 | 28 | 40 | 41 | {% endfor %} 42 | {% else %} 43 | 44 | 45 | 46 | {% endif %} 47 | 48 |
任务名操作
{{i.name}} 29 | 30 | 31 | 关联模块 32 | {% if i.extend == 1 %} 33 | 34 | {% elif i.extend == 2 %} 35 | 36 | {% elif i.extend == 0 %} 37 | 38 | {% endif %} 39 |
无数据
49 |
50 |
51 |
52 |
53 | {% include 'api/del.html' %} 54 | {% include 'api/edit-task.html' %} 55 | {% include 'api/alert.html' %} 56 | {% include 'api/foot.html' %} 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /api/templates/api/taskModule.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'api/header.html' %} 5 | 6 | 7 | {% include 'api/nav-top.html' %} 8 | 9 |
10 |
11 | {% include 'api/nav-left.html' %} 12 |
13 | 17 |

{{name}}--关联模块

18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {% if ta_module_list %} 31 | {% for i in ta_module_list %} 32 | 33 | 34 | 38 | 39 | {% endfor %} 40 | {% else %} 41 | 42 | 43 | 44 | {% endif %} 45 | 46 |
模块名操作
{{i.name}} 35 | 36 | 37 |
无数据
47 |
48 |
49 |
50 |
51 | {% include 'api/del.html' %} 52 | {% include 'api/edit-task-module.html' %} 53 | {% include 'api/foot.html' %} 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /api/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'api/header.html' %} 5 | 6 | 7 |
8 |

自动化API测试

9 |
10 |
11 |
    12 |
  • 任务化管理
  • 13 |
  • 支持自动生成模糊用例(只支持windows)
  • 14 |
  • 新建模块-新建用例-新建模糊用例-任务关联模块-运行模块-查看报告
  • 15 |
  • 马上进入到接口测试
  • 16 |
17 |
18 |
19 |
20 |

自动化UI测试

21 |
22 |
    23 |
  • 任务化管理
  • 24 |
  • 关键字驱动
  • 25 |
  • 新建模块-新建用例-新建模糊用例-任务关联模块-运行模块-查看报告
  • 26 |
  • 马上进入到自动化UI测试
  • 27 |
28 |
29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /api/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/templatetags/__init__.py -------------------------------------------------------------------------------- /api/templatetags/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/templatetags/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /api/templatetags/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/templatetags/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /api/templatetags/__pycache__/pagetag.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/templatetags/__pycache__/pagetag.cpython-34.pyc -------------------------------------------------------------------------------- /api/templatetags/__pycache__/pagetag.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/api/templatetags/__pycache__/pagetag.cpython-35.pyc -------------------------------------------------------------------------------- /api/templatetags/pagetag.py: -------------------------------------------------------------------------------- 1 | # _*_ coding:utf-8 _*_ 2 | __Author = 'Kongzhagen' 3 | 4 | from django import template 5 | 6 | register = template.Library() 7 | 8 | 9 | @register.filter 10 | def kong_upper(val): 11 | print('val from template:', val) 12 | return val.upper() 13 | 14 | 15 | from django.utils.html import format_html 16 | 17 | 18 | @register.simple_tag 19 | def circle_page(curr_page, loop_page): 20 | offset = abs(curr_page - loop_page) 21 | if offset < 10: 22 | if curr_page == loop_page: 23 | page_ele = '
  • %s
  • ' % (loop_page, loop_page) 24 | else: 25 | page_ele = '
  • %s
  • ' % (loop_page, loop_page) 26 | return format_html(page_ele) 27 | else: 28 | return '' 29 | -------------------------------------------------------------------------------- /api/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /api/urls.py: -------------------------------------------------------------------------------- 1 | from . import views 2 | from django.urls import path 3 | app_name = "api" 4 | urlpatterns = [ 5 | path("dashBoard", views.dashBoard, name='dashBoard'), 6 | path("dashBoard_top100_case_time", views.dashBoard_top100_case_time, name='dashBoard_top100_case_time'), 7 | path("dashBoard_module_case", views.dashBoard_module_case, name='dashBoard_module_case'), 8 | path("dashBoard_top10_task", views.dashBoard_top10_task, name='dashBoard_top10_task'), 9 | path('', views.index, name='index'), 10 | path('login', views.login, name='login'), 11 | path('login_edit', views.login_edit, name='login_edit'), 12 | path('report_del', views.report_del, name='report_del'), 13 | path('download_log', views.download_log, name='download_log'), 14 | path('download_excel', views.download_excel, name='download_excel'), 15 | path('/report_detail/', views.report_detail, name='report_detail'), 16 | path('module', views.module, name='module'), 17 | path('module_new', views.module_new, name='module_new'), 18 | path('module_edit', views.module_edit, name='module_edit'), 19 | path('module_del', views.module_del, name='module_del'), 20 | path('/case/', views.case, name='case'), 21 | path('case_new', views.case_new, name='case_new'), 22 | path('case_new', views.case_new, name='case_new'), 23 | path('case_edit', views.case_edit, name='case_edit'), 24 | path('case_del', views.case_del, name='case_del'), 25 | path('//fuzz/', views.fuzz, name='fuzz'), # 第一个id为模块id,第二个为用例id 26 | path('batch_fuzz', views.batch_fuzz, name='batch_fuzz'), 27 | path('fuzz_new', views.fuzz_new, name='fuzz_new'), 28 | path('fuzz_edit', views.fuzz_edit, name='fuzz_edit'), 29 | path('fuzz_del', views.fuzz_del, name='fuzz_del'), 30 | path('task', views.task, name="task"), 31 | path('task_new', views.task_new, name="task_new"), 32 | path('task_edit', views.task_edit, name="task_edit"), 33 | path('task_del', views.task_del, name="task_del"), 34 | path('task_run', views.task_run, name="task_run"), 35 | path('task_module_new', views.task_module_new, name="task_module_new"), 36 | path('/task_module/', views.task_module, name="task_module"), 37 | path('task_module_edit', views.task_module_edit, name="task_module_edit"), 38 | path('task_module_del', views.task_module_del, name="task_module_del"), 39 | path('add', views.add, name="add") 40 | ] -------------------------------------------------------------------------------- /celery_redis_win.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/celery_redis_win.md -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/db.sqlite3 -------------------------------------------------------------------------------- /djangoApi/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | from .celery import app as celery_app 3 | __all__ = ['celery_app'] -------------------------------------------------------------------------------- /djangoApi/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/celery.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/celery.cpython-35.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/settings.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/settings.cpython-34.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/settings.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/settings.cpython-35.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/urls.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/urls.cpython-34.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/urls.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/urls.cpython-35.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/views.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/views.cpython-35.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/wsgi.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/wsgi.cpython-34.pyc -------------------------------------------------------------------------------- /djangoApi/__pycache__/wsgi.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/djangoApi/__pycache__/wsgi.cpython-35.pyc -------------------------------------------------------------------------------- /djangoApi/celery.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | # -*- coding=utf-8 -*- 3 | __author__ = 'shikun' 4 | __CreateAt__ = '2019/6/7-13:07' 5 | 6 | from celery import Celery 7 | from django.conf import settings 8 | import os 9 | 10 | # 获取当前文件夹名,即为该Django的项目名 11 | project_name = os.path.split(os.path.abspath('.'))[-1] 12 | project_settings = '%s.settings' % project_name 13 | print(project_name) 14 | 15 | # 设置环境变量 16 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', project_settings) 17 | 18 | # 实例化Celery 19 | # app = Celery(project_name) 20 | app = Celery('tasks', broker='redis://127.0.0.1:6379/0') 21 | # app = Celery('tasks', broker='redis://:xxxx@xxx.xxx.xxx.xx:6379/0') 22 | 23 | # 使用django的settings文件配置celery 24 | app.config_from_object('django.conf:settings') 25 | 26 | # Celery加载所有注册的应用 27 | app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) -------------------------------------------------------------------------------- /djangoApi/urls.py: -------------------------------------------------------------------------------- 1 | """djangoApi URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import include 18 | from django.urls import path 19 | 20 | from djangoApi import views 21 | 22 | urlpatterns = [ 23 | path('admin/', admin.site.urls), 24 | path('ui/', include('ui.urls')), 25 | path('api/', include('api.urls')), 26 | path('', views.index, name='index'), 27 | 28 | ] 29 | -------------------------------------------------------------------------------- /djangoApi/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | from django.template import loader 3 | 4 | 5 | def index(request): 6 | template = loader.get_template("index.html") 7 | return HttpResponse(template.render({}, request)) -------------------------------------------------------------------------------- /djangoApi/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for djangoApi project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoApi.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /img/dashborad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/img/dashborad.png -------------------------------------------------------------------------------- /img/fuzz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/img/fuzz.jpg -------------------------------------------------------------------------------- /img/report.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/img/report.jpg -------------------------------------------------------------------------------- /lib/pict33.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/lib/pict33.rar -------------------------------------------------------------------------------- /lib/requirements.txt: -------------------------------------------------------------------------------- 1 | xlsxwriter 2 | django -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoApi.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /ui/Report/0205b734-bbf0-11e9-a4c8-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/0205b734-bbf0-11e9-a4c8-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/0b45d006-bbf2-11e9-ad81-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/0b45d006-bbf2-11e9-ad81-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/0b5e785e-bb74-11e9-aae9-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/0b5e785e-bb74-11e9-aae9-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/1186a600-bbe8-11e9-9dd4-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/1186a600-bbe8-11e9-9dd4-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/14490b0c-bbe7-11e9-b2ad-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/14490b0c-bbe7-11e9-b2ad-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/39780022-bbf4-11e9-899f-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/39780022-bbf4-11e9-899f-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/41263490-bbee-11e9-96fa-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/41263490-bbee-11e9-96fa-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/50f8e142-bbe8-11e9-8b0f-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/50f8e142-bbe8-11e9-8b0f-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/5758f4be-bbf2-11e9-9aed-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/5758f4be-bbf2-11e9-9aed-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/5b6ddcd8-bbf5-11e9-8b54-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/5b6ddcd8-bbf5-11e9-8b54-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/5f5f5386-bb73-11e9-afab-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/5f5f5386-bb73-11e9-afab-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/6fc8f386-2aa6-11e9-83c0-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/6fc8f386-2aa6-11e9-83c0-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/71662d9e-bb72-11e9-b1ee-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/71662d9e-bb72-11e9-b1ee-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/77893022-bb77-11e9-a265-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/77893022-bb77-11e9-a265-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/8f8628a4-bb76-11e9-adeb-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/8f8628a4-bb76-11e9-adeb-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/9b97f718-bbe3-11e9-983f-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/9b97f718-bbe3-11e9-983f-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/abe9aedc-bbec-11e9-a1e5-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/abe9aedc-bbec-11e9-a1e5-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/b9e126ee-bbf3-11e9-ba41-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/b9e126ee-bbf3-11e9-ba41-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/bf169dc6-bbf0-11e9-ad33-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/bf169dc6-bbf0-11e9-ad33-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/c2b939b8-bbed-11e9-92ae-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/c2b939b8-bbed-11e9-92ae-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/c474154c-bbe6-11e9-8fa6-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/c474154c-bbe6-11e9-8fa6-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/cdca2dd8-bbe7-11e9-804e-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/cdca2dd8-bbe7-11e9-804e-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/d242d906-bbe0-11e9-b963-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/d242d906-bbe0-11e9-b963-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/d3a0feec-bbf4-11e9-8229-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/d3a0feec-bbf4-11e9-8229-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/d8fdf1d0-bb72-11e9-8ceb-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/d8fdf1d0-bb72-11e9-8ceb-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/e1e8c018-bbee-11e9-aca6-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/e1e8c018-bbee-11e9-aca6-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/ebcc39c6-bbec-11e9-8e60-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/ebcc39c6-bbec-11e9-8e60-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/Report/f0760800-bb76-11e9-a8e3-bcee7b76a849.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/Report/f0760800-bb76-11e9-a8e3-bcee7b76a849.xlsx -------------------------------------------------------------------------------- /ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__init__.py -------------------------------------------------------------------------------- /ui/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /ui/__pycache__/admin.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__pycache__/admin.cpython-35.pyc -------------------------------------------------------------------------------- /ui/__pycache__/apps.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__pycache__/apps.cpython-35.pyc -------------------------------------------------------------------------------- /ui/__pycache__/models.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__pycache__/models.cpython-35.pyc -------------------------------------------------------------------------------- /ui/__pycache__/urls.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__pycache__/urls.cpython-35.pyc -------------------------------------------------------------------------------- /ui/__pycache__/views.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/__pycache__/views.cpython-35.pyc -------------------------------------------------------------------------------- /ui/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /ui/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UiConfig(AppConfig): 5 | name = 'ui' 6 | -------------------------------------------------------------------------------- /ui/base/BaseElementEnmu.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | import os 5 | 6 | PATH = lambda p: os.path.abspath( 7 | os.path.join(os.path.dirname(__file__), p) 8 | ) 9 | 10 | 11 | class Element(object): 12 | # selenium关键字 13 | find_element_by_id = "id" 14 | find_elements_by_id = "ids" 15 | INDEX = "index" 16 | find_elements_by_xpath = "xpaths" 17 | find_element_by_xpath = "xpath" 18 | find_element_by_css_selector = "css" 19 | find_element_by_class_name = "class_name" 20 | find_element_by_name = "by_name" 21 | find_element_by_link_text = "link_text" 22 | CLICK = "click" 23 | GET_TEXT = "get_text" 24 | SEND_KEYS = "send_keys" 25 | GET_VALUE = "get_value" 26 | WAIT_TIME = 20 # 查找元素等待时间 27 | MOVE_TO_ELEMENT = "move_to_element" # 鼠标悬停 28 | NO_OPERATE = "0" # 无操作 29 | DEFAULT_OPERATE = "default_operate" # 默认值 30 | SWITCH_TO_WINDOW = "switch_to_window" 31 | SWITCH_TO_FRAME = "switch_to_frame" 32 | SWITCH_TO_DEFAULT_CONTENT = "switch_to_default_content" 33 | 34 | # 错误日志 35 | TIME_OUT = "timeout" 36 | NO_SUCH = "noSuch" 37 | WEB_DROVER_EXCEPTION = "WebDriverException" 38 | INDEX_ERROR = "index_error" 39 | STALE_ELEMENT_REFERENCE_EXCEPTION = "StaleElementReferenceException" 40 | DEFAULT_ERROR = "default_error" 41 | 42 | # 检查点 43 | CONTRARY = "contrary" # 相反检查点,表示如果检查元素存在就说明失败,如删除后,此元素依然存在 44 | CONTRARY_GETVAL = "contrary_getval" # 检查点关键字contrary_getval: 相反值检查点,如果对比成功,说明失败 45 | DEFAULT_CHECK = "default_check" # 默认检查点,就是查找页面元素 46 | COMPARE = "compare" # 历史数据和实际数据对比 47 | 48 | RE_CONNECT = 1 # 是否打开失败后再次运行一次用例 49 | 50 | REPORT_FILE = PATH("../Report/") # 测试报告 51 | 52 | C_CHECK = {"passed": 0, "failed": -1, "no_check": -2} 53 | -------------------------------------------------------------------------------- /ui/base/BaseError.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from .BaseElementEnmu import Element 5 | 6 | """ 7 | element_info: 元素 8 | info: 用例说明 9 | current: 当前值 10 | history: 历史值 11 | type: 错误类型 12 | """ 13 | 14 | 15 | def get_error(kw): 16 | elements = { 17 | Element.TIME_OUT: lambda: "%s请求超时" % kw["element_info"], 18 | Element.NO_SUCH: lambda: "%s不存在" % kw["element_info"], 19 | Element.WEB_DROVER_EXCEPTION: lambda: "%s的driver错误" % kw["element_info"], 20 | Element.INDEX_ERROR: lambda: "%s索引错误" % kw["element_info"], 21 | Element.STALE_ELEMENT_REFERENCE_EXCEPTION: lambda: " %s页面元素已经发生 " % kw["element_info"], 22 | Element.DEFAULT_ERROR: lambda: " 请检查%s " % kw["element_info"], 23 | Element.CONTRARY: lambda: " 检查点_%s失败_%s依然在页面 " % (kw["info"], kw["element_info"]), 24 | Element.CONTRARY_GETVAL: lambda: " 检查点_对比数据失败,当前取到到数据为:%s,历史取到数据为:%s" % (kw["current"], kw["history"]), 25 | Element.DEFAULT_CHECK: lambda: " 检查点_%s失败,请检查_%s " % (kw["info"], kw["element_info"]), 26 | Element.COMPARE: lambda: " 检查点_对比数据失败,当前取到到数据为:%s,历史取到数据为:%s" % (kw["current"], kw["history"]) 27 | } 28 | return elements[kw["type"]]() 29 | -------------------------------------------------------------------------------- /ui/base/BaseFile.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | import os 5 | import time 6 | 7 | ''' 8 | 操作文件 9 | ''' 10 | 11 | 12 | class BaseFile(object): 13 | def __init__(self): 14 | pass 15 | 16 | @staticmethod 17 | def check_file(path): 18 | if not os.path.isfile(path): 19 | # sys.exit() 20 | return False 21 | else: 22 | return True 23 | 24 | @staticmethod 25 | def mk_file(path): 26 | with open(path, 'w', encoding="utf-8") as f: 27 | print("创建文件成功") 28 | 29 | @staticmethod 30 | def mk_write(path, line): 31 | time.sleep(1) 32 | with open(path, 'a') as fileHandle: 33 | fileHandle.write(line + "\n") 34 | 35 | @staticmethod 36 | def mk_read(path): 37 | result = [] 38 | with open(path, 'r', encoding="utf-8") as fileHandle: 39 | file_list = fileHandle.readlines() 40 | for i in file_list: 41 | temp = [i.replace("\t", ",").strip("\n")] 42 | result.append(temp) 43 | return result 44 | 45 | @staticmethod 46 | def remove_file(path): 47 | if not os.path.isfile(path): 48 | os.remove(path) 49 | 50 | 51 | if __name__ == '__main__': 52 | pass 53 | -------------------------------------------------------------------------------- /ui/base/BaseView.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from datetime import datetime 5 | import xlsxwriter 6 | from selenium import webdriver 7 | from ..base.BaseElementEnmu import Element 8 | from ..base.BaseExcel import OperateReport 9 | from ..base.BaseFile import BaseFile 10 | from ..models import Report 11 | import os 12 | from .BasePage import PagesObjects 13 | 14 | PATH = lambda p: os.path.abspath( 15 | os.path.join(os.path.dirname(__file__), p) 16 | ) 17 | 18 | 19 | def get_driver(login_url): 20 | chrome_driver = PATH("../lib/chromedriver.exe") 21 | os.environ["webdriver.chrome.driver"] = chrome_driver 22 | driver = webdriver.Chrome(chrome_driver) 23 | driver.maximize_window() # 将浏览器最大化 24 | driver.get(login_url) 25 | return driver 26 | 27 | 28 | def get_login(kw): 29 | app = {"log_test": kw["log_test"], "driver": kw["driver"], "name": kw["name"], "test_step": [kw["test_step"]]} 30 | page = PagesObjects(app) 31 | return page.operate() 32 | 33 | 34 | ''' 35 | 新建测试报告 36 | name 37 | uid 38 | ''' 39 | 40 | 41 | def new_report(kw): 42 | start_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') 43 | _report = Report(name=kw["name"], start_time=start_time, report_path=kw["uid"], log=kw["uid"]) 44 | _report.save() 45 | return _report 46 | 47 | 48 | ''' 49 | 编辑测试报告模块 50 | report : model 51 | ''' 52 | 53 | 54 | def edit_report(kw): 55 | kw["report"].sum_time = kw["sum_time"] 56 | kw["report"].passed = kw["passed"] 57 | kw["report"].failed = kw["failed"] 58 | # kw["report"].no_check = kw["no_check"] 59 | kw["report"].save() 60 | 61 | 62 | ''' 63 | 新建测试报告详情 64 | report : model report 65 | ''' 66 | 67 | 68 | def new_report_item(kw): 69 | kw["report"].reportitem_set.create(name=kw["name"], step=kw["step"], hope=kw["hope"], sum_time=kw["sum_time"], 70 | result=kw['result'], img=kw.get("img2", "0"), extend=kw["extend"]) 71 | 72 | ''' 73 | 生成excel报告 74 | ''' 75 | 76 | 77 | def write_excel(kw): 78 | bf = BaseFile() 79 | files = Element.REPORT_FILE + "\\" + kw["uid"] + ".xlsx" 80 | bf.mk_file(files) 81 | 82 | workbook = xlsxwriter.Workbook(files, {"string_to_urls": False}) 83 | worksheet1 = workbook.add_worksheet("测试总况") 84 | op_report = OperateReport(workbook) 85 | op_report.init(worksheet1, kw["excel_init"]) 86 | worksheet2 = workbook.add_worksheet("测试详情") 87 | op_report.detail(worksheet2, kw["excel_detail"]) 88 | op_report.close() 89 | -------------------------------------------------------------------------------- /ui/base/BaseViewCase.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Module, Case 9 | 10 | 11 | class BaseViewCase: 12 | 13 | @staticmethod 14 | def case(request, path, mid): 15 | mo = Module.objects.get(pk=mid) 16 | template = loader.get_template(path) 17 | context = {'case_list': mo.case_set.all(), "mid": mid, "name": mo.name} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def case_new(kw): 23 | mo = Module.objects.get(pk=kw["mid"]) 24 | name = kw["name"] 25 | mo.case_set.create(name=name) 26 | result = {'code': 0, 'msg': '保存成功'} 27 | return JsonResponse(result) 28 | 29 | @staticmethod 30 | @csrf_exempt 31 | def case_edit(kw): 32 | c = Case.objects.get(pk=kw["cid"]) 33 | c.name = kw["name"] 34 | c.save() 35 | result = {'code': 0, 'msg': '编辑成功'} 36 | return JsonResponse(result) 37 | 38 | @staticmethod 39 | @csrf_exempt 40 | def case_del(cid): 41 | c = Case.objects.get(pk=cid) 42 | c.delete() 43 | result = {'code': 0, 'msg': '删除成功'} 44 | return JsonResponse(result) 45 | -------------------------------------------------------------------------------- /ui/base/BaseViewCaseCommonCase.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding=utf-8 -*- 3 | __author__ = 'shikun' 4 | __CreateAt__ = '2019/8/10-11:04' 5 | from django.http import JsonResponse 6 | from django.http import HttpResponse 7 | from django.template import loader 8 | from django.views.decorators.csrf import csrf_exempt 9 | from ..models import Case, CaseCommonCase, CommonCase 10 | 11 | ''' 12 | 用例关联公共用例 13 | ''' 14 | 15 | 16 | class BaseViewCaseCommonCase: 17 | 18 | @staticmethod 19 | def case_common_case(request, path, mid, cid): 20 | template = loader.get_template(path) 21 | ca = Case.objects.get(pk=cid) 22 | context = {"cid": cid, "common_case_list": ca.casecommoncase_set.order_by("sort"), 23 | "name": ca.name, "mid": mid, "common_case": CommonCase.objects.all()} 24 | return HttpResponse(template.render(context, request)) 25 | 26 | @staticmethod 27 | @csrf_exempt 28 | def case_common_case_new(kw): 29 | ta = Case.objects.get(pk=kw["cid"]) 30 | ta.casecommoncase_set.create(name=kw["name"], cc_id=kw["cc_id"], sort=kw["sort"]) 31 | result = {'code': 0, 'msg': '保存成功'} 32 | return JsonResponse(result) 33 | 34 | @staticmethod 35 | @csrf_exempt 36 | def case_common_case_edit(kw): 37 | tm = CaseCommonCase.objects.get(pk=kw["ccc_id"]) 38 | tm.name = kw["name"] 39 | tm.cc_id = kw["cc_id"] 40 | tm.sort = kw["sort"] 41 | tm.save() 42 | result = {'code': 0, 'msg': '编辑成功'} 43 | return JsonResponse(result) 44 | 45 | @staticmethod 46 | @csrf_exempt 47 | def case_common_case_del(ccs_id): 48 | tm = CaseCommonCase.objects.get(pk=ccs_id) 49 | tm.delete() 50 | result = {'code': 0, 'msg': '删除成功'} 51 | return JsonResponse(result) 52 | -------------------------------------------------------------------------------- /ui/base/BaseViewCheck.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Checks, Case 9 | 10 | 11 | class BaseViewCheck: 12 | 13 | @staticmethod 14 | def check(request, path, mid, cid): 15 | ca = Case.objects.get(pk=cid) 16 | template = loader.get_template(path) 17 | context = {'check_list': ca.checks_set.all(), "cid": cid, "name": ca.name, "mid": mid} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def check_new(kw): 23 | ca = Case.objects.get(pk=kw["cid"]) 24 | name = kw["name"] 25 | element_info = kw["element_info"] 26 | find_type = kw["find_type"] 27 | operate_type = kw["operate_type"] 28 | extend = kw["extend"] 29 | ca.checks_set.create(name=name, element_info=element_info, find_type=find_type, operate_type=operate_type, 30 | extend=extend) 31 | result = {'code': 0, 'msg': '保存成功'} 32 | return JsonResponse(result) 33 | 34 | @staticmethod 35 | @csrf_exempt 36 | def check_edit(kw): 37 | c = Checks.objects.get(pk=kw["chid"]) 38 | c.name = kw["name"] 39 | c.element_info = kw["element_info"] 40 | c.find_type = kw["find_type"] 41 | c.operate_type = kw["operate_type"] 42 | c.extend = kw["extend"] 43 | c.save() 44 | result = {'code': 0, 'msg': '编辑成功'} 45 | return JsonResponse(result) 46 | 47 | @staticmethod 48 | @csrf_exempt 49 | def check_del(chid): 50 | c = Case.objects.get(pk=chid) 51 | c.delete() 52 | result = {'code': 0, 'msg': '删除成功'} 53 | return JsonResponse(result) 54 | -------------------------------------------------------------------------------- /ui/base/BaseViewCommonCase.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding=utf-8 -*- 3 | __author__ = 'shikun' 4 | __CreateAt__ = '2019/8/10-11:04' 5 | 6 | from django.http import JsonResponse 7 | from django.http import HttpResponse 8 | from django.template import loader 9 | from django.views.decorators.csrf import csrf_exempt 10 | from ..models import CommonCase 11 | 12 | ''' 13 | 公共用例 14 | ''' 15 | 16 | 17 | class BaseViewCommonCase: 18 | @staticmethod 19 | def common_case(request, path): 20 | template = loader.get_template(path) 21 | context = {'case_list': CommonCase.objects.all()} 22 | return HttpResponse(template.render(context, request)) 23 | 24 | @staticmethod 25 | @csrf_exempt 26 | def common_case_new(name): 27 | CommonCase(name=name).save() 28 | result = {'code': 0, 'msg': '保存成功'} 29 | return JsonResponse(result) 30 | 31 | @staticmethod 32 | @csrf_exempt 33 | def common_case_edit(kw): 34 | id = kw["id"] 35 | name = kw["name"] 36 | ta = CommonCase.objects.get(pk=id) 37 | ta.name = name 38 | ta.save() 39 | result = {'code': 0, 'msg': '编辑成功'} 40 | return JsonResponse(result) 41 | 42 | @staticmethod 43 | @csrf_exempt 44 | def common_case_del(id): 45 | ta = CommonCase.objects.get(pk=id) 46 | ta.delete() 47 | result = {'code': 0, 'msg': '删除成功'} 48 | return JsonResponse(result) 49 | -------------------------------------------------------------------------------- /ui/base/BaseViewCommonCaseStep.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding=utf-8 -*- 3 | __author__ = 'shikun' 4 | __CreateAt__ = '2019/8/10-11:04' 5 | from django.http import JsonResponse 6 | from django.http import HttpResponse 7 | from django.template import loader 8 | from django.views.decorators.csrf import csrf_exempt 9 | from ..models import CommonCase, CommonCaseStep 10 | 11 | ''' 12 | 公共用例下的步骤 13 | ''' 14 | 15 | 16 | class BaseViewCommonCaseStep: 17 | 18 | @staticmethod 19 | def common_case_step(request, path, cc_id): 20 | ca = CommonCase.objects.get(pk=cc_id) 21 | template = loader.get_template(path) 22 | context = {'step_list': ca.commoncasestep_set.order_by("sort"), "cc_id": cc_id, "name": ca.name} 23 | return HttpResponse(template.render(context, request)) 24 | 25 | @staticmethod 26 | @csrf_exempt 27 | def common_case_step_new(kw): 28 | ca = CommonCase.objects.get(pk=kw["cc_id"]) 29 | name = kw["name"] 30 | element_info = kw["element_info"] 31 | find_type = kw["find_type"] 32 | operate_type = kw["operate_type"] 33 | extend = kw["extend"] 34 | sort = kw.get("sort", 0) 35 | 36 | ca.commoncasestep_set.create(name=name, element_info=element_info, find_type=find_type, 37 | operate_type=operate_type, 38 | extend=extend, sort=sort) 39 | result = {'code': 0, 'msg': '保存成功'} 40 | return JsonResponse(result) 41 | 42 | @staticmethod 43 | @csrf_exempt 44 | def common_case_step_edit(kw): 45 | c = CommonCaseStep.objects.get(pk=kw["ccs_id"]) 46 | c.name = kw["name"] 47 | c.element_info = kw["element_info"] 48 | c.find_type = kw["find_type"] 49 | c.operate_type = kw["operate_type"] 50 | c.extend = kw["extend"] 51 | c.sort = kw["sort"] 52 | c.save() 53 | result = {'code': 0, 'msg': '编辑成功'} 54 | return JsonResponse(result) 55 | 56 | @staticmethod 57 | @csrf_exempt 58 | def common_case_step_del(ccs_id): 59 | c = CommonCaseStep.objects.get(pk=ccs_id) 60 | c.delete() 61 | result = {'code': 0, 'msg': '删除成功'} 62 | return JsonResponse(result) 63 | -------------------------------------------------------------------------------- /ui/base/BaseViewDashBoard.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse, HttpResponse 5 | from django.template import loader 6 | 7 | from ..models import * 8 | 9 | 10 | class BaseViewDashBoard: 11 | 12 | @staticmethod 13 | def dashBoard(request, path): 14 | template = loader.get_template(path) 15 | return HttpResponse(template.render({}, request)) 16 | 17 | # 模块下用例统计 18 | @staticmethod 19 | def dashBoard_module_case(request): 20 | mo = Module.objects.all() 21 | data = [] 22 | for i in mo: 23 | list_case = Module.objects.get(pk=i.id).case_set.all() 24 | if not list_case: 25 | result = {'code': -1, 'msg': '无测试用例'} 26 | return JsonResponse(result) 27 | num = 0 28 | temp = [] 29 | for c in list_case: 30 | # ls_fuzz = Case.objects.get(pk=c.id).fuzzcase_set.all() 31 | # if ls_fuzz: # 如果用模糊用例 32 | # for fu in ls_fuzz: 33 | # num += 1 34 | num += 1 35 | temp.append(i.name) 36 | temp.append(num) 37 | data.append(temp) 38 | result = {'code': 0, "data": data} 39 | return JsonResponse(result) 40 | 41 | ''' 42 | 前十个task的用例执行情况 43 | ''' 44 | 45 | @staticmethod 46 | def dashBoard_top10_task(request): 47 | rp = Report.objects.order_by("-id")[1:10] 48 | data = [] 49 | categories = [] 50 | # [{name: '读请求',data:rtps 51 | passed = {"data": [], "name": "通过"} 52 | # no_check = {"data": [], "name": "未检测"} 53 | failed = {"data": [], "name": "失败", "color": "red"} 54 | for i in rp: 55 | print(i.id) 56 | passed["data"].append(i.passed) 57 | failed["data"].append(i.failed) 58 | # no_check["data"].append(i.no_check) 59 | categories.append(i.name) 60 | data.append(passed) 61 | data.append(failed) 62 | # data.append(no_check) 63 | result = {'code': 0, "data": data} 64 | return JsonResponse(result) 65 | 66 | ''' 67 | 前100个case的耗时情况 68 | ''' 69 | 70 | @staticmethod 71 | def dashBoard_top100_case_time(request): 72 | data = [] 73 | rps = ReportItem.objects.order_by()[1:100] 74 | for i in rps: 75 | sum_time = float(i.sum_time.split("秒")[0]) 76 | data.append(sum_time) 77 | result = {'code': 0, "data": [{"name":"耗时", "data":data}]} 78 | return JsonResponse(result) 79 | -------------------------------------------------------------------------------- /ui/base/BaseViewLogin.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | import ast 5 | from django.http import JsonResponse 6 | from django.http import HttpResponse 7 | from django.template import loader 8 | from django.views.decorators.csrf import csrf_exempt 9 | from ..models import Login 10 | 11 | 12 | class BaseViewLogin: 13 | 14 | @staticmethod 15 | def login(request, path): 16 | template = loader.get_template(path) 17 | context = {'login_list': Login.objects.order_by("sort")} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def login_edit(kw): 23 | print(kw) 24 | l = Login.objects.get(pk=kw["id"]) 25 | l.find_type = kw["find_type"] 26 | l.name = kw["name"] 27 | l.element_info = kw["element_info"] 28 | l.operate_type = kw["operate_type"] 29 | l.extend = kw["extend"] 30 | l.sort = kw["sort"] 31 | l.save() 32 | result = {'code': 0, 'msg': '保存成功'} 33 | return JsonResponse(result) 34 | 35 | @staticmethod 36 | @csrf_exempt 37 | def login_new(kw): 38 | name = kw["name"] 39 | find_type = kw["find_type"] 40 | element_info = kw["element_info"] 41 | operate_type = kw["operate_type"] 42 | extend = kw["extend"] 43 | sort = kw["sort"] 44 | Login(find_type=find_type, element_info=element_info, operate_type=operate_type, extend=extend, sort=sort, 45 | name=name).save() 46 | result = {'code': 0, 'msg': '保存成功'} 47 | return JsonResponse(result) 48 | 49 | @staticmethod 50 | @csrf_exempt 51 | def login_del(lid): 52 | Login(pk=lid).delete() 53 | result = {'code': 0, 'msg': '删除成功'} 54 | return JsonResponse(result) 55 | -------------------------------------------------------------------------------- /ui/base/BaseViewModule.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Module, Case 9 | 10 | 11 | class BaseViewModule: 12 | 13 | @staticmethod 14 | def module(request, path): 15 | template = loader.get_template(path) 16 | context = {'module_list': Module.objects.all()} 17 | return HttpResponse(template.render(context, request)) 18 | 19 | @staticmethod 20 | @csrf_exempt 21 | def module_new(name): 22 | Module(name=name).save() 23 | result = {'code': 0, 'msg': '保存成功'} 24 | return JsonResponse(result) 25 | 26 | @staticmethod 27 | @csrf_exempt 28 | def module_edit(kw): 29 | m_id = kw["id"] 30 | name = kw["name"] 31 | m = Module.objects.get(pk=m_id) 32 | m.name = name 33 | m.save() 34 | result = {'code': 0, 'msg': '编辑成功'} 35 | return JsonResponse(result) 36 | 37 | @staticmethod 38 | @csrf_exempt 39 | def module_del(id): 40 | m = Module.objects.get(pk=id) 41 | m.delete() 42 | result = {'code': 0, 'msg': '删除成功'} 43 | return JsonResponse(result) 44 | -------------------------------------------------------------------------------- /ui/base/BaseViewSetting.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Setting 9 | 10 | 11 | class BaseViewSetting: 12 | 13 | @staticmethod 14 | def setting(request, path): 15 | template = loader.get_template(path) 16 | context = {'setting': Setting.objects.get(pk=1)} 17 | return HttpResponse(template.render(context, request)) 18 | 19 | @staticmethod 20 | @csrf_exempt 21 | def setting_edit(kw): 22 | try: 23 | l = Setting.objects.get(pk=1) 24 | l.home_url = kw["home_url"] 25 | l.login_url = kw["login_url"] 26 | l.save() 27 | result = {'code': 0, 'msg': '保存成功'} 28 | except : 29 | result = {'code': -1, 'msg': '保存失败'} 30 | return JsonResponse(result) 31 | -------------------------------------------------------------------------------- /ui/base/BaseViewStep.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Steps, Case 9 | 10 | 11 | class BaseViewStep: 12 | 13 | @staticmethod 14 | def step(request, path, mid, cid): 15 | ca = Case.objects.get(pk=cid) 16 | template = loader.get_template(path) 17 | context = {'step_list': ca.steps_set.order_by("sort"), "cid": cid, "name": ca.name, "mid": mid} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def step_new(kw): 23 | ca = Case.objects.get(pk=kw["cid"]) 24 | name = kw["name"] 25 | element_info = kw["element_info"] 26 | find_type = kw["find_type"] 27 | operate_type = kw["operate_type"] 28 | extend = kw["extend"] 29 | sort = kw.get("sort", 0) 30 | 31 | ca.steps_set.create(name=name, element_info=element_info, find_type=find_type, operate_type=operate_type, 32 | extend=extend, sort=sort) 33 | result = {'code': 0, 'msg': '保存成功'} 34 | return JsonResponse(result) 35 | 36 | @staticmethod 37 | @csrf_exempt 38 | def step_edit(kw): 39 | c = Steps.objects.get(pk=kw["sid"]) 40 | c.name = kw["name"] 41 | c.element_info = kw["element_info"] 42 | c.find_type = kw["find_type"] 43 | c.operate_type = kw["operate_type"] 44 | c.extend = kw["extend"] 45 | c.sort = kw["sort"] 46 | c.save() 47 | result = {'code': 0, 'msg': '编辑成功'} 48 | return JsonResponse(result) 49 | 50 | @staticmethod 51 | @csrf_exempt 52 | def step_del(sid): 53 | c = Steps.objects.get(pk=sid) 54 | c.delete() 55 | result = {'code': 0, 'msg': '删除成功'} 56 | return JsonResponse(result) 57 | -------------------------------------------------------------------------------- /ui/base/BaseViewTaskModule.py: -------------------------------------------------------------------------------- 1 | # -*- coding=utf-8 -*- 2 | __author__ = 'shikun' 3 | __CreateAt__ = '2019/6/7-13:07' 4 | from django.http import JsonResponse 5 | from django.http import HttpResponse 6 | from django.template import loader 7 | from django.views.decorators.csrf import csrf_exempt 8 | from ..models import Task, TaskModule, Module 9 | 10 | 11 | class BaseViewTaskModule: 12 | 13 | @staticmethod 14 | def task_module(request, path, id): 15 | template = loader.get_template(path) 16 | ta = Task.objects.get(pk=id) 17 | context = {'ta_module_list': ta.taskmodule_set.all(), "tid": id, "module_list": Module.objects.all(), "name": ta.name} 18 | return HttpResponse(template.render(context, request)) 19 | 20 | @staticmethod 21 | @csrf_exempt 22 | def task_module_new(tid, name, mid): 23 | ta = Task.objects.get(pk=tid) 24 | ta.taskmodule_set.create(name=name, mid=mid) 25 | result = {'code': 0, 'msg': '保存成功'} 26 | return JsonResponse(result) 27 | 28 | @staticmethod 29 | @csrf_exempt 30 | def task_module_edit(kw): 31 | tm = TaskModule.objects.get(pk=kw["tmid"]) 32 | tm.name = kw["name"] 33 | tm.mid = kw["mid"] 34 | tm.save() 35 | result = {'code': 0, 'msg': '编辑成功'} 36 | return JsonResponse(result) 37 | 38 | @staticmethod 39 | @csrf_exempt 40 | def task_module_del(tmid): 41 | tm = TaskModule.objects.get(pk=tmid) 42 | tm.delete() 43 | result = {'code': 0, 'msg': '删除成功'} 44 | return JsonResponse(result) 45 | -------------------------------------------------------------------------------- /ui/base/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__init__.py -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseElementEnmu.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseElementEnmu.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseError.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseError.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseExcel.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseExcel.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseFile.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseFile.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseLog.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseLog.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseOperate.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseOperate.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BasePage.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BasePage.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseReport.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseReport.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseView.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseView.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewCase.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewCase.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewCaseCommonCase.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewCaseCommonCase.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewCheck.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewCheck.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewCommonCase.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewCommonCase.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewCommonCaseStep.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewCommonCaseStep.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewDashboard.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewDashboard.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewLogin.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewLogin.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewModule.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewModule.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewSetting.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewSetting.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewStep.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewStep.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewTask.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewTask.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/BaseViewTaskModule.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/BaseViewTaskModule.cpython-35.pyc -------------------------------------------------------------------------------- /ui/base/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/base/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /ui/lib/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/lib/chromedriver.exe -------------------------------------------------------------------------------- /ui/migrations/0002_steps_sort.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.4 on 2019-01-28 13:20 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('ui', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='steps', 15 | name='sort', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /ui/migrations/0003_casecommoncase_commoncase_commoncasestep.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.4 on 2019-08-10 08:19 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('ui', '0002_steps_sort'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='CaseCommonCase', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('cc_id', models.IntegerField(default=0)), 19 | ('name', models.CharField(max_length=100)), 20 | ('sort', models.IntegerField(default=0)), 21 | ('case', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='ui.Case')), 22 | ], 23 | ), 24 | migrations.CreateModel( 25 | name='CommonCase', 26 | fields=[ 27 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 28 | ('name', models.CharField(default='', max_length=100)), 29 | ], 30 | ), 31 | migrations.CreateModel( 32 | name='CommonCaseStep', 33 | fields=[ 34 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 35 | ('name', models.CharField(max_length=100)), 36 | ('element_info', models.CharField(max_length=300)), 37 | ('find_type', models.CharField(max_length=300)), 38 | ('operate_type', models.CharField(max_length=100)), 39 | ('extend', models.CharField(max_length=100)), 40 | ('sort', models.IntegerField(default=0)), 41 | ('commonCase', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ui.CommonCase')), 42 | ], 43 | ), 44 | ] 45 | -------------------------------------------------------------------------------- /ui/migrations/0004_reportitem_img.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.4 on 2019-08-10 13:22 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('ui', '0003_casecommoncase_commoncase_commoncasestep'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='reportitem', 15 | name='img', 16 | field=models.CharField(default='', max_length=100), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /ui/migrations/0005_reportitem_extend.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.4 on 2019-08-11 02:55 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('ui', '0004_reportitem_img'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='reportitem', 15 | name='extend', 16 | field=models.CharField(default='', max_length=100), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /ui/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__init__.py -------------------------------------------------------------------------------- /ui/migrations/__pycache__/0001_initial.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__pycache__/0001_initial.cpython-35.pyc -------------------------------------------------------------------------------- /ui/migrations/__pycache__/0002_steps_sort.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__pycache__/0002_steps_sort.cpython-35.pyc -------------------------------------------------------------------------------- /ui/migrations/__pycache__/0003_casecommoncase_commoncase_commoncasestep.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__pycache__/0003_casecommoncase_commoncase_commoncasestep.cpython-35.pyc -------------------------------------------------------------------------------- /ui/migrations/__pycache__/0004_reportitem_img.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__pycache__/0004_reportitem_img.cpython-35.pyc -------------------------------------------------------------------------------- /ui/migrations/__pycache__/0005_reportitem_extend.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__pycache__/0005_reportitem_extend.cpython-35.pyc -------------------------------------------------------------------------------- /ui/migrations/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/migrations/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /ui/static/assets/brand/bootstrap-outline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ui/static/assets/brand/bootstrap-punchout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ui/static/assets/brand/bootstrap-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ui/static/assets/css/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-ms-viewport { width: device-width; } 12 | @-o-viewport { width: device-width; } 13 | @viewport { width: device-width; } 14 | -------------------------------------------------------------------------------- /ui/static/assets/flash/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/flash/ZeroClipboard.swf -------------------------------------------------------------------------------- /ui/static/assets/img/components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/components.png -------------------------------------------------------------------------------- /ui/static/assets/img/devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/devices.png -------------------------------------------------------------------------------- /ui/static/assets/img/expo-lyft.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/expo-lyft.jpg -------------------------------------------------------------------------------- /ui/static/assets/img/expo-newsweek.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/expo-newsweek.jpg -------------------------------------------------------------------------------- /ui/static/assets/img/expo-riot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/expo-riot.jpg -------------------------------------------------------------------------------- /ui/static/assets/img/expo-vogue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/expo-vogue.jpg -------------------------------------------------------------------------------- /ui/static/assets/img/sass-less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/img/sass-less.png -------------------------------------------------------------------------------- /ui/static/assets/js/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /ui/static/assets/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /ui/static/assets/js/ie8-responsive-file-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2011-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8. 11 | if (window.location.protocol == 'file:') { 12 | window.alert('ERROR: Bootstrap\'s responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.') 13 | } 14 | -------------------------------------------------------------------------------- /ui/static/assets/js/vendor/autoprefixer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/assets/js/vendor/autoprefixer.js -------------------------------------------------------------------------------- /ui/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | 11 | /* 12 | * Global add-ons 13 | */ 14 | 15 | .sub-header { 16 | padding-bottom: 10px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Top navigation 22 | * Hide default border to remove 1px line. 23 | */ 24 | .navbar-fixed-top { 25 | border: 0; 26 | } 27 | 28 | /* 29 | * Sidebar 30 | */ 31 | 32 | /* Hide for mobile, show later */ 33 | .sidebar { 34 | display: none; 35 | } 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | .nav-sidebar > li > a { 59 | padding-right: 20px; 60 | padding-left: 20px; 61 | } 62 | .nav-sidebar > .active > a, 63 | .nav-sidebar > .active > a:hover, 64 | .nav-sidebar > .active > a:focus { 65 | color: #fff; 66 | background-color: #428bca; 67 | } 68 | 69 | 70 | /* 71 | * Main content 72 | */ 73 | 74 | .main { 75 | padding: 20px; 76 | } 77 | @media (min-width: 768px) { 78 | .main { 79 | padding-right: 40px; 80 | padding-left: 40px; 81 | } 82 | } 83 | .main .page-header { 84 | margin-top: 0; 85 | } 86 | 87 | 88 | /* 89 | * Placeholder dashboard ideas 90 | */ 91 | 92 | .placeholders { 93 | margin-bottom: 30px; 94 | text-align: center; 95 | } 96 | .placeholders h4 { 97 | margin-bottom: 0; 98 | } 99 | .placeholder { 100 | margin-bottom: 20px; 101 | } 102 | .placeholder img { 103 | display: inline-block; 104 | border-radius: 50%; 105 | } 106 | -------------------------------------------------------------------------------- /ui/static/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /ui/static/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /ui/static/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /ui/static/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/static/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /ui/static/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /ui/static/js/Highcharts-7.1.2/highColumn.js: -------------------------------------------------------------------------------- 1 | function highColumn(id, title, yAxis_title,data) { 2 | 3 | Highcharts.chart(id, { 4 | chart: { 5 | type: 'column' 6 | }, 7 | title: { 8 | text: title 9 | }, 10 | credits: { 11 | enabled: false 12 | }, 13 | subtitle: { 14 | text: '' 15 | }, 16 | xAxis: { 17 | // categories:["测试1","测试2"], 18 | type: 'category', 19 | labels: { 20 | rotation: -45, 21 | style: { 22 | fontSize: '13px', 23 | fontFamily: 'Verdana, sans-serif' 24 | } 25 | } 26 | }, 27 | yAxis: { 28 | min: 0, 29 | title: { 30 | text: yAxis_title 31 | } 32 | }, 33 | legend: { 34 | enabled: false 35 | }, 36 | tooltip: { 37 | pointFormat: '{point.y:.0f} ' 38 | }, 39 | series: [{ 40 | //name: 'Population', 41 | // data:[["shanghai", 24.2],["shanghai", 24.2]] 42 | data: data, 43 | dataLabels: { 44 | enabled: true, 45 | rotation: -90, 46 | color: '#FFFFFF', 47 | align: 'right', 48 | format: '{point.y:.0f}', // one decimal 49 | y: 10, // 10 pixels down from the top 50 | style: { 51 | fontSize: '13px', 52 | fontFamily: 'Verdana, sans-serif' 53 | } 54 | } 55 | }] 56 | }); 57 | } -------------------------------------------------------------------------------- /ui/static/js/Highcharts-7.1.2/highLine.js: -------------------------------------------------------------------------------- 1 | function highLine(id,h_title,h_yaxis_title,h_tooltip,h_series){ 2 | $(id).highcharts({ 3 | // chart: { 4 | // type: 'line' 5 | // }, 6 | title: { 7 | text: h_title, 8 | x: -20 //center 9 | }, 10 | subtitle: { 11 | text: "", 12 | x: -20 13 | }, 14 | xAxis: { 15 | // labels: { 16 | // step: h_xaxis_setp 17 | // }, 18 | categories: "" 19 | }, 20 | yAxis: { 21 | title: { 22 | text: h_yaxis_title 23 | }, 24 | plotLines: [{ 25 | value: 0, 26 | width: 1, 27 | color: '#808080' 28 | }] 29 | }, 30 | tooltip: { 31 | valueSuffix: h_tooltip 32 | }, 33 | legend: { 34 | layout: 'vertical', 35 | align: 'right', 36 | verticalAlign: 'middle', 37 | borderWidth: 1 38 | }, 39 | series: h_series 40 | }); 41 | 42 | } -------------------------------------------------------------------------------- /ui/static/js/common1.js: -------------------------------------------------------------------------------- 1 | ;(function ($) { 2 | $.rpc = {}; 3 | $.rpc.req = function (url, type, data, cb) { 4 | $.ajax({ 5 | url: url , 6 | type:type, 7 | dataType:"json", 8 | // timeout:500, 9 | error:function (xhr) { 10 | if ($.isFunction(cb)) { 11 | cb(null); 12 | } 13 | }, 14 | data:data, 15 | success:function (data) { 16 | if ($.isFunction(cb)) { 17 | cb(data); 18 | } 19 | } 20 | }); 21 | 22 | }; 23 | })(jQuery); 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ui/static/js/dashBoard.js: -------------------------------------------------------------------------------- 1 | 2 | $(function(){ 3 | $("#nav-left ul li:eq(2) a").css("color", "red") 4 | 5 | dashBoard_module_case() 6 | dashBoard_top10_task() 7 | dashBoard_top100_case_time() 8 | 9 | 10 | 11 | function dashBoard_module_case() { 12 | $.rpc.req("dashBoard_module_case","get",{},function(resp){ 13 | if (resp && resp["code"] == 0) { 14 | // alert("成功") 15 | // location.reload() 16 | // id, title, yAxis_title,data 17 | highColumn("module-case","模块下的用例", "模块下的用例",resp.data) 18 | } else { 19 | if (resp && resp["code"] ) { 20 | alert(resp.msg) 21 | } else { 22 | alert("请求失败") 23 | } 24 | // location.reload() 25 | } 26 | }) 27 | } 28 | 29 | function dashBoard_top10_task() { 30 | $.rpc.req("dashBoard_top10_task","get",{},function(resp){ 31 | if (resp && resp["code"] == 0) { 32 | var id = "#top10-task" 33 | var h_title = "前十个任务用例执行统计" 34 | var h_yaxis_title = "前十个任务用例执行统计" 35 | var h_tooltip = "" 36 | var h_series = resp.data 37 | highLine(id,h_title,h_yaxis_title,h_tooltip,h_series) 38 | } else { 39 | if (resp && resp["code"] ) { 40 | alert(resp.msg) 41 | } else { 42 | alert("请求失败") 43 | } 44 | // location.reload() 45 | } 46 | }) 47 | } 48 | // 前100个用例的耗时情况 49 | function dashBoard_top100_case_time() { 50 | $.rpc.req("dashBoard_top100_case_time","get",{},function(resp){ 51 | if (resp && resp["code"] == 0) { 52 | var id = "#top100-case" 53 | var h_title = "前100个用例的耗时情况(秒)" 54 | var h_yaxis_title = "前100个用例的耗时情况(秒)" 55 | var h_tooltip = "" 56 | var h_series = resp.data 57 | highLine(id,h_title,h_yaxis_title,h_tooltip,h_series) 58 | } else { 59 | if (resp && resp["code"] ) { 60 | alert(resp.msg) 61 | } else { 62 | alert("请求失败") 63 | } 64 | // location.reload() 65 | } 66 | }) 67 | } 68 | 69 | }) -------------------------------------------------------------------------------- /ui/static/js/index1.js: -------------------------------------------------------------------------------- 1 | var id = 0 2 | $(function () { 3 | $("#nav-left ul li:eq(1) a").css("color", "red") 4 | $(".btn-del").click(function () { 5 | id = $(this).parents("tr").attr("id") 6 | $("#modal-del").modal("show") 7 | }) 8 | $("#btn-modal-confirm").click(function () { 9 | $.ajax({   10 | url: 'report_del', 11 |   type: "post", 12 |   dataType: "json", 13 |   data: {     14 | "rid": id 15 | }, 16 |   success: function (data) { 17 | if (data["code"] == 0) { 18 | location.reload() 19 | } 20 | }, 21 | error: function (e) { 22 | alert("失败") 23 | location.reload() 24 | } 25 | }) 26 | }) 27 | 28 | $(".btn-log").click(function(){ 29 | $.ajax({   30 | url: 'download_log', 31 |   type: "post", 32 |   dataType: "json", 33 |   data: {     34 | "log": $(this).attr("log") 35 | }, 36 |   success: function (data) { 37 | if (data["code"] == 0) { 38 | window.location.href = data["path"] 39 | } 40 | }, 41 | error: function (e) { 42 | alert("失败") 43 | location.reload() 44 | } 45 | }) 46 | }) 47 | 48 | $(".btn-excel").click(function(){ 49 | $.ajax({   50 | url: 'download_excel', 51 |   type: "post", 52 |   dataType: "json", 53 |   data: {     54 | "excel": $(this).attr("excel") 55 | }, 56 |   success: function (data) { 57 | if (data["code"] == 0) { 58 | window.location.href = data["path"] 59 | } 60 | }, 61 | error: function (e) { 62 | alert("失败") 63 | location.reload() 64 | } 65 | }) 66 | }) 67 | }) 68 | 69 | -------------------------------------------------------------------------------- /ui/static/js/jquery-validation-1.17.0/messages_zh.js: -------------------------------------------------------------------------------- 1 | (function( factory ) { 2 | if ( typeof define === "function" && define.amd ) { 3 | define( ["jquery", "../jquery.validate"], factory ); 4 | } else if (typeof module === "object" && module.exports) { 5 | module.exports = factory( require( "jquery" ) ); 6 | } else { 7 | factory( jQuery ); 8 | } 9 | }(function( $ ) { 10 | 11 | /* 12 | * Translated default messages for the jQuery validation plugin. 13 | * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) 14 | */ 15 | $.extend( $.validator.messages, { 16 | required: "这是必填字段", 17 | remote: "请修正此字段", 18 | email: "请输入有效的电子邮件地址", 19 | url: "请输入有效的网址", 20 | date: "请输入有效的日期", 21 | dateISO: "请输入有效的日期 (YYYY-MM-DD)", 22 | number: "请输入有效的数字", 23 | digits: "只能输入数字", 24 | creditcard: "请输入有效的信用卡号码", 25 | equalTo: "你的输入不相同", 26 | extension: "请输入有效的后缀", 27 | maxlength: $.validator.format( "最多可以输入 {0} 个字符" ), 28 | minlength: $.validator.format( "最少要输入 {0} 个字符" ), 29 | rangelength: $.validator.format( "请输入长度在 {0} 到 {1} 之间的字符串" ), 30 | range: $.validator.format( "请输入范围在 {0} 到 {1} 之间的数值" ), 31 | max: $.validator.format( "请输入不大于 {0} 的数值" ), 32 | min: $.validator.format( "请输入不小于 {0} 的数值" ) 33 | } ); 34 | return $; 35 | })); -------------------------------------------------------------------------------- /ui/static/js/setting.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $("#nav-left ul li:eq(3) a").css("color", "red") 3 | validate() 4 | function validate() { 5 | $("#m-form").validate({   6 | onsubmit: true, 7 | onfocusout: false, 8 | onkeyup: false, 9 | rules: {     //规则 10 | login_url: {required: true}, 11 | home_url: {required: true}, 12 | }, 13 | messages: { 14 | login_url: {required: "请输入登录url"}, 15 | home_url:{required: "请输入主页url"}, 16 | }, 17 | submitHandler: function (form) { //通过之后回调 18 | EditCase() 19 | }, 20 | invalidHandler: function (form, validator) { 21 | return false; 22 | } 23 | }); 24 | } 25 | function EditCase() { 26 | data = {"home_url": $("#home_url").val(), "login_url": $("#login_url").val()} 27 | $.rpc.req("setting_edit","post",data,function(resp){ 28 | if (resp && resp["code"] == 0) { 29 | alert("成功") 30 | location.reload() 31 | } else { 32 | if (resp && resp["code"] ) { 33 | alert(resp.msg) 34 | } else { 35 | alert("请求失败") 36 | } 37 | location.reload() 38 | } 39 | }) 40 | } 41 | }) 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ui/templates/ui/alert.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/templates/ui/case-common-case.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | 7 | {% include 'ui/nav-top.html' %} 8 | 9 |
    10 |
    11 | {% include 'ui/nav-left.html' %} 12 |
    13 | 19 |

    {{name}}--关联公共用例

    20 | 21 | 22 |
    23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | {% if common_case_list %} 33 | {% for i in common_case_list %} 34 | 35 | 36 | 37 | 41 | 42 | {% endfor %} 43 | {% else %} 44 | 45 | 46 | 47 | {% endif %} 48 | 49 |
    模块名排序操作
    {{i.name}}{{i.sort}} 38 | 39 | 40 |
    无数据
    50 |
    51 |
    52 |
    53 |
    54 | {% include 'ui/del.html' %} 55 | {% include 'ui/edit-case-common-case.html' %} 56 | {% include 'ui/foot.html' %} 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ui/templates/ui/case.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | {% include 'ui/nav-top.html' %} 7 | 8 |
    9 |
    10 | {% include 'ui/nav-left.html' %} 11 | 12 |
    13 | 17 |

    {{name}}--用例管理

    18 | 19 | 20 |
    21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {% if case_list %} 30 | {% for i in case_list %} 31 | 32 | 33 | 39 | 40 | {% endfor %} 41 | {% else %} 42 | 43 | 44 | 45 | {% endif %} 46 | 47 |
    用例名称操作
    {{i.name}} 34 | 35 | 36 | 步骤管理 37 | 检查点管理 38 |
    无数据
    48 |
    49 |
    50 |
    51 |
    52 | 53 | {% include 'ui/del.html' %} 54 | {% include 'ui/edit-case.html' %} 55 | {% include 'ui/foot.html' %} 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ui/templates/ui/common-case.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | 7 | {% include 'ui/nav-top.html' %} 8 | 9 |
    10 |
    11 | {% include 'ui/nav-left.html' %} 12 |
    13 |

    公共用例

    14 | 15 |
    16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% if case_list %} 25 | {% for i in case_list %} 26 | 27 | 28 | 33 | 34 | 35 | {% endfor %} 36 | 37 | {% else %} 38 | 39 | 40 | 41 | 42 | {% endif %} 43 | 44 |
    模块名操作
    {{i.name}} 29 | 30 | 31 | 步骤管理 32 |
    无数据
    45 |
    46 |
    47 |
    48 |
    49 | 50 | {% include 'ui/del.html' %} 51 | {% include 'ui/edit-common-case.html' %} 52 | {% include 'ui/alert.html' %} 53 | {% include 'ui/foot.html' %} 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ui/templates/ui/dashBoard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | 7 | {% include 'ui/nav-top.html' %} 8 |
    9 |
    10 | {% include 'ui/nav-left.html' %} 11 |
    12 |

    DashBoard

    13 | 16 |
    17 |
    18 |
    19 | 22 |
    23 |
    24 |
    25 | 28 |
    29 |
    30 |
    31 |
    32 |
    33 | 34 |
    35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ui/templates/ui/del.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/templates/ui/edit-case-common-case.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ui/templates/ui/edit-case.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/templates/ui/edit-common-case.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ui/templates/ui/edit-module.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ui/templates/ui/edit-task-module.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ui/templates/ui/edit-task.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ui/templates/ui/foot.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ui/templates/ui/header.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 7 | 8 | 自动化接口测试框架 9 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /ui/templates/ui/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | {% include 'ui/nav-top.html' %} 7 |
    8 |
    9 | {% include 'ui/nav-left.html' %} 10 |
    11 |

    登录

    12 | 13 |
    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {% if login_list %} 28 | {% for i in login_list %} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | {% endfor %} 42 | {% else %} 43 | 44 | 45 | 46 | {% endif %} 47 | 48 |
    名字元素查找类型操作方法扩展排序操作
    {{i.name}}{{i.element_info}}{{i.find_type}}{{i.operate_type}}{{i.extend}}{{i.sort}} 37 | 38 | 39 |
    无数据
    49 |
    50 |
    51 |
    52 |
    53 | {% include 'ui/del.html' %} 54 | {% include 'ui/edit-login.html' %} 55 | {% include 'ui/foot.html' %} 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /ui/templates/ui/module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | 7 | {% include 'ui/nav-top.html' %} 8 | 9 |
    10 |
    11 | {% include 'ui/nav-left.html' %} 12 |
    13 |

    模块

    14 | 15 |
    16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% if module_list %} 25 | {% for i in module_list %} 26 | 27 | 28 | 33 | 34 | 35 | {% endfor %} 36 | 37 | {% else %} 38 | 39 | 40 | 41 | 42 | {% endif %} 43 | 44 |
    模块名操作
    {{i.name}} 29 | 30 | 31 | 用例管理 32 |
    无数据
    45 |
    46 |
    47 |
    48 |
    49 | 50 | {% include 'ui/del.html' %} 51 | {% include 'ui/edit-module.html' %} 52 | {% include 'ui/alert.html' %} 53 | {% include 'ui/foot.html' %} 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ui/templates/ui/nav-left.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/templates/ui/nav-top.html: -------------------------------------------------------------------------------- 1 | 2 | 26 | -------------------------------------------------------------------------------- /ui/templates/ui/setting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | {% include 'ui/nav-top.html' %} 7 |
    8 |
    9 | {% include 'ui/nav-left.html' %} 10 |
    11 |

    设置

    12 |
    13 |
    14 | 15 |
    16 |
    17 |
    18 |
    19 | 20 |
    21 | 22 |
    23 |
    24 |
    25 | 26 | 28 |
    29 |
    30 |
    31 |
    32 |
    33 | {% include 'ui/foot.html' %} 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ui/templates/ui/task.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | 7 | {% include 'ui/nav-top.html' %} 8 | 9 |
    10 |
    11 | {% include 'ui/nav-left.html' %} 12 |
    13 |

    任务

    14 | 15 |
    16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% if task_list %} 25 | {% for i in task_list %} 26 | 27 | 28 | 35 | 36 | 37 | {% endfor %} 38 | 39 | {% else %} 40 | 41 | 42 | 43 | 44 | {% endif %} 45 | 46 |
    模块名操作
    {{i.name}} 29 | 30 | 31 | 关联模块 32 | 33 | 34 |
    无数据
    47 |
    48 |
    49 |
    50 |
    51 | 52 | {% include 'ui/del.html' %} 53 | {% include 'ui/edit-task.html' %} 54 | {% include 'ui/alert.html' %} 55 | {% include 'ui/foot.html' %} 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ui/templates/ui/taskModule.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | {% include 'ui/header.html' %} 5 | 6 | 7 | {% include 'ui/nav-top.html' %} 8 | 9 |
    10 |
    11 | {% include 'ui/nav-left.html' %} 12 |
    13 | 17 |

    {{name}}--关联模块

    18 | 19 | 20 | 21 |
    22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {% if ta_module_list %} 31 | {% for i in ta_module_list %} 32 | 33 | 34 | 38 | 39 | {% endfor %} 40 | {% else %} 41 | 42 | 43 | 44 | {% endif %} 45 | 46 |
    模块名操作
    {{i.name}} 35 | 36 | 37 |
    无数据
    47 |
    48 |
    49 |
    50 |
    51 | {% include 'ui/del.html' %} 52 | {% include 'ui/edit-task-module.html' %} 53 | {% include 'ui/foot.html' %} 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ui/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/templatetags/__init__.py -------------------------------------------------------------------------------- /ui/templatetags/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/templatetags/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /ui/templatetags/__pycache__/pagetag.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/ui/templatetags/__pycache__/pagetag.cpython-35.pyc -------------------------------------------------------------------------------- /ui/templatetags/pagetag.py: -------------------------------------------------------------------------------- 1 | # _*_ coding:utf-8 _*_ 2 | __Author = 'Kongzhagen' 3 | 4 | from django import template 5 | 6 | register = template.Library() 7 | 8 | 9 | @register.filter 10 | def kong_upper(val): 11 | print('val from template:', val) 12 | return val.upper() 13 | 14 | 15 | from django.utils.html import format_html 16 | 17 | 18 | @register.simple_tag 19 | def circle_page(curr_page, loop_page): 20 | offset = abs(curr_page - loop_page) 21 | if offset < 10: 22 | if curr_page == loop_page: 23 | page_ele = '
  • %s
  • ' % (loop_page, loop_page) 24 | else: 25 | page_ele = '
  • %s
  • ' % (loop_page, loop_page) 26 | return format_html(page_ele) 27 | else: 28 | return '' 29 | -------------------------------------------------------------------------------- /ui/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /use.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Louis-me/djangoApi/1946b07d7c5cfce000b6d1215128fe9cdb3740f9/use.md --------------------------------------------------------------------------------