@winning-test/component 0.0.93 → 0.0.95

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.95",
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;
@@ -187,6 +187,7 @@ class Page extends require("@winning-test/autotest-webui").Page {
187
187
  */
188
188
  async select(menuItem) {
189
189
  super.select(menuItem);
190
+ await that.blockComponent(`//div[@role="tab"][text()='${menuItem}']`).waitUntilBeVisible();
190
191
  that.loading();
191
192
  }
192
193