@winning-test/component 0.0.89 → 0.0.90
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,10 +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, force_multi = false) {
|
|
14
14
|
super(browser);
|
|
15
15
|
this.placeholder = placeholder;
|
|
16
16
|
this.label = label;
|
|
17
|
+
this.force_multi = force_multi;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
_createXpath() {
|
|
@@ -35,7 +36,7 @@ class SelectComponent extends require("./Component") {
|
|
|
35
36
|
while (count > 0) {
|
|
36
37
|
try {
|
|
37
38
|
await this._select(...items);
|
|
38
|
-
if (items.length > 1){ // 多选不检查value
|
|
39
|
+
if (items.length > 1 || this.force_multi){ // 多选不检查value
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
42
|
const value = await this.getValue();
|
|
@@ -65,7 +66,7 @@ class SelectComponent extends require("./Component") {
|
|
|
65
66
|
await (await this.browser.findElement(xpath)).click();
|
|
66
67
|
let listComponent = new ListComponent(this.browser);
|
|
67
68
|
await listComponent.select(...items);
|
|
68
|
-
if (items.length > 1) {
|
|
69
|
+
if (items.length > 1 || this.force_multi) {
|
|
69
70
|
xpath = this.getXpath();
|
|
70
71
|
await (await this.browser.findElement(xpath)).click();
|
|
71
72
|
}
|