This works

This commit is contained in:
Nathan Bierema 2021-06-06 14:31:07 -04:00
parent 380133a22a
commit 4d673247cd

View File

@ -31,15 +31,16 @@ describe('DevTools panel for Electron', function () {
it('should open Redux DevTools tab', async () => { it('should open Redux DevTools tab', async () => {
const originalWindow = await this.driver.getWindowHandle(); const originalWindow = await this.driver.getWindowHandle();
const windows = await this.driver.getAllWindowHandles(); console.log(await this.driver.getCurrentUrl());
for (const window of windows) { if (!(await this.driver.getCurrentUrl()).startsWith('devtools')) {
if (window !== originalWindow) { const windows = await this.driver.getAllWindowHandles();
for (const window of windows) {
if (window === originalWindow) continue;
await this.driver.switchTo().window(window); await this.driver.switchTo().window(window);
// if ((await this.driver.getCurrentUrl()).startsWith('devtools')) { if ((await this.driver.getCurrentUrl()).startsWith('devtools')) {
// break; break;
// } }
} }
// await delay(2000);
} }
expect(await this.driver.getCurrentUrl()).toMatch( expect(await this.driver.getCurrentUrl()).toMatch(
/devtools:\/\/devtools\/bundled\/devtools_app.html/ /devtools:\/\/devtools\/bundled\/devtools_app.html/
@ -47,8 +48,6 @@ describe('DevTools panel for Electron', function () {
await this.driver.manage().timeouts().pageLoadTimeout(5000); await this.driver.manage().timeouts().pageLoadTimeout(5000);
// await this.driver.wait(() => window.UI && window.UI.inspectorView, 5000);
const id = await this.driver.executeAsyncScript(function (callback) { const id = await this.driver.executeAsyncScript(function (callback) {
let attempts = 5; let attempts = 5;
function showReduxPanel() { function showReduxPanel() {