Commit f1325047 by Lius

BPMInterfaceAutoApiTest

parent 3c71f178
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>BPM_report.html</title>
<style>body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}
h1 {
font-size: 24px;
color: black;
}
h2 {
font-size: 16px;
color: black;
}
p {
color: black;
}
a {
color: #999;
}
table {
border-collapse: collapse;
}
/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #E6E6E6;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}
/******************************
* TEST RESULT COLORS
******************************/
span.passed,
.passed .col-result {
color: green;
}
span.skipped,
span.xfailed,
span.rerun,
.skipped .col-result,
.xfailed .col-result,
.rerun .col-result {
color: orange;
}
span.error,
span.failed,
span.xpassed,
.error .col-result,
.failed .col-result,
.xpassed .col-result {
color: red;
}
/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%;
}
#results-table th,
#results-table td {
padding: 5px;
border: 1px solid #E6E6E6;
text-align: left;
}
#results-table th {
font-weight: bold;
}
/*------------------
* 2. Extra
*------------------*/
.log {
background-color: #e6e6e6;
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
height: 230px;
overflow-y: scroll;
padding: 5px;
white-space: pre-wrap;
}
.log:only-child {
height: inherit;
}
div.image {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px;
}
div.image img {
width: 320px;
}
div.video {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px;
}
div.video video {
overflow: hidden;
width: 320px;
height: 240px;
}
.collapsed {
display: none;
}
.expander::after {
content: " (show details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
.collapser::after {
content: " (hide details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}
.sort-icon {
font-size: 0px;
float: left;
margin-right: 5px;
margin-top: 5px;
/*triangle*/
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.inactive .sort-icon {
/*finish triangle*/
border-top: 8px solid #E6E6E6;
}
.asc.active .sort-icon {
/*finish triangle*/
border-bottom: 8px solid #999;
}
.desc.active .sort-icon {
/*finish triangle*/
border-top: 8px solid #999;
}
</style></head>
<body onLoad="init()">
<script>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
function toArray(iter) {
if (iter === null) {
return null;
}
return Array.prototype.slice.call(iter);
}
function find(selector, elem) { // eslint-disable-line no-redeclare
if (!elem) {
elem = document;
}
return elem.querySelector(selector);
}
function findAll(selector, elem) {
if (!elem) {
elem = document;
}
return toArray(elem.querySelectorAll(selector));
}
function sortColumn(elem) {
toggleSortStates(elem);
const colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
let key;
if (elem.classList.contains('result')) {
key = keyResult;
} else if (elem.classList.contains('links')) {
key = keyLink;
} else {
key = keyAlpha;
}
sortTable(elem, key(colIndex));
}
function showAllExtras() { // eslint-disable-line no-unused-vars
findAll('.col-result').forEach(showExtras);
}
function hideAllExtras() { // eslint-disable-line no-unused-vars
findAll('.col-result').forEach(hideExtras);
}
function showExtras(colresultElem) {
const extras = colresultElem.parentNode.nextElementSibling;
const expandcollapse = colresultElem.firstElementChild;
extras.classList.remove('collapsed');
expandcollapse.classList.remove('expander');
expandcollapse.classList.add('collapser');
}
function hideExtras(colresultElem) {
const extras = colresultElem.parentNode.nextElementSibling;
const expandcollapse = colresultElem.firstElementChild;
extras.classList.add('collapsed');
expandcollapse.classList.remove('collapser');
expandcollapse.classList.add('expander');
}
function showFilters() {
let visibleString = getQueryParameter('visible') || 'all';
visibleString = visibleString.toLowerCase();
const checkedItems = visibleString.split(',');
const filterItems = document.getElementsByClassName('filter');
for (let i = 0; i < filterItems.length; i++) {
filterItems[i].hidden = false;
if (visibleString != 'all') {
filterItems[i].checked = checkedItems.includes(filterItems[i].getAttribute('data-test-result'));
filterTable(filterItems[i]);
}
}
}
function addCollapse() {
// Add links for show/hide all
const resulttable = find('table#results-table');
const showhideall = document.createElement('p');
showhideall.innerHTML = '<a href="javascript:showAllExtras()">Show all details</a> / ' +
'<a href="javascript:hideAllExtras()">Hide all details</a>';
resulttable.parentElement.insertBefore(showhideall, resulttable);
// Add show/hide link to each result
findAll('.col-result').forEach(function(elem) {
const collapsed = getQueryParameter('collapsed') || 'Passed';
const extras = elem.parentNode.nextElementSibling;
const expandcollapse = document.createElement('span');
if (extras.classList.contains('collapsed')) {
expandcollapse.classList.add('expander');
} else if (collapsed.includes(elem.innerHTML)) {
extras.classList.add('collapsed');
expandcollapse.classList.add('expander');
} else {
expandcollapse.classList.add('collapser');
}
elem.appendChild(expandcollapse);
elem.addEventListener('click', function(event) {
if (event.currentTarget.parentNode.nextElementSibling.classList.contains('collapsed')) {
showExtras(event.currentTarget);
} else {
hideExtras(event.currentTarget);
}
});
});
}
function getQueryParameter(name) {
const match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function init () { // eslint-disable-line no-unused-vars
resetSortHeaders();
addCollapse();
showFilters();
sortColumn(find('.initial-sort'));
findAll('.sortable').forEach(function(elem) {
elem.addEventListener('click',
function() {
sortColumn(elem);
}, false);
});
}
function sortTable(clicked, keyFunc) {
const rows = findAll('.results-table-row');
const reversed = !clicked.classList.contains('asc');
const sortedRows = sort(rows, keyFunc, reversed);
/* Whole table is removed here because browsers acts much slower
* when appending existing elements.
*/
const thead = document.getElementById('results-table-head');
document.getElementById('results-table').remove();
const parent = document.createElement('table');
parent.id = 'results-table';
parent.appendChild(thead);
sortedRows.forEach(function(elem) {
parent.appendChild(elem);
});
document.getElementsByTagName('BODY')[0].appendChild(parent);
}
function sort(items, keyFunc, reversed) {
const sortArray = items.map(function(item, i) {
return [keyFunc(item), i];
});
sortArray.sort(function(a, b) {
const keyA = a[0];
const keyB = b[0];
if (keyA == keyB) return 0;
if (reversed) {
return keyA < keyB ? 1 : -1;
} else {
return keyA > keyB ? 1 : -1;
}
});
return sortArray.map(function(item) {
const index = item[1];
return items[index];
});
}
function keyAlpha(colIndex) {
return function(elem) {
return elem.childNodes[1].childNodes[colIndex].firstChild.data.toLowerCase();
};
}
function keyLink(colIndex) {
return function(elem) {
const dataCell = elem.childNodes[1].childNodes[colIndex].firstChild;
return dataCell == null ? '' : dataCell.innerText.toLowerCase();
};
}
function keyResult(colIndex) {
return function(elem) {
const strings = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed',
'Skipped', 'Passed'];
return strings.indexOf(elem.childNodes[1].childNodes[colIndex].firstChild.data);
};
}
function resetSortHeaders() {
findAll('.sort-icon').forEach(function(elem) {
elem.parentNode.removeChild(elem);
});
findAll('.sortable').forEach(function(elem) {
const icon = document.createElement('div');
icon.className = 'sort-icon';
icon.textContent = 'vvv';
elem.insertBefore(icon, elem.firstChild);
elem.classList.remove('desc', 'active');
elem.classList.add('asc', 'inactive');
});
}
function toggleSortStates(elem) {
//if active, toggle between asc and desc
if (elem.classList.contains('active')) {
elem.classList.toggle('asc');
elem.classList.toggle('desc');
}
//if inactive, reset all other functions and add ascending active
if (elem.classList.contains('inactive')) {
resetSortHeaders();
elem.classList.remove('inactive');
elem.classList.add('active');
}
}
function isAllRowsHidden(value) {
return value.hidden == false;
}
function filterTable(elem) { // eslint-disable-line no-unused-vars
const outcomeAtt = 'data-test-result';
const outcome = elem.getAttribute(outcomeAtt);
const classOutcome = outcome + ' results-table-row';
const outcomeRows = document.getElementsByClassName(classOutcome);
for(let i = 0; i < outcomeRows.length; i++){
outcomeRows[i].hidden = !elem.checked;
}
const rows = findAll('.results-table-row').filter(isAllRowsHidden);
const allRowsHidden = rows.length == 0 ? true : false;
const notFoundMessage = document.getElementById('not-found-message');
notFoundMessage.hidden = !allRowsHidden;
}
</script>
<h1>BPM_report.html</h1>
<p>Report generated on 08-Nov-2023 at 11:21:36 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.2.0</p>
<h2>Summary</h2>
<p>16 tests ran in 0.46 seconds. </p>
<p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="passed">16 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="failed">0 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span>, <input checked="true" class="filter" data-test-result="rerun" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="rerun">0 rerun</span>
<h2>Results</h2>
<table id="results-table">
<thead id="results-table-head">
<tr>
<th class="sortable result initial-sort" col="result">Result</th>
<th class="sortable" col="name">Test</th>
<th class="sortable" col="duration">Duration</th>
<th class="sortable links" col="links">Links</th></tr>
<tr hidden="true" id="not-found-message">
<th colspan="4">No results found. Try to check the filters</th></tr></thead>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-正向用例-用户名密码正确,登录成功-POST-post-http://120.46.172.186:8080/auth-json-case_data0-expect_data0-None-None-None]</td>
<td class="col-duration">0.06</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;token&quot;:&quot;eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTk1MDAwOTYsImlhdCI6MTY5OTQxMzY5Nn0.2jw7o1kWMIi3PVZy1ZI2wy54XddvkIXjGRfzqzfpVsQyosFPRfuiI1AQfRk0Ch3X7fqafZbNNaNigUY5cg2PYA&quot;,&quot;username&quot;:&quot;超级管理员&quot;,&quot;account&quot;:&quot;admin&quot;,&quot;userId&quot;:&quot;1&quot;,&quot;expiration&quot;:86400,&quot;loginStatus&quot;:true,&quot;userAttrs&quot;:{&quot;tenantId&quot;:&quot;-1&quot;}}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-反向用例-用户名为空密码正确,登陆失败-POST-post-http://120.46.172.186:8080/auth-json-case_data1-expect_data1-None-None-None]</td>
<td class="col-duration">0.01</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;账号或密码错误&quot;,&quot;logId&quot;:&quot;1722091973533253632&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-反向用例-用户名错误密码正确,登录失败-POST-post-http://120.46.172.186:8080/auth-json-case_data2-expect_data2-None-None-None]</td>
<td class="col-duration">0.01</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;账号或密码错误&quot;,&quot;logId&quot;:&quot;1722091973621334016&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-反向用例-用户名过长密码正确,登录失败-POST-post-http://120.46.172.186:8080/auth-json-case_data3-expect_data3-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;账号或密码错误&quot;,&quot;logId&quot;:&quot;1722091973730385920&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-反向用例-密码为空用户名正确,登录失败-POST-post-http://120.46.172.186:8080/auth-json-case_data4-expect_data4-None-None-None]</td>
<td class="col-duration">0.01</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;账号或密码错误&quot;,&quot;logId&quot;:&quot;1722091973822660608&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-反向用例-密码错误用户名正确,登录失败-POST-post-http://120.46.172.186:8080/auth-json-case_data5-expect_data5-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;账号或密码错误&quot;,&quot;logId&quot;:&quot;1722091973927518208&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-反向用例-密码过长用户名正确,登录失败-POST-post-http://120.46.172.186:8080/auth-json-case_data6-expect_data6-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;账号或密码错误&quot;,&quot;logId&quot;:&quot;1722091974036570112&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-正向用例-get-get-http://120.46.172.186:8080/refresh-None-None-expect_data7-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;token&quot;:&quot;eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTk1MDAwOTYsImlhdCI6MTY5OTQxMzY5Nn0.2jw7o1kWMIi3PVZy1ZI2wy54XddvkIXjGRfzqzfpVsQyosFPRfuiI1AQfRk0Ch3X7fqafZbNNaNigUY5cg2PYA&quot;,&quot;username&quot;:&quot;&quot;,&quot;account&quot;:&quot;&quot;,&quot;userId&quot;:&quot;&quot;,&quot;loginStatus&quot;:true,&quot;userAttrs&quot;:{}}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-正向用例-维度信息正确填写,添加成功-POST-post-http://120.46.172.186:8080/api/demension/v1/dem/addDem-application/json-case_data8-expect_data8-sql_sentence8-delete-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:true,&quot;message&quot;:&quot;添加维度成功!&quot;,&quot;value&quot;:&quot;&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-反向用例-维度code为空,添加失败-POST-post-http://120.46.172.186:8080/api/demension/v1/dem/addDem-application/json-case_data9-expect_data9-None-None-None]</td>
<td class="col-duration">0.01</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;添加维度信息失败,维度编码【code】必填!&quot;,&quot;logId&quot;:&quot;1722091974317588480&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[维度管理-根据维度编码获取维度信息-正向用例-get-get-http://120.46.172.186:8080/api/demension/v1/dem/getDem-query-case_data10-expect_data10-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;createTime&quot;:&quot;2023-11-08 11:21:36&quot;,&quot;isDelete&quot;:&quot;0&quot;,&quot;id&quot;:&quot;1722091974250479616&quot;,&quot;demCode&quot;:&quot;test57_bpm_api_test_dem_ls&quot;,&quot;demName&quot;:&quot;test57_bpm_api_test_dem_ls&quot;,&quot;demDesc&quot;:&quot;test57_bpm_api_test_dem_ls&quot;,&quot;isDefault&quot;:0,&quot;organId&quot;:0,&quot;code&quot;:&quot;test57_bpm_api_test_dem_ls&quot;,&quot;name&quot;:&quot;test57_bpm_api_test_dem_ls&quot;,&quot;pkVal&quot;:&quot;1722091974250479616&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-正向用例-组织信息正确填写,添加组织成功-POST-post-http://120.46.172.186:8080/api/org/v1/org/addOrg-application/json-case_data11-expect_data11-sql_sentence11-delete|select-demId]</td>
<td class="col-duration">0.03</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:true,&quot;message&quot;:&quot;添加组织成功!&quot;,&quot;value&quot;:&quot;&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-反向用例-组织code为空,添加失败-POST-post-http://120.46.172.186:8080/api/org/v1/org/addOrg-application/json-case_data12-expect_data12-None-None-None]</td>
<td class="col-duration">0.01</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:false,&quot;message&quot;:&quot;添加组织失败,组织编码【code】不能为空!&quot;,&quot;value&quot;:&quot;保存失败&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[组织管理-添加组织参数-正向用例-正确填写添加成功-POST-post-http://120.46.172.186:8080/api/org/v1/orgParam/saveOrgParams-query|body-case_data13-expect_data13-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:true,&quot;message&quot;:&quot;保存组织参数成功!&quot;,&quot;value&quot;:&quot;&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[组织管理-删除组织-正向用例-POST-post-http://120.46.172.186:8080/api/org/v1/org/deleteOrg-x-www-form-urlencoded-test57_bpm_api_test_org_ls-expect_data14-None-None-None]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:true,&quot;message&quot;:&quot;删除组织成功!&quot;,&quot;value&quot;:&quot;&quot;}
<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_bpm.py::TestBPM::test_bpm[维度管理-根据维度编码删除维度-正向用例-delete-delete-http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds-query-case_data15-expect_data15-sql_sentence15-select-ids]</td>
<td class="col-duration">0.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stdout call------------------------------ <br/>{&quot;state&quot;:true,&quot;message&quot;:&quot;删除维度成功!&quot;,&quot;value&quot;:&quot;&quot;}
<br/></div></td></tr></tbody></table></body></html>
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371902980669440"}
{"state":false,"message":"添加组织失败,组织编码【code】不能为空!","value":"保存失败"}
{"state":false,"message":"账号或密码错误","logId":"1721371904180240384"}
{"uuid": "edee3bc7-2636-431b-a501-3785264a2237", "children": ["8f1cfeb0-8f9e-4116-bc20-cb4a7379522e", "c86a790f-1f27-47c3-8f7d-61e82d1feb3f", "41fe2b69-abc0-4996-9e80-d34328db6ebb", "a7d800d7-828e-4250-a98c-f01478101a45", "7f0a0338-2b50-4c00-9545-a4af757eef33", "1fdb0dc4-7206-4c79-8009-92f6738aa806", "7653fefd-93d0-41b0-8cd7-d0a9d0b19c05", "2df9e9b8-cd17-4028-a92d-f5a9a37a5c9f", "5f1fb4fb-54d4-46ac-b3de-6977add38f67", "faed8b5b-6c95-4f95-94bf-5bb145e51178", "4243dc45-42cc-4a8d-bc20-1978460a58f7", "325b9b6d-4a49-461f-b9a9-125213cc307a", "34b31ccc-afd6-4c6c-a659-3933663866c7", "95278981-dae8-4153-86b6-2a02c927749c", "db56b4b2-7682-444e-b697-018d4db88edd", "d80a5529-8e32-4ea1-906d-941e138ae3fc"], "befores": [{"name": "_session_faker", "status": "passed", "start": 1699242015922, "stop": 1699242016103}], "start": 1699242015921, "stop": 1699242018452}
\ No newline at end of file
{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjg0MTgsImlhdCI6MTY5OTI0MjAxOH0.QMCsWid70uyI9vk9TLX8oGu4a2z708EKoonPbcIqem4qQHPMymvTiqXoc1Qhm843lAb57MX0mMsWHSZxK3jF0g","username":"","account":"","userId":"","loginStatus":true,"userAttrs":{}}
{"uuid": "49a4ce7f-0402-48ca-bb9e-c9de967fb2a7", "befores": [{"name": "title", "status": "passed", "start": 1699242016699, "stop": 1699242016699}], "start": 1699242016699, "stop": 1699242016829}
\ No newline at end of file
{"uuid": "9068c47b-7c7c-4ded-a58b-15440e05f0cf", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242018323, "stop": 1699242018323}], "start": 1699242018323, "stop": 1699242018431}
\ No newline at end of file
{"uuid": "ae65b352-cb25-4b9f-af86-ca975fd01ad6", "befores": [{"name": "mime", "status": "passed", "start": 1699242018224, "stop": 1699242018224}], "start": 1699242018224, "stop": 1699242018303}
\ No newline at end of file
{"uuid": "62f193c7-0ec1-48d9-969d-4af44d78404e", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017265, "stop": 1699242017265}], "start": 1699242017265, "stop": 1699242017360}
\ No newline at end of file
{"uuid": "f0eb840d-aa22-4c14-ac54-76f847c4feb2", "befores": [{"name": "module_name", "status": "passed", "start": 1699242018125, "stop": 1699242018125}], "start": 1699242018125, "stop": 1699242018214}
\ No newline at end of file
{"uuid": "c39866c9-39d0-4dc5-8e69-b37512c45b48", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242016859, "stop": 1699242016859}], "start": 1699242016859, "stop": 1699242016972}
\ No newline at end of file
{"uuid": "df1c2842-700b-43c3-8f51-84de6bb6a772", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242016703, "stop": 1699242016703}], "start": 1699242016703, "stop": 1699242016813}
\ No newline at end of file
{"uuid": "ed2b93a4-1e27-442d-a8da-00f75c2fed90", "befores": [{"name": "api_name", "status": "passed", "start": 1699242018126, "stop": 1699242018126}], "start": 1699242018126, "stop": 1699242018213}
\ No newline at end of file
{"uuid": "272f416c-3e71-4895-a874-ab8916ae618b", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017641, "stop": 1699242017641}], "start": 1699242017641, "stop": 1699242017692}
\ No newline at end of file
{"uuid": "b7c57097-1657-473a-946f-35beccdcf868", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242016579, "stop": 1699242016580}], "start": 1699242016579, "stop": 1699242016666}
\ No newline at end of file
{"uuid": "a34b60b8-61fb-4c00-9be5-d3a0ad6418d2", "befores": [{"name": "mime", "status": "passed", "start": 1699242016701, "stop": 1699242016701}], "start": 1699242016701, "stop": 1699242016820}
\ No newline at end of file
{"uuid": "578a517f-81e6-4de0-bb5d-63cd3da8241d", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242018323, "stop": 1699242018323}], "start": 1699242018323, "stop": 1699242018426}
\ No newline at end of file
{"uuid": "b241b7ac-272a-45c3-b1d0-456edce9038b", "befores": [{"name": "level", "status": "passed", "start": 1699242018224, "stop": 1699242018224}], "start": 1699242018224, "stop": 1699242018308}
\ No newline at end of file
{"uuid": "29e5c024-8ece-4da1-8fac-04fd0ec15ebd", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242018230, "stop": 1699242018230}], "start": 1699242018230, "stop": 1699242018297}
\ No newline at end of file
{"uuid": "d35e3946-1f6f-49c1-99b3-6f0e304ac507", "befores": [{"name": "case_data", "status": "passed", "start": 1699242017373, "stop": 1699242017373}], "start": 1699242017373, "stop": 1699242017472}
\ No newline at end of file
{"uuid": "dc6c3e69-d07c-4034-adaf-034b079de27c", "befores": [{"name": "title", "status": "passed", "start": 1699242017483, "stop": 1699242017483}], "start": 1699242017483, "stop": 1699242017633}
\ No newline at end of file
{"uuid": "dceaf749-26d0-47a7-a5d8-e5d3e938f249", "befores": [{"name": "title", "status": "passed", "start": 1699242016843, "stop": 1699242016843}], "start": 1699242016843, "stop": 1699242016993}
\ No newline at end of file
{"uuid": "21a38dbd-1cbe-4950-9391-ae3d1fdd72bf", "befores": [{"name": "update_key", "status": "passed", "start": 1699242017158, "stop": 1699242017158}], "start": 1699242017158, "stop": 1699242017249}
\ No newline at end of file
{"uuid": "87b1f6b8-1b08-4160-bf84-2f30caeff5a1", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017024, "stop": 1699242017024}], "start": 1699242017024, "stop": 1699242017133}
\ No newline at end of file
{"uuid": "5dc19089-23ab-4b4f-ad33-a6ef46c586d7", "befores": [{"name": "method", "status": "passed", "start": 1699242018043, "stop": 1699242018043}], "start": 1699242018043, "stop": 1699242018109}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371904633225216"}
{"uuid": "8e52f1af-b8d9-4e37-8d08-46bd564b0ef0", "befores": [{"name": "level", "status": "passed", "start": 1699242017157, "stop": 1699242017157}], "start": 1699242017157, "stop": 1699242017256}
\ No newline at end of file
{"uuid": "5025078b-b8f6-4d73-ac3b-d9b6e302deff", "befores": [{"name": "level", "status": "passed", "start": 1699242017640, "stop": 1699242017640}], "start": 1699242017640, "stop": 1699242017698}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371903676923904"}
{"uuid": "19700080-a414-4732-8a12-d64bcdc6a7ba", "befores": [{"name": "mime", "status": "passed", "start": 1699242017640, "stop": 1699242017640}], "start": 1699242017640, "stop": 1699242017694}
\ No newline at end of file
{"uuid": "301cc258-8085-45f0-a90b-edad6c2b36d4", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017484, "stop": 1699242017484}], "start": 1699242017484, "stop": 1699242017627}
\ No newline at end of file
{"uuid": "d60da9a9-2154-45fa-876c-366b13968b24", "befores": [{"name": "method", "status": "passed", "start": 1699242017372, "stop": 1699242017372}], "start": 1699242017372, "stop": 1699242017475}
\ No newline at end of file
{"uuid": "10828a5b-a4ef-479d-aca5-6771f277a183", "befores": [{"name": "url", "status": "passed", "start": 1699242017830, "stop": 1699242017831}], "start": 1699242017830, "stop": 1699242018026}
\ No newline at end of file
{"uuid": "d52a0374-4e7f-4fc8-b389-edd23d460b6e", "befores": [{"name": "api_name", "status": "passed", "start": 1699242017482, "stop": 1699242017482}], "start": 1699242017482, "stop": 1699242017634}
\ No newline at end of file
{"uuid": "6fb4c52a-c787-4e00-9c3c-1bc754994933", "befores": [{"name": "case_data", "status": "passed", "start": 1699242017483, "stop": 1699242017483}], "start": 1699242017483, "stop": 1699242017629}
\ No newline at end of file
{"uuid": "82b40e98-8139-4e3d-8a1c-7edfcf2fc6dc", "befores": [{"name": "api_name", "status": "passed", "start": 1699242017264, "stop": 1699242017264}], "start": 1699242017264, "stop": 1699242017366}
\ No newline at end of file
{"uuid": "689a385b-e0d4-4d71-9813-85885bf8656f", "befores": [{"name": "title", "status": "passed", "start": 1699242017157, "stop": 1699242017157}], "start": 1699242017157, "stop": 1699242017257}
\ No newline at end of file
{"uuid": "d8bf8c56-1e80-437b-abc8-3d703d83c99d", "befores": [{"name": "update_key", "status": "passed", "start": 1699242018045, "stop": 1699242018045}], "start": 1699242018045, "stop": 1699242018099}
\ No newline at end of file
{"uuid": "8de9d080-9ca8-416c-b75b-cadd29b0acb2", "befores": [{"name": "title", "status": "passed", "start": 1699242017830, "stop": 1699242017830}], "start": 1699242017830, "stop": 1699242018032}
\ No newline at end of file
{"uuid": "37f395e4-c2c9-4db0-8c0d-b9e1c85496b6", "befores": [{"name": "mime", "status": "passed", "start": 1699242017158, "stop": 1699242017158}], "start": 1699242017158, "stop": 1699242017253}
\ No newline at end of file
{"uuid": "e806d80b-2fde-4265-acd9-2892ac198138", "befores": [{"name": "update_key", "status": "passed", "start": 1699242018231, "stop": 1699242018231}], "start": 1699242018231, "stop": 1699242018296}
\ No newline at end of file
{"uuid": "7616b943-597c-4279-9b03-e584c0fd4df7", "befores": [{"name": "url", "status": "passed", "start": 1699242017707, "stop": 1699242017707}], "start": 1699242017707, "stop": 1699242017812}
\ No newline at end of file
{"uuid": "b3e2056a-ff48-4cad-9256-137d9aa9a17a", "befores": [{"name": "case_data", "status": "passed", "start": 1699242018227, "stop": 1699242018229}], "start": 1699242018227, "stop": 1699242018301}
\ No newline at end of file
{"uuid": "bf07d322-ded5-4703-af87-40b120863eff", "befores": [{"name": "update_key", "status": "passed", "start": 1699242016423, "stop": 1699242016423}], "start": 1699242016423, "stop": 1699242016543}
\ No newline at end of file
{"uuid": "efd42501-fe7f-42df-a47b-4dd5d99ef49c", "befores": [{"name": "method", "status": "passed", "start": 1699242016700, "stop": 1699242016700}], "start": 1699242016700, "stop": 1699242016824}
\ No newline at end of file
{"uuid": "54df1be7-c9b2-4ff6-bd26-3f72aabab5d0", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242018044, "stop": 1699242018044}], "start": 1699242018044, "stop": 1699242018103}
\ No newline at end of file
{"uuid": "d4e34f63-82e2-46de-9b0c-ac53b7a0fc2b", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242016423, "stop": 1699242016423}], "start": 1699242016423, "stop": 1699242016544}
\ No newline at end of file
{"uuid": "569aca25-39ac-41af-aa41-26113f9c67ab", "befores": [{"name": "update_key", "status": "passed", "start": 1699242017031, "stop": 1699242017031}], "start": 1699242017031, "stop": 1699242017132}
\ No newline at end of file
{"uuid": "67372921-d7ca-4b38-b612-327c8c5e1ae5", "befores": [{"name": "method", "status": "passed", "start": 1699242017264, "stop": 1699242017264}], "start": 1699242017264, "stop": 1699242017363}
\ No newline at end of file
{"name": "正向用例", "status": "passed", "attachments": [{"name": "stdout", "source": "b13c9579-8388-47bb-9364-dc4472c38074-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'认证接口'"}, {"name": "api_name", "value": "'刷新token'"}, {"name": "title", "value": "'正向用例'"}, {"name": "level", "value": "'get'"}, {"name": "method", "value": "'get'"}, {"name": "url", "value": "'http://120.46.172.186:8080/refresh'"}, {"name": "mime", "value": "None"}, {"name": "case_data", "value": "None"}, {"name": "expect_data", "value": "{'loginStatus': True}"}, {"name": "sql_sentence", "value": "None"}, {"name": "sql_sentence_type", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1699242017374, "stop": 1699242017468, "uuid": "2df9e9b8-cd17-4028-a92d-f5a9a37a5c9f", "historyId": "536961674de62e406095ab066751431e", "testCaseId": "0abeaba8f176b6785a0334bed7c1bdad", "fullName": "test_bpm.TestBPM#test_bpm", "labels": [{"name": "feature", "value": "认证接口"}, {"name": "story", "value": "刷新token"}, {"name": "severity", "value": "get"}, {"name": "epic", "value": "BPM项目"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-HUPO1RF0"}, {"name": "thread", "value": "12256-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_bpm"}]}
\ No newline at end of file
{"state":false,"message":"添加维度信息失败,维度编码【code】必填!","logId":"1721371906025734144"}
{"uuid": "c392908c-5142-4186-a22d-539774241f78", "befores": [{"name": "case_data", "status": "passed", "start": 1699242017158, "stop": 1699242017158}], "start": 1699242017158, "stop": 1699242017252}
\ No newline at end of file
{"uuid": "dfc7b2cb-13ff-4347-aa48-ade0ca7c4a98", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242017641, "stop": 1699242017641}], "start": 1699242017641, "stop": 1699242017691}
\ No newline at end of file
{"uuid": "c1758bad-e0ae-4e66-92de-77d16ef18181", "befores": [{"name": "mime", "status": "passed", "start": 1699242016856, "stop": 1699242016856}], "start": 1699242016856, "stop": 1699242016981}
\ No newline at end of file
{"uuid": "3a5aa222-7b1e-4472-a6bb-6301b5877078", "befores": [{"name": "update_key", "status": "passed", "start": 1699242018130, "stop": 1699242018130}], "start": 1699242018130, "stop": 1699242018193}
\ No newline at end of file
{"uuid": "5274eb7d-4f96-4b91-bfdf-029f2247b73a", "befores": [{"name": "method", "status": "passed", "start": 1699242017830, "stop": 1699242017830}], "start": 1699242017830, "stop": 1699242018029}
\ No newline at end of file
{"uuid": "b04262e0-38a4-4845-b29b-75ff28193a9c", "befores": [{"name": "case_data", "status": "passed", "start": 1699242016421, "stop": 1699242016422}], "start": 1699242016421, "stop": 1699242016551}
\ No newline at end of file
{"uuid": "a5496e24-8121-4560-aa03-63d20729be9f", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242017373, "stop": 1699242017373}], "start": 1699242017373, "stop": 1699242017472}
\ No newline at end of file
{"uuid": "cbc5ebbc-5b15-486c-b3f3-2b830c2ab23a", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017373, "stop": 1699242017373}], "start": 1699242017373, "stop": 1699242017471}
\ No newline at end of file
{"uuid": "bfa971e3-cf27-46e2-8525-1685b4c7a9fa", "befores": [{"name": "url", "status": "passed", "start": 1699242016421, "stop": 1699242016421}], "start": 1699242016421, "stop": 1699242016555}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371901630103552"}
-- "a/BPMInterfaceAutoTest/report/log/bpm_\346\216\245\345\217\243\350\207\252\345\212\250\345\214\226\346\241\206\346\236\266\346\234\200\346\226\260\350\277\220\350\241\214\346\227\245\345\277\227.log"
-- "a/BPMInterfaceAutoTest/report/log/\346\227\245\345\277\227\346\261\207\346\200\273.log"
# -*-coding:utf-8 -*- #
# 测试轮询SCM模式
# -*-coding:utf-8 -*- #
import pytest
from BPMInterfaceAutoTest.common.db import DB
from BPMInterfaceAutoTest.request_methods.request_methods import RequestMethods
@pytest.fixture(scope="session")
def request_fix():
request_methods = RequestMethods()
return request_methods
@pytest.fixture(scope="session")
def db_fix():
db = DB()
yield db
db.close()
# def pytest_collection_modifyitems(items):
# # item表示每个测试用例,解决用例名称中文显示问题
# for item in items:
# item.name = item.name.encode("utf-8").decode("unicode-escape")
# item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
[pytest]
;开启日志
;log_cli=true
;设置日志的级别,如果不设置级别的话,可以设置为NOTSET,如果要设置级别,级别可以有debug,info,warning,error,致命
;log_level=NOTSET
;设置日志显示的信息格式
;log_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置日志中时间显示的格式
;log_date_format=%Y-%m-%d %H:%M:%S
;每个py文件运行的时候追加的命令
;addopts=-vs
;设置日志保存的文件
log_file=../report/log/bpm_接口自动化框架最新运行日志.log
;设置日志保存在文件中的级别
log_file_level=error
;设置日志在文件中的信息格式
log_file_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置文件日志中时间显示的格式
log_file_date_format=%Y-%m-%d %H:%M:%S
\ No newline at end of file
# -*-coding:utf-8 -*- #
from BPMInterfaceAutoTest.common.log import write_log
from BPMInterfaceAutoTest_V2.common.log import write_log
log = write_log()
......@@ -2,9 +2,9 @@
import pymysql
from BPMInterfaceAutoTest.common import log
from BPMInterfaceAutoTest.common.read_excel import ReadExcel
from BPMInterfaceAutoTest.common.read_ini import ReadIni
from BPMInterfaceAutoTest_V2.common import log
from BPMInterfaceAutoTest_V2.common.read_excel import ReadExcel
from BPMInterfaceAutoTest_V2.common.read_ini import ReadIni
class DB:
......
......@@ -5,11 +5,11 @@ import os
def write_log():
logger = logging.getLogger("ls")
log_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "report/log/日志汇总.log")
logger = logging.getLogger()
log_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "report/log/logs_all.log")
handler = logging.FileHandler(log_path, 'a', encoding="utf-8")
fmt = logging.Formatter('%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s - %(name)s')
fmt = logging.Formatter('%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
handler.setFormatter(fmt)
logger.addHandler(handler)
......
# -*-coding:utf-8 -*- #
import os
import openpyxl
from BPMInterfaceAutoTest.common import log
from BPMInterfaceAutoTest.common.read_ini import ReadIni
from BPMInterfaceAutoTest.common.read_json import read_json
from BPMInterfaceAutoTest_V2.common import log
from BPMInterfaceAutoTest_V2.common.read_ini import ReadIni
from BPMInterfaceAutoTest_V2.common.read_json import read_json
class ReadExcel:
def __init__(self):
def __init__(self, table_name, excel_name, case_data_name, expect_data_name, sql_sentence_name):
self.read_ini = ReadIni()
self.excel_path = self.read_ini.get_file_path("excel")
table_name = self.read_ini.get_table_name("table_name")
self.excel_path = os.path.join(self.read_ini.data_config_path, excel_name)
case_data_path = os.path.join(self.read_ini.data_config_path, case_data_name)
expect_data_path = os.path.join(self.read_ini.data_config_path, expect_data_name)
sql_sentence_path = os.path.join(self.read_ini.data_config_path, sql_sentence_name)
self.wb = openpyxl.load_workbook(self.excel_path)
try:
self.ws = self.wb[table_name]
self.wb = openpyxl.load_workbook(self.excel_path)
except:
log.error("工作表名称错误,请到配置文件中检查工作表名称")
raise KeyError("工作表名称错误,请到配置文件中检查工作表名称")
log.error("excel文件名称错误,请检查传入的文件名称")
raise NameError("excel文件名称错误,请检查传入的文件名称")
case_data_path = self.read_ini.get_file_path("case_data")
expect_data_path = self.read_ini.get_file_path("expect_data")
sql_sentence_path = self.read_ini.get_file_path("sql_sentence")
try:
self.ws = self.wb[table_name]
except:
log.error("工作表名称错误,请检查传入的工作表名称")
raise KeyError("工作表名称错误,请检查传入的工作表名称")
self.case_data_dict = read_json(case_data_path)
self.excel_data_dict = read_json(expect_data_path)
......@@ -129,6 +133,7 @@ class ReadExcel:
if __name__ == '__main__':
read_excel = ReadExcel()
read_excel = ReadExcel("BPM_ls", "ls/BPMInterfaceAutoTest.xlsx", "ls/case_data.json", "ls/expect_data.json",
"ls/sql_sentence.json")
# print(read_excel._ReadExcel__get_cell_value('b', 3))
print(read_excel.get_data())
......@@ -3,7 +3,7 @@
import configparser
import os
from BPMInterfaceAutoTest.common import log
from BPMInterfaceAutoTest_V2.common import log
class ReadIni:
......
......@@ -3,7 +3,7 @@
import json
import os
from BPMInterfaceAutoTest.common import log
from BPMInterfaceAutoTest_V2.common import log
def read_json(filename):
......
{
"认证接口": {
"登录系统": {
"LoginSuccess": {
"username": "admin",
"password": "MTIzNDU2"
},
"LoginFailedUsernameIsNone": {
"username": "",
"password": "MTIzNDU2"
},
"LoginFailedUsernameError": {
"username": "admin11",
"password": "MTIzNDU2"
},
"LoginFailedUsernameIsLong": {
"username": "adminadminadminadminadminadmin",
"password": "MTIzNDU2"
},
"LoginFailedPasswordIsNone": {
"username": "admin",
"password": ""
},
"LoginFailedPasswordError": {
"username": "admin",
"password": "MTIzNDU21111"
},
"LoginFailedPasswordIsLong": {
"username": "admin",
"password": "MTIzNDU2MTIzNDU2MTIzNDU2MTIzNDU2"
}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {
"code": "test57_bpm_api_test_dem_ls",
"description": "test57_bpm_api_test_dem_ls",
"isDefault": 0,
"name": "test57_bpm_api_test_dem_ls"
},
"AddDemFailedCodeIsNone": {
"code": "",
"description": "test57_bpm_api_test_dem_ls",
"isDefault": 0,
"name": "test57_bpm_api_test_dem_ls"
}
},
"根据维度编码获取维度信息": {
"GetDemInfoSuccess": {
"code": "test57_bpm_api_test_dem_ls"
}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {
"ids": ""
}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"code": "test57_bpm_api_test_org_ls",
"demId": "",
"name": "test57_bpm_api_test_org_ls",
"exceedLimitNum": 0,
"grade": "",
"limitNum": 0,
"nowNum": 0,
"orderNo": 0,
"parentId": "0"
},
"AddOrgFailedCodeIsNone": {
"code": "",
"demId": "",
"name": "test57_bpm_api_test_org_ls",
"exceedLimitNum": 0,
"grade": "",
"limitNum": 0,
"nowNum": 0,
"orderNo": 0,
"parentId": "0"
}
},
"添加组织参数": {
"AddOrgParamsSuccess": {
"query": {"orgCode": "test57_bpm_api_test_org_ls"},
"body": [{"alias": "sz", "value": 999}]
}
},
"删除组织": {
"DeleteOrgSuccess": "test57_bpm_api_test_org_ls"
}
}
}
\ No newline at end of file
{
"认证接口": {
"登录系统": {
"LoginSuccess": {
"loginStatus": true,
"username": "超级管理员"
},
"LoginFailedUsernameIsNone": {
"state": false,
"message": "账号或密码错误"
},
"LoginFailedUsernameError": {
"state": false,
"message": "账号或密码错误"
},
"LoginFailedUsernameIsLong": {
"state": false,
"message": "账号或密码错误"
},
"LoginFailedPasswordIsNone": {
"state": false,
"message": "账号或密码错误"
},
"LoginFailedPasswordError": {
"state": false,
"message": "账号或密码错误"
},
"LoginFailedPasswordIsLong": {
"state": false,
"message": "账号或密码错误"
}
},
"刷新token": {
"RefreshTokenSuccess": {"loginStatus": true}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {
"state": true,
"message": "添加维度成功!"
},
"AddDemFailedCodeIsNone": {
"state": false,
"message": "添加维度信息失败,维度编码【code】必填!"
}
},
"根据维度编码获取维度信息": {
"GetDemInfoSuccess": {
"code": "test57_bpm_api_test_dem_ls"
}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {
"state": true,
"message": "删除维度成功!"
}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"state": true,
"message": "添加组织成功!"
},
"AddOrgFailedCodeIsNone": {
"state": false,
"message": "添加组织失败,组织编码【code】不能为空!"
}
},
"添加组织参数": {
"AddOrgParamsSuccess": {
"message": "保存组织参数成功!"
}
},
"删除组织": {
"DeleteOrgSuccess": {
"state": true,
"message": "删除组织成功!"
}
}
}
}
\ No newline at end of file
{
"维度管理": {
"添加维度": {
"AddDemSuccess": {
"delete": "delete from uc_demension where `CODE_`=\"test57_bpm_api_test_dem_ls\""
}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {
"select": "select ID_ from uc_demension where `CODE_`=\"test57_bpm_api_test_dem_ls\";"
}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"delete": "delete from uc_org where `CODE_`=\"test57_bpm_api_test_org_ls\";",
"select": "select ID_ from uc_demension where `CODE_`=\"test57_bpm_api_test_dem_ls\";"
}
}
}
}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371902980669440"}
{"state":false,"message":"添加组织失败,组织编码【code】不能为空!","value":"保存失败"}
{"state":false,"message":"账号或密码错误","logId":"1721371904180240384"}
{"uuid": "edee3bc7-2636-431b-a501-3785264a2237", "children": ["8f1cfeb0-8f9e-4116-bc20-cb4a7379522e", "c86a790f-1f27-47c3-8f7d-61e82d1feb3f", "41fe2b69-abc0-4996-9e80-d34328db6ebb", "a7d800d7-828e-4250-a98c-f01478101a45", "7f0a0338-2b50-4c00-9545-a4af757eef33", "1fdb0dc4-7206-4c79-8009-92f6738aa806", "7653fefd-93d0-41b0-8cd7-d0a9d0b19c05", "2df9e9b8-cd17-4028-a92d-f5a9a37a5c9f", "5f1fb4fb-54d4-46ac-b3de-6977add38f67", "faed8b5b-6c95-4f95-94bf-5bb145e51178", "4243dc45-42cc-4a8d-bc20-1978460a58f7", "325b9b6d-4a49-461f-b9a9-125213cc307a", "34b31ccc-afd6-4c6c-a659-3933663866c7", "95278981-dae8-4153-86b6-2a02c927749c", "db56b4b2-7682-444e-b697-018d4db88edd", "d80a5529-8e32-4ea1-906d-941e138ae3fc"], "befores": [{"name": "_session_faker", "status": "passed", "start": 1699242015922, "stop": 1699242016103}], "start": 1699242015921, "stop": 1699242018452}
\ No newline at end of file
{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjg0MTgsImlhdCI6MTY5OTI0MjAxOH0.QMCsWid70uyI9vk9TLX8oGu4a2z708EKoonPbcIqem4qQHPMymvTiqXoc1Qhm843lAb57MX0mMsWHSZxK3jF0g","username":"","account":"","userId":"","loginStatus":true,"userAttrs":{}}
{"uuid": "49a4ce7f-0402-48ca-bb9e-c9de967fb2a7", "befores": [{"name": "title", "status": "passed", "start": 1699242016699, "stop": 1699242016699}], "start": 1699242016699, "stop": 1699242016829}
\ No newline at end of file
{"uuid": "9068c47b-7c7c-4ded-a58b-15440e05f0cf", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242018323, "stop": 1699242018323}], "start": 1699242018323, "stop": 1699242018431}
\ No newline at end of file
{"uuid": "ae65b352-cb25-4b9f-af86-ca975fd01ad6", "befores": [{"name": "mime", "status": "passed", "start": 1699242018224, "stop": 1699242018224}], "start": 1699242018224, "stop": 1699242018303}
\ No newline at end of file
{"uuid": "62f193c7-0ec1-48d9-969d-4af44d78404e", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017265, "stop": 1699242017265}], "start": 1699242017265, "stop": 1699242017360}
\ No newline at end of file
{"uuid": "f0eb840d-aa22-4c14-ac54-76f847c4feb2", "befores": [{"name": "module_name", "status": "passed", "start": 1699242018125, "stop": 1699242018125}], "start": 1699242018125, "stop": 1699242018214}
\ No newline at end of file
{"uuid": "c39866c9-39d0-4dc5-8e69-b37512c45b48", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242016859, "stop": 1699242016859}], "start": 1699242016859, "stop": 1699242016972}
\ No newline at end of file
{"uuid": "df1c2842-700b-43c3-8f51-84de6bb6a772", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242016703, "stop": 1699242016703}], "start": 1699242016703, "stop": 1699242016813}
\ No newline at end of file
{"uuid": "ed2b93a4-1e27-442d-a8da-00f75c2fed90", "befores": [{"name": "api_name", "status": "passed", "start": 1699242018126, "stop": 1699242018126}], "start": 1699242018126, "stop": 1699242018213}
\ No newline at end of file
{"uuid": "272f416c-3e71-4895-a874-ab8916ae618b", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017641, "stop": 1699242017641}], "start": 1699242017641, "stop": 1699242017692}
\ No newline at end of file
{"uuid": "b7c57097-1657-473a-946f-35beccdcf868", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242016579, "stop": 1699242016580}], "start": 1699242016579, "stop": 1699242016666}
\ No newline at end of file
{"uuid": "a34b60b8-61fb-4c00-9be5-d3a0ad6418d2", "befores": [{"name": "mime", "status": "passed", "start": 1699242016701, "stop": 1699242016701}], "start": 1699242016701, "stop": 1699242016820}
\ No newline at end of file
{"uuid": "578a517f-81e6-4de0-bb5d-63cd3da8241d", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242018323, "stop": 1699242018323}], "start": 1699242018323, "stop": 1699242018426}
\ No newline at end of file
{"uuid": "b241b7ac-272a-45c3-b1d0-456edce9038b", "befores": [{"name": "level", "status": "passed", "start": 1699242018224, "stop": 1699242018224}], "start": 1699242018224, "stop": 1699242018308}
\ No newline at end of file
{"uuid": "29e5c024-8ece-4da1-8fac-04fd0ec15ebd", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242018230, "stop": 1699242018230}], "start": 1699242018230, "stop": 1699242018297}
\ No newline at end of file
{"uuid": "d35e3946-1f6f-49c1-99b3-6f0e304ac507", "befores": [{"name": "case_data", "status": "passed", "start": 1699242017373, "stop": 1699242017373}], "start": 1699242017373, "stop": 1699242017472}
\ No newline at end of file
{"uuid": "dc6c3e69-d07c-4034-adaf-034b079de27c", "befores": [{"name": "title", "status": "passed", "start": 1699242017483, "stop": 1699242017483}], "start": 1699242017483, "stop": 1699242017633}
\ No newline at end of file
{"uuid": "dceaf749-26d0-47a7-a5d8-e5d3e938f249", "befores": [{"name": "title", "status": "passed", "start": 1699242016843, "stop": 1699242016843}], "start": 1699242016843, "stop": 1699242016993}
\ No newline at end of file
{"uuid": "21a38dbd-1cbe-4950-9391-ae3d1fdd72bf", "befores": [{"name": "update_key", "status": "passed", "start": 1699242017158, "stop": 1699242017158}], "start": 1699242017158, "stop": 1699242017249}
\ No newline at end of file
{"uuid": "87b1f6b8-1b08-4160-bf84-2f30caeff5a1", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017024, "stop": 1699242017024}], "start": 1699242017024, "stop": 1699242017133}
\ No newline at end of file
{"uuid": "5dc19089-23ab-4b4f-ad33-a6ef46c586d7", "befores": [{"name": "method", "status": "passed", "start": 1699242018043, "stop": 1699242018043}], "start": 1699242018043, "stop": 1699242018109}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371904633225216"}
{"uuid": "8e52f1af-b8d9-4e37-8d08-46bd564b0ef0", "befores": [{"name": "level", "status": "passed", "start": 1699242017157, "stop": 1699242017157}], "start": 1699242017157, "stop": 1699242017256}
\ No newline at end of file
{"uuid": "5025078b-b8f6-4d73-ac3b-d9b6e302deff", "befores": [{"name": "level", "status": "passed", "start": 1699242017640, "stop": 1699242017640}], "start": 1699242017640, "stop": 1699242017698}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371903676923904"}
{"uuid": "19700080-a414-4732-8a12-d64bcdc6a7ba", "befores": [{"name": "mime", "status": "passed", "start": 1699242017640, "stop": 1699242017640}], "start": 1699242017640, "stop": 1699242017694}
\ No newline at end of file
{"uuid": "301cc258-8085-45f0-a90b-edad6c2b36d4", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017484, "stop": 1699242017484}], "start": 1699242017484, "stop": 1699242017627}
\ No newline at end of file
{"uuid": "d60da9a9-2154-45fa-876c-366b13968b24", "befores": [{"name": "method", "status": "passed", "start": 1699242017372, "stop": 1699242017372}], "start": 1699242017372, "stop": 1699242017475}
\ No newline at end of file
{"uuid": "10828a5b-a4ef-479d-aca5-6771f277a183", "befores": [{"name": "url", "status": "passed", "start": 1699242017830, "stop": 1699242017831}], "start": 1699242017830, "stop": 1699242018026}
\ No newline at end of file
{"uuid": "d52a0374-4e7f-4fc8-b389-edd23d460b6e", "befores": [{"name": "api_name", "status": "passed", "start": 1699242017482, "stop": 1699242017482}], "start": 1699242017482, "stop": 1699242017634}
\ No newline at end of file
{"uuid": "6fb4c52a-c787-4e00-9c3c-1bc754994933", "befores": [{"name": "case_data", "status": "passed", "start": 1699242017483, "stop": 1699242017483}], "start": 1699242017483, "stop": 1699242017629}
\ No newline at end of file
{"uuid": "82b40e98-8139-4e3d-8a1c-7edfcf2fc6dc", "befores": [{"name": "api_name", "status": "passed", "start": 1699242017264, "stop": 1699242017264}], "start": 1699242017264, "stop": 1699242017366}
\ No newline at end of file
{"uuid": "689a385b-e0d4-4d71-9813-85885bf8656f", "befores": [{"name": "title", "status": "passed", "start": 1699242017157, "stop": 1699242017157}], "start": 1699242017157, "stop": 1699242017257}
\ No newline at end of file
{"uuid": "d8bf8c56-1e80-437b-abc8-3d703d83c99d", "befores": [{"name": "update_key", "status": "passed", "start": 1699242018045, "stop": 1699242018045}], "start": 1699242018045, "stop": 1699242018099}
\ No newline at end of file
{"uuid": "8de9d080-9ca8-416c-b75b-cadd29b0acb2", "befores": [{"name": "title", "status": "passed", "start": 1699242017830, "stop": 1699242017830}], "start": 1699242017830, "stop": 1699242018032}
\ No newline at end of file
{"uuid": "37f395e4-c2c9-4db0-8c0d-b9e1c85496b6", "befores": [{"name": "mime", "status": "passed", "start": 1699242017158, "stop": 1699242017158}], "start": 1699242017158, "stop": 1699242017253}
\ No newline at end of file
{"uuid": "e806d80b-2fde-4265-acd9-2892ac198138", "befores": [{"name": "update_key", "status": "passed", "start": 1699242018231, "stop": 1699242018231}], "start": 1699242018231, "stop": 1699242018296}
\ No newline at end of file
{"uuid": "7616b943-597c-4279-9b03-e584c0fd4df7", "befores": [{"name": "url", "status": "passed", "start": 1699242017707, "stop": 1699242017707}], "start": 1699242017707, "stop": 1699242017812}
\ No newline at end of file
{"uuid": "b3e2056a-ff48-4cad-9256-137d9aa9a17a", "befores": [{"name": "case_data", "status": "passed", "start": 1699242018227, "stop": 1699242018229}], "start": 1699242018227, "stop": 1699242018301}
\ No newline at end of file
{"uuid": "bf07d322-ded5-4703-af87-40b120863eff", "befores": [{"name": "update_key", "status": "passed", "start": 1699242016423, "stop": 1699242016423}], "start": 1699242016423, "stop": 1699242016543}
\ No newline at end of file
{"uuid": "efd42501-fe7f-42df-a47b-4dd5d99ef49c", "befores": [{"name": "method", "status": "passed", "start": 1699242016700, "stop": 1699242016700}], "start": 1699242016700, "stop": 1699242016824}
\ No newline at end of file
{"uuid": "54df1be7-c9b2-4ff6-bd26-3f72aabab5d0", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242018044, "stop": 1699242018044}], "start": 1699242018044, "stop": 1699242018103}
\ No newline at end of file
{"uuid": "d4e34f63-82e2-46de-9b0c-ac53b7a0fc2b", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242016423, "stop": 1699242016423}], "start": 1699242016423, "stop": 1699242016544}
\ No newline at end of file
{"uuid": "569aca25-39ac-41af-aa41-26113f9c67ab", "befores": [{"name": "update_key", "status": "passed", "start": 1699242017031, "stop": 1699242017031}], "start": 1699242017031, "stop": 1699242017132}
\ No newline at end of file
{"uuid": "67372921-d7ca-4b38-b612-327c8c5e1ae5", "befores": [{"name": "method", "status": "passed", "start": 1699242017264, "stop": 1699242017264}], "start": 1699242017264, "stop": 1699242017363}
\ No newline at end of file
{"name": "正向用例", "status": "passed", "attachments": [{"name": "stdout", "source": "b13c9579-8388-47bb-9364-dc4472c38074-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'认证接口'"}, {"name": "api_name", "value": "'刷新token'"}, {"name": "title", "value": "'正向用例'"}, {"name": "level", "value": "'get'"}, {"name": "method", "value": "'get'"}, {"name": "url", "value": "'http://120.46.172.186:8080/refresh'"}, {"name": "mime", "value": "None"}, {"name": "case_data", "value": "None"}, {"name": "expect_data", "value": "{'loginStatus': True}"}, {"name": "sql_sentence", "value": "None"}, {"name": "sql_sentence_type", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1699242017374, "stop": 1699242017468, "uuid": "2df9e9b8-cd17-4028-a92d-f5a9a37a5c9f", "historyId": "536961674de62e406095ab066751431e", "testCaseId": "0abeaba8f176b6785a0334bed7c1bdad", "fullName": "test_bpm.TestBPM#test_bpm", "labels": [{"name": "feature", "value": "认证接口"}, {"name": "story", "value": "刷新token"}, {"name": "severity", "value": "get"}, {"name": "epic", "value": "BPM项目"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-HUPO1RF0"}, {"name": "thread", "value": "12256-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_bpm"}]}
\ No newline at end of file
{"state":false,"message":"添加维度信息失败,维度编码【code】必填!","logId":"1721371906025734144"}
{"uuid": "c392908c-5142-4186-a22d-539774241f78", "befores": [{"name": "case_data", "status": "passed", "start": 1699242017158, "stop": 1699242017158}], "start": 1699242017158, "stop": 1699242017252}
\ No newline at end of file
{"uuid": "dfc7b2cb-13ff-4347-aa48-ade0ca7c4a98", "befores": [{"name": "sql_sentence_type", "status": "passed", "start": 1699242017641, "stop": 1699242017641}], "start": 1699242017641, "stop": 1699242017691}
\ No newline at end of file
{"uuid": "c1758bad-e0ae-4e66-92de-77d16ef18181", "befores": [{"name": "mime", "status": "passed", "start": 1699242016856, "stop": 1699242016856}], "start": 1699242016856, "stop": 1699242016981}
\ No newline at end of file
{"uuid": "3a5aa222-7b1e-4472-a6bb-6301b5877078", "befores": [{"name": "update_key", "status": "passed", "start": 1699242018130, "stop": 1699242018130}], "start": 1699242018130, "stop": 1699242018193}
\ No newline at end of file
{"uuid": "5274eb7d-4f96-4b91-bfdf-029f2247b73a", "befores": [{"name": "method", "status": "passed", "start": 1699242017830, "stop": 1699242017830}], "start": 1699242017830, "stop": 1699242018029}
\ No newline at end of file
{"uuid": "b04262e0-38a4-4845-b29b-75ff28193a9c", "befores": [{"name": "case_data", "status": "passed", "start": 1699242016421, "stop": 1699242016422}], "start": 1699242016421, "stop": 1699242016551}
\ No newline at end of file
{"uuid": "a5496e24-8121-4560-aa03-63d20729be9f", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242017373, "stop": 1699242017373}], "start": 1699242017373, "stop": 1699242017472}
\ No newline at end of file
{"uuid": "cbc5ebbc-5b15-486c-b3f3-2b830c2ab23a", "befores": [{"name": "sql_sentence", "status": "passed", "start": 1699242017373, "stop": 1699242017373}], "start": 1699242017373, "stop": 1699242017471}
\ No newline at end of file
{"uuid": "bfa971e3-cf27-46e2-8525-1685b4c7a9fa", "befores": [{"name": "url", "status": "passed", "start": 1699242016421, "stop": 1699242016421}], "start": 1699242016421, "stop": 1699242016555}
\ No newline at end of file
{"state":false,"message":"账号或密码错误","logId":"1721371901630103552"}
......@@ -3,9 +3,9 @@ import base64
import requests
from BPMInterfaceAutoTest.common import log
from BPMInterfaceAutoTest.common.read_excel import ReadExcel
from BPMInterfaceAutoTest.common.read_ini import ReadIni
from BPMInterfaceAutoTest_V2.common import log
from BPMInterfaceAutoTest_V2.common.read_excel import ReadExcel
from BPMInterfaceAutoTest_V2.common.read_ini import ReadIni
class RequestMethods:
......
# -*-coding:utf-8 -*- #
import pytest
from BPMInterfaceAutoTest_V2.common.db import DB
from BPMInterfaceAutoTest_V2.request_methods.request_methods import RequestMethods
@pytest.fixture(scope="session")
def request_fix():
request_methods = RequestMethods()
return request_methods
@pytest.fixture(scope="session")
def db_fix():
db = DB()
yield db
db.close()
# def pytest_collection_modifyitems(items):
# # item表示每个测试用例,解决用例名称中文显示问题
# for item in items:
# item.name = item.name.encode("utf-8").decode("unicode-escape")
# item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
[pytest]
;开启日志
;log_cli=true
;设置日志的级别,如果不设置级别的话,可以设置为NOTSET,如果要设置级别,级别可以有debug,info,warning,error,致命
;log_level=NOTSET
;设置日志显示的信息格式
;log_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置日志中时间显示的格式
;log_date_format=%Y-%m-%d %H:%M:%S
;每个py文件运行的时候追加的命令
;addopts=-vs
;设置日志保存的文件
log_file = ./report/log/bpm_接口自动化框架最新运行日志.log
;设置日志保存在文件中的级别
log_file_level = error
;设置日志在文件中的信息格式
log_file_format = %(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置文件日志中时间显示的格式
log_file_date_format = %Y-%m-%d %H:%M:%S
\ No newline at end of file
++ "b/BPMInterfaceAutoTest_V2/test_case/test_ls/report/log/bpm_\346\216\245\345\217\243\350\207\252\345\212\250\345\214\226\346\241\206\346\236\266\346\234\200\346\226\260\350\277\220\350\241\214\346\227\245\345\277\227.log"
......@@ -2,15 +2,16 @@
import allure
import pytest
from BPMInterfaceAutoTest.common import log
from BPMInterfaceAutoTest.common.read_excel import ReadExcel
from BPMInterfaceAutoTest_V2.common import log
from BPMInterfaceAutoTest_V2.common.read_excel import ReadExcel
class TestBPM:
@allure.epic("BPM项目")
@pytest.mark.parametrize(
"module_name, api_name, title, level, method, url, mime, case_data, expect_data, sql_sentence, sql_sentence_type, update_key",
ReadExcel().get_data())
ReadExcel("BPM_ls", "ls/BPMInterfaceAutoTest.xlsx", "ls/case_data.json", "ls/expect_data.json",
"ls/sql_sentence.json").get_data())
def test_bpm(self, request_fix, db_fix, module_name, api_name, title, level, method, url, mime, case_data,
expect_data, sql_sentence, sql_sentence_type, update_key):
allure.dynamic.feature(module_name)
......
# -*-coding:utf-8 -*- #
import pytest
from BPMInterfaceAutoTest_V2.common.db import DB
from BPMInterfaceAutoTest_V2.request_methods.request_methods import RequestMethods
@pytest.fixture(scope="session")
def request_fix():
request_methods = RequestMethods()
return request_methods
@pytest.fixture(scope="session")
def db_fix():
db = DB()
yield db
db.close()
# def pytest_collection_modifyitems(items):
# # item表示每个测试用例,解决用例名称中文显示问题
# for item in items:
# item.name = item.name.encode("utf-8").decode("unicode-escape")
# item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
[pytest]
;开启日志
;log_cli=true
;设置日志的级别,如果不设置级别的话,可以设置为NOTSET,如果要设置级别,级别可以有debug,info,warning,error,致命
;log_level=NOTSET
;设置日志显示的信息格式
;log_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置日志中时间显示的格式
;log_date_format=%Y-%m-%d %H:%M:%S
;每个py文件运行的时候追加的命令
;addopts=-vs
;设置日志保存的文件
log_file = ./report/log/bpm_接口自动化框架最新运行日志.log
;设置日志保存在文件中的级别
log_file_level = error
;设置日志在文件中的信息格式
log_file_format = %(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置文件日志中时间显示的格式
log_file_date_format = %Y-%m-%d %H:%M:%S
\ No newline at end of file
++ "b/BPMInterfaceAutoTest_V2/test_case/test_zhangsan/report/log/bpm_\346\216\245\345\217\243\350\207\252\345\212\250\345\214\226\346\241\206\346\236\266\346\234\200\346\226\260\350\277\220\350\241\214\346\227\245\345\277\227.log"
# -*-coding:utf-8 -*- #
import allure
import pytest
from BPMInterfaceAutoTest_V2.common import log
from BPMInterfaceAutoTest_V2.common.read_excel import ReadExcel
class TestBPM:
@allure.epic("BPM项目")
@pytest.mark.parametrize(
"module_name, api_name, title, level, method, url, mime, case_data, expect_data, sql_sentence, sql_sentence_type, update_key",
ReadExcel("BPM_zhangsan", "zhangsan/BPMInterfaceAutoTest.xlsx", "zhangsan/case_data.json",
"zhangsan/expect_data.json",
"zhangsan/sql_sentence.json").get_data())
def test_bpm(self, request_fix, db_fix, module_name, api_name, title, level, method, url, mime, case_data,
expect_data, sql_sentence, sql_sentence_type, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
if sql_sentence_type == "delete":
db_fix.delete(sql_sentence["delete"])
elif sql_sentence_type == "select":
select_result = db_fix.select(sql_sentence.get("select"))
case_data[update_key] = select_result
elif sql_sentence_type == "select|delete" or sql_sentence_type == "delete|select":
db_fix.delete(sql_sentence["delete"])
select_result = db_fix.select(sql_sentence.get("select"))
case_data[update_key] = select_result
res = request_fix.request_all(method=method, url=url, case_data=case_data, mime=mime)
print(res.text)
for key in expect_data:
try:
assert expect_data[key] == res.json()[key]
except AssertionError:
log.error("断言失败,预期结果为:" + str(expect_data) + ",实际结果为:" + str(res.json()))
raise ValueError("断言失败")
if __name__ == '__main__':
pytest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment