@winning-test/component 0.0.64 → 0.0.66
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
|
@@ -48,6 +48,7 @@ class Component extends require("@winning-test/autotest-webui/src/Component") {
|
|
|
48
48
|
return await super.getValue();
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
|
|
51
52
|
async getAttribute(attributeName) {
|
|
52
53
|
await this.browser.sleep(Component.delayTime);
|
|
53
54
|
return await super.getAttribute(attributeName);
|
|
@@ -15,7 +15,10 @@ class DialogComponent extends require("./BlockComponent") {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
_createXpath() {
|
|
18
|
-
|
|
18
|
+
if (this.title){
|
|
19
|
+
return `//*[contains(normalize-space(text()),'${this.title}')]/ancestor::*[@role='dialog']`;
|
|
20
|
+
}
|
|
21
|
+
return `//*[@role='dialog']`;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
}
|
|
@@ -35,7 +35,9 @@ class TableComponent extends require("./Component") {
|
|
|
35
35
|
async getTableData() {
|
|
36
36
|
let ret = [];
|
|
37
37
|
let xpath = `(${this.getXpath()}${this._createBodyXapth()}//tr)[1]`;
|
|
38
|
-
await this.browser.
|
|
38
|
+
if (!(await this.browser.isDisplayed(xpath, this.browser.config.timeout))) {
|
|
39
|
+
return ret;
|
|
40
|
+
}
|
|
39
41
|
await this.browser.sleep(TableComponent.delayTime);
|
|
40
42
|
// 处理表头
|
|
41
43
|
if (!this._createHeaderXapth()) {
|
package/winex60/page/Page.js
CHANGED
|
@@ -166,6 +166,22 @@ class Page extends require("@winning-test/autotest-webui").Page {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
/**
|
|
170
|
+
* 关闭所有对话框
|
|
171
|
+
*/
|
|
172
|
+
async closeAllDialog() {
|
|
173
|
+
let count = 5;
|
|
174
|
+
while ((await this.dialogComponent().isDisplayed(500)) && count > 0) {
|
|
175
|
+
try {
|
|
176
|
+
await this.dialogComponent().blockComponent("//*[contains(@class,'el-dialog__close')]").click();
|
|
177
|
+
await this.dialogComponent().waitUntilBeNotVisible();
|
|
178
|
+
} catch (error) {
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
count--;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
169
185
|
}
|
|
170
186
|
|
|
171
187
|
module.exports = Page;
|