@winning-test/component 0.0.40 → 0.0.42

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.
@@ -33,6 +33,22 @@ class Component extends require("@winning-test/autotest-webui/src/Component") {
33
33
  await this.browser.sleep(Component.delayTime);
34
34
  }
35
35
 
36
+ /**
37
+ * 慢吞吞输入
38
+ * @param {...String} agrs 输入值
39
+ */
40
+ async inputSlowly(...agrs) {
41
+ for (let i = 0; i < agrs.length; i++) {
42
+ const agr = agrs[i];
43
+ for (let j = 0; j < agr.length; j++) {
44
+ const chr = agr[j];
45
+ await super.input(chr);
46
+ }
47
+
48
+ }
49
+ await this.browser.sleep(Component.delayTime);
50
+ }
51
+
36
52
  async clear() {
37
53
  await super.clear();
38
54
  await this.browser.sleep(Component.delayTime);
@@ -156,7 +156,11 @@ class Page extends require("@winning-test/autotest-webui").Page {
156
156
  */
157
157
  async loading() {
158
158
  try {
159
- const xpath = "//*[contains(@class,'el-loading-mask') and (not (ancestor-or-self::*[contains(@style,'display: none')]))]";
159
+ let xpath = "//*[contains(@class,'el-loading-mask') and (not (ancestor-or-self::*[contains(@style,'display: none')]))]";
160
+ if (await this.browser.isDisplayed(xpath, 200)) {
161
+ await this.browser.waitUntilElementBeNotVisible(xpath);
162
+ }
163
+ xpath = "//*[contains(text(),'加载中') and (not (ancestor-or-self::*[contains(@style,'display: none')]))]";
160
164
  if (await this.browser.isDisplayed(xpath, 200)) {
161
165
  await this.browser.waitUntilElementBeNotVisible(xpath);
162
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winning-test/component",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "",
5
5
  "main": "",
6
6
  "scripts": {