@cloudscape-design/browser-test-tools 3.0.62 → 3.0.63

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "d7bcb3ca59f62f2a31f0ca6bf7421ceff6d9583e"
2
+ "commit": "6b0049b169562c51ec36f4d98e39a5e3917bcab2"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/browser-test-tools",
3
- "version": "3.0.62",
3
+ "version": "3.0.63",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/browser-test-tools.git"
@@ -80,4 +80,5 @@ export default class BasePageObject {
80
80
  initLiveAnnouncementsObserver(): Promise<void>;
81
81
  getLiveAnnouncements(): Promise<string[]>;
82
82
  clearLiveAnnouncements(): Promise<void>;
83
+ runInsideIframe(iframeSelector: string, shouldSwitch: boolean, callback: () => Promise<void>): Promise<void>;
83
84
  }
@@ -223,5 +223,15 @@ class BasePageObject {
223
223
  async clearLiveAnnouncements() {
224
224
  await this.browser.execute(liveAnnouncements.clearLiveAnnouncements);
225
225
  }
226
+ async runInsideIframe(iframeSelector, shouldSwitch, callback) {
227
+ if (!shouldSwitch) {
228
+ return callback();
229
+ }
230
+ const iframeEl = await this.browser.$(iframeSelector);
231
+ await this.browser.switchToFrame(iframeEl);
232
+ await callback();
233
+ // go back to top
234
+ await this.browser.switchToFrame(null);
235
+ }
226
236
  }
227
237
  exports.default = BasePageObject;