@winning-test/component 0.0.52 → 0.0.53

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.
@@ -175,6 +175,7 @@ class Page extends require("@winning-test/autotest-webui").Page {
175
175
  */
176
176
  async closePrintWindow(timeout = 20000) {
177
177
  let count = timeout / 500;
178
+ let closeFlag = false;
178
179
  while (count > 0) {
179
180
  let windows = await this.browser.webDriver.getAllWindowHandles();
180
181
  if (windows.length === 1) {
@@ -186,13 +187,17 @@ class Page extends require("@winning-test/autotest-webui").Page {
186
187
  try {
187
188
  await this.browser.switchToWindow(i);
188
189
  await this.browser.webDriver.close();
190
+ closeFlag = true;
189
191
  break;
190
192
  } catch (error) {
191
- console.log(error);
193
+ throw new Error(`关闭打印窗口失败: ${error.message}`);
192
194
  }
193
195
  }
194
196
  break;
195
197
  }
198
+ if (!closeFlag) {
199
+ throw new Error(`打印窗口未出现`);
200
+ }
196
201
  await this.browser.switchToWindow();
197
202
  }
198
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winning-test/component",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "",
5
5
  "main": "",
6
6
  "scripts": {