@winning-test/component 0.0.93 → 0.0.94

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winning-test/component",
3
- "version": "0.0.93",
3
+ "version": "0.0.94",
4
4
  "description": "",
5
5
  "main": "",
6
6
  "scripts": {
@@ -72,6 +72,22 @@ class Component extends require("@winning-test/autotest-webui/src/Component") {
72
72
  await super.waitUntilBeVisible();
73
73
  await this.browser.sleep(Component.delayTime);
74
74
  }
75
+
76
+ async waitUntilValueNotNull(count = 20) {
77
+ while (count > 0) {
78
+ const value = await this.getValue();
79
+ if (value) {
80
+ return value;
81
+ } else {
82
+ if (count > 1) {
83
+ count--;
84
+ await this.browser.sleep(500);
85
+ } else {
86
+ throw new Error('等待获取value失败');
87
+ }
88
+ }
89
+ }
90
+ }
75
91
  }
76
92
 
77
93
  module.exports = Component;