mercredi 21 octobre 2020

How to implement multi-window support in my custom browser provider plugin

I've updated to testcafe v1.9.4 and I would like to make use of the new multi-windows support. However I use a custom browser provider.

When I run a test with openWindow I get the error

Multi window mode is supported in Chrome, Chromium, Edge 84+ and Firefox only. Run tests in these browsers to use the "openWindow" method.

If I add the following methods to my browser provider

supportMultipleWindows: true,

  getActiveWindowId(browserId) {
    return this.openedBrowsers[browserId].activeWindowId;
  },

  setActiveWindowId(browserId, val) {
    this.openedBrowsers[browserId].activeWindowId = val;
  },

Then my browser will start, but no longer open the url of the page under test, it just hangs on the browser idle page.

I have not found any documentation and the Testcafe browser provider generator seems to have not been changed to document or implement multi-window support. Therefore I'm asking here.

Aucun commentaire:

Enregistrer un commentaire