@winning-test/component 0.0.88 → 0.0.89

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.88",
3
+ "version": "0.0.89",
4
4
  "description": "",
5
5
  "main": "",
6
6
  "scripts": {
@@ -34,12 +34,15 @@ class TableComponent extends require("./Component") {
34
34
  */
35
35
  async getTableData() {
36
36
  let ret = [];
37
+ // 先判断表单是否有数据,没有的话返回[]
37
38
  let z_xpath = `${this.getXpath()}${this._createBodyXapth()}`
38
- await this.browser.waitUntilElementBeVisible(z_xpath);
39
+ if(!await this.browser.isDisplayed(`${z_xpath}`, 2000)) {
40
+ return ret;
41
+ }
39
42
  if(!await this.browser.isDisplayed(`${z_xpath}//tr`, 2000)) {
40
43
  return ret;
41
44
  }
42
-
45
+ // 默认表格有数据
43
46
  let xpath = `(${this.getXpath()}${this._createBodyXapth()}//tr)[1]`;
44
47
  await this.browser.waitUntilElementBeVisible(xpath);
45
48
  await this.browser.sleep(TableComponent.delayTime);