fix(接口测试): 修复xpath断言不生效的缺陷
--bug=1013211 --user=王孝刚 【接口测试】场景-请求中添加xpath 断言-执行结果中没有断言结果 https://www.tapd.cn/55049933/s/1160518
This commit is contained in:
parent
50526f3ed0
commit
c1330135f3
|
@ -25,6 +25,7 @@ import java.util.List;
|
||||||
public class MsAssertions extends MsTestElement {
|
public class MsAssertions extends MsTestElement {
|
||||||
private String clazzName = MsAssertions.class.getCanonicalName();
|
private String clazzName = MsAssertions.class.getCanonicalName();
|
||||||
|
|
||||||
|
private boolean scenarioAss;
|
||||||
private List<MsAssertionRegex> regex;
|
private List<MsAssertionRegex> regex;
|
||||||
private List<MsAssertionJsonPath> jsonPath;
|
private List<MsAssertionJsonPath> jsonPath;
|
||||||
private List<MsAssertionJSR223> jsr223;
|
private List<MsAssertionJSR223> jsr223;
|
||||||
|
@ -40,7 +41,7 @@ public class MsAssertions extends MsTestElement {
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, MsParameter msParameter) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, MsParameter msParameter) {
|
||||||
ParameterConfig config = (ParameterConfig) msParameter;
|
ParameterConfig config = (ParameterConfig) msParameter;
|
||||||
// 非导出操作,且不是启用状态则跳过执行
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
if (!config.isOperating() && !this.isEnable()) {
|
if (this.isScenarioAss() && !config.isOperating() && !this.isEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(this.getName())) {
|
if (StringUtils.isEmpty(this.getName())) {
|
||||||
|
|
|
@ -1142,6 +1142,7 @@ export default {
|
||||||
this.scenarioDefinition.forEach(item => {
|
this.scenarioDefinition.forEach(item => {
|
||||||
if (item.type === type) {
|
if (item.type === type) {
|
||||||
item.active = true;
|
item.active = true;
|
||||||
|
item.scenarioAss = true;
|
||||||
isAssertions = true;
|
isAssertions = true;
|
||||||
this.reloadTree = getUUID();
|
this.reloadTree = getUUID();
|
||||||
}
|
}
|
||||||
|
@ -1151,6 +1152,7 @@ export default {
|
||||||
for (let i in this.scenarioDefinition) {
|
for (let i in this.scenarioDefinition) {
|
||||||
if (this.scenarioDefinition[i].type === "Assertions") {
|
if (this.scenarioDefinition[i].type === "Assertions") {
|
||||||
this.scenarioDefinition[i].active = true;
|
this.scenarioDefinition[i].active = true;
|
||||||
|
this.scenarioDefinition[i].scenarioAss = true;
|
||||||
let assertions = this.scenarioDefinition[i];
|
let assertions = this.scenarioDefinition[i];
|
||||||
this.scenarioDefinition.splice(i, 1);
|
this.scenarioDefinition.splice(i, 1);
|
||||||
this.scenarioDefinition.unshift(assertions);
|
this.scenarioDefinition.unshift(assertions);
|
||||||
|
|
Loading…
Reference in New Issue