diff --git a/test-ui/src/views/test/uiTest/advancedSetting.vue b/test-ui/src/views/test/uiTest/advancedSetting.vue index 91b7707..bb56ee2 100644 --- a/test-ui/src/views/test/uiTest/advancedSetting.vue +++ b/test-ui/src/views/test/uiTest/advancedSetting.vue @@ -371,6 +371,183 @@ + +
+ + + +
+
判断实际结果是否与期望的一致,可添加多条断言
+ + + + + + + 添加 + +
+
弹窗文本
+
+
+ + + + + +
+
+ + +
+
+
+ +
+
元素断言
+
+
+
+ + + + + +
+ + + + + + +
+ +
+ + + + + + +
+
+
+
+ + +
+
+ + + + + + + + + + + + + + +
+
+
+ +
+
下拉框
+
+
+
+
+ + + + + +
+ + + + + + +
+ +
+ + + + + + +
+
+
+
+ + +
+
+
+ + + + + + +
+
+
+ +
+
网页标题
+
+
+ +
+
+ + +
+
+
+
+
+
+
@@ -436,6 +613,7 @@ export default { informationType: '1', windowType: null, elementType: null, + assertionType: null, }, searchForm: { pageNum: 1, @@ -549,6 +727,7 @@ export default { }, // 添加 - 后置操作 addAfter() { + console.log(this.saveForm.after) if (this.saveForm.after === '1') { // 等待时间 var param = { @@ -558,7 +737,7 @@ export default { isDisabled: '1', } this.saveForm.afterList.push(param) - } else { + } else if (this.saveForm.after === '3') { // 数据提取 var param = { settingType: '2', // 后置操作 @@ -571,6 +750,21 @@ export default { name: '数据提取', } this.saveForm.afterList.push(param) + } else { + // 断言 + var param = { + settingType: '2', // 后置操作 + operateType: '2', // 断言 + isDisabled: '1', + name: '断言', + assertionQOList: { + popupTexts: [], // 弹窗文本 + elementAssertions: [], // 元素断言 + dropdownBoxes: [], // 下拉框 + webTitles: [], // 网页标题 + }, + } + this.saveForm.afterList.push(param) } }, // 删除 @@ -652,6 +846,62 @@ export default { afterElemetDelete(val, val1) { this.saveForm.afterList[val].dataExtractionQOList.elementExtractions = this.saveForm.afterList[val].dataExtractionQOList.elementExtractions.filter((item, index) => index !== val1) }, + // 断言 + addAfterAssionQOList(index) { + var param = { + assertionType: this.saveForm.assertionType, + operateObject: null, // 操作对象 + operateGroupId: null, // 元素对象 + operateElementId: null, // 元素对象 + operateLocType: null, // 元素定位 + operateLocValue: null, // 元素定位 + isDisabled: '1', + expectations: null, // 网页标题 + expectations: null, // 期望值 + assertionMode: null, // 断言方式 + isPopText: null, + + } + switch (this.saveForm.assertionType) { + case '1': + // 弹窗文本 + this.saveForm.afterList[index].assertionQOList.popupTexts.push(param) + break + case '2': + // 元素断言 + this.saveForm.afterList[index].assertionQOList.elementAssertions.push(param) + break + case '3': + // 下拉框 + this.saveForm.afterList[index].assertionQOList.dropdownBoxes.push(param) + break + case '4': + // 网页标题 + this.saveForm.afterList[index].assertionQOList.webTitles.push(param) + break + } + }, + // 断言-删除 + deleteAssertion(type, val, val2) { + switch (type) { + case '1': + // 弹窗文本 + this.saveForm.afterList[val].assertionQOList.popupTexts = this.saveForm.afterList[val].assertionQOList.popupTexts.filter((item, index) => index !== val2) + break + case '2': + // 元素断言 + this.saveForm.afterList[val].assertionQOList.popupTexts = this.saveForm.afterList[val].assertionQOList.elementAssertions.filter((item, index) => index !== val2) + break + case '3': + // 下拉框 + this.saveForm.afterList[val].assertionQOList.popupTexts = this.saveForm.afterList[val].assertionQOList.dropdownBoxes.filter((item, index) => index !== val2) + break + case '4': + // 网页标题 + this.saveForm.afterList[val].assertionQOList.popupTexts = this.saveForm.afterList[val].assertionQOList.webTitles.filter((item, index) => index !== val2) + break + } + }, // 元素对象 getOperateGroup() { this.getElementListData(this.saveForm.operateGroupId) @@ -809,12 +1059,6 @@ export default { justify-content: space-between; width: 100%; - .time-left { - display: flex; - align-items: center; - gap: 10px; - } - .time-right { gap: 10px; display: flex; @@ -823,12 +1067,14 @@ export default { } } + .time-left { + display: flex; + align-items: center; + gap: 10px; + } + .collapse-content { padding: 15px; - - .information { - padding: 10px; - } } } @@ -837,5 +1083,9 @@ export default { display: flex; gap: 10px; } + + .information { + padding: 10px; + } }