Skip to content

[BUG] Electron App not able to find the firstWindow of Teams. #20575

Open
@mastrzyz

Description

@mastrzyz

Context:

System:

  • OS: Windows 10
  • Memory: 8.51 GB / 31.72 GB

Binaries:

  • Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
  • Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
  • npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD

Languages:

  • Bash: 5.0.16 - C:\WINDOWS\system32\bash.EXE

Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

1. npm init
2. npm install playwright
const { _electron: electron } = require("playwright");

(async () => {
  const teamsAppLocation =
    "C:\\Users\\marcin\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe";

  // Launch Electron app.
  const electronApp = await electron.launch({
    executablePath: teamsAppLocation,
  });

  setInterval(() => {
    const result = electronApp.windows();
    const urls = result.map((r) => r.url());
    console.log(urls);
  }, 400);
})();

Describe the bug

We let the script start the script and iterate through each window.

The App loads and we only see 3 windows and never the main window.

[
  'file:///C:/Users/marcin/AppData/Local/Microsoft/Teams/current/resources/app.asar/lib/renderer/notifications/notifications.html',
  'file:///C:/Users/marcin/AppData/Local/Microsoft/Teams/current/resources/app.asar/lib/pluginhost/csp.html',
  'https://teams.microsoft.com/multi-window/?agent=electron&version='
]

this goes on for a long time and will not change.

If we "Kick start" the process by opening dev tools, we see a fourth window show up.
Ctrl+Shift+I

[
  'file:///C:/Users/marcin/AppData/Local/Microsoft/Teams/current/resources/app.asar/lib/renderer/notifications/notifications.html',
  'file:///C:/Users/marcin/AppData/Local/Microsoft/Teams/current/resources/app.asar/lib/pluginhost/csp.html',
  'https://teams.microsoft.com/multi-window/?agent=electron&version=',
  'https://teams.microsoft.com/_#/conversations/[email protected]?ctx=chat'
]

Could this be a missing .onPage event in Playwright not capturing the main window? Is there anyway for us to "force refresh" the current open pages in Playwright?

Thanks! this wasn't reproing in Selenium for more context.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions