@winning-test/component 0.0.90 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -10,11 +10,11 @@ class SelectComponent extends require("./Component") {
|
|
|
10
10
|
* @param {String} placeholder 背景文字
|
|
11
11
|
* @param {String} label 标签
|
|
12
12
|
*/
|
|
13
|
-
constructor(browser, placeholder, label,
|
|
13
|
+
constructor(browser, placeholder, label, forceMulti = false) {
|
|
14
14
|
super(browser);
|
|
15
15
|
this.placeholder = placeholder;
|
|
16
16
|
this.label = label;
|
|
17
|
-
this.
|
|
17
|
+
this.forceMulti = forceMulti;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
_createXpath() {
|
|
@@ -36,7 +36,7 @@ class SelectComponent extends require("./Component") {
|
|
|
36
36
|
while (count > 0) {
|
|
37
37
|
try {
|
|
38
38
|
await this._select(...items);
|
|
39
|
-
if (items.length > 1 || this.
|
|
39
|
+
if (items.length > 1 || this.forceMulti){ // 多选不检查value
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
42
|
const value = await this.getValue();
|
|
@@ -66,7 +66,7 @@ class SelectComponent extends require("./Component") {
|
|
|
66
66
|
await (await this.browser.findElement(xpath)).click();
|
|
67
67
|
let listComponent = new ListComponent(this.browser);
|
|
68
68
|
await listComponent.select(...items);
|
|
69
|
-
if (items.length > 1 || this.
|
|
69
|
+
if (items.length > 1 || this.forceMulti) {
|
|
70
70
|
xpath = this.getXpath();
|
|
71
71
|
await (await this.browser.findElement(xpath)).click();
|
|
72
72
|
}
|
package/rpes5.6/page/Page.js
CHANGED
|
@@ -103,10 +103,11 @@ class Page extends require("@winning-test/autotest-webui").Page {
|
|
|
103
103
|
* 获取选择器组件
|
|
104
104
|
* @param {String} placeholder 背景文字
|
|
105
105
|
* @param {String} label 标签
|
|
106
|
+
* @param {String} forceMulti 多选标志
|
|
106
107
|
* @returns 选择器组件
|
|
107
108
|
*/
|
|
108
|
-
selectComponent(placeholder, label) {
|
|
109
|
-
return new SelectComponent(this.browser, placeholder, label);
|
|
109
|
+
selectComponent(placeholder, label, forceMulti) {
|
|
110
|
+
return new SelectComponent(this.browser, placeholder, label, forceMulti);
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
/**
|