@salesforcedevs/sfdocs-e2e 1.0.11-toolbar.1 → 1.0.11-toolbar.2

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": "@salesforcedevs/sfdocs-e2e",
3
- "version": "1.0.11-toolbar.1",
3
+ "version": "1.0.11-toolbar.2",
4
4
  "description": "E2E test suite for SFDocs static portal pages (SSG)",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -79,9 +79,11 @@ class ContentActionToolbar {
79
79
  },
80
80
  );
81
81
 
82
- const newHandle = (await browser.getWindowHandles()).find(
83
- (handle) => !handlesBefore.includes(handle),
84
- ) as string;
82
+ const handlesAfter = await browser.getWindowHandles();
83
+ const newHandle = handlesAfter.find((handle) => !handlesBefore.includes(handle));
84
+ if (!newHandle) {
85
+ throw new Error('New browser tab opened but its handle could not be resolved');
86
+ }
85
87
  await browser.switchToWindow(newHandle);
86
88
  const url = await browser.getUrl();
87
89