testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

Firefox: browserClient.closeBrowserChildWindow is not a function

Open florachen-okta opened this issue 3 years ago • 1 comments

What is your Scenario?

I have multiple windows running and test with Firefox browser.

What is the Current behavior?

Testcafe throws

 Unhandled promise rejection:
      TypeError: browserClient.closeBrowserChildWindow is not a function

What is the Expected behavior?

The error shouldn't be thrown. This used to work on v1.18, and if switch to chrome the test is passed.

What is your public website URL? (or attach your complete example)

https://testcafe.io/

What is your TestCafe test code?

fixture `Microsoft DevBlogs Login page`
    .page('https://devblogs.microsoft.com/');

test('should pass', async (t) => {
await t
    .click('.login-but') 
    .click('.nsl-button-google') 
    .closeWindow();
});

Your complete configuration file

No response

Your complete test report


   1) Unhandled promise rejection:
      
      TypeError: browserClient.closeBrowserChildWindow is not a function

      Browser: Firefox 104.0 / macOS 10.15

Screenshots

No response

Steps to Reproduce

  1. Try the testcode
  2. Run tests with firefox browser.

TestCafe version

2.0.0

Node.js version

v16.15.1

Command-line arguments

testcafe firefox test.js

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

florachen-okta avatar Sep 08 '22 18:09 florachen-okta

Hi @florachen-okta

Thank you for the shared information. I've reproduced the issue.

miherlosev avatar Sep 12 '22 04:09 miherlosev

Note: We have the same issue with the rule, but the error shows up in the first test using the role.

Like:

Role(...,async (t) => { await operationsOpeningPopup().closeWindow() })

Then the first test using this role fails with this error:

   1) - Error in Role initializer -
      Unhandled promise rejection:
      
      TypeError: browserClient.closeBrowserChildWindow is not a function
      at BrowserProviderPluginHost.closeBrowserChildWindow
      (/home/roman/dev/include-cloud/node_modules/testcafe/src/browser/provider/built-in/dedicated/base.js:108:30)
      at BrowserProvider.closeBrowserChildWindow
      (/home/roman/dev/include-cloud/node_modules/testcafe/src/browser/provider/index.ts:444:27)
      at _onCloseWindowRequest
      (/home/roman/dev/include-cloud/node_module

Follow up tests do work.

gamlerhart avatar Sep 30 '22 13:09 gamlerhart

Hi @gamlerhart,

Thank you for sharing the example. The issue is reproduced in any part of a test.

Aleksey28 avatar Oct 03 '22 06:10 Aleksey28

I'm running into the same issue as well. Turns out to be only happening on firefox, not chrome.

thomaswong79 avatar Dec 05 '22 22:12 thomaswong79

  • Fails for Chrome 102 as well:
  • testcafe: "2.1.0",
Unhandled promise rejection:
    TypeError: browserClient.closeBrowserChildWindow is not a function
   at BrowserProviderPluginHost.closeBrowserChildWindow (.../node_modules/testcafe/src/browser/provider/built-in/dedicated/base.js:108:30)

amiablea2 avatar Dec 13 '22 06:12 amiablea2

@AlexKamaev is this something that has been introduced for #6037?

exommlr avatar Aug 15 '23 08:08 exommlr

@exommlr Yes, I've checked it. We changed the priority of this issue, so we will discuss it in the near future.

AlexKamaev avatar Aug 16 '23 08:08 AlexKamaev

Release v3.3.0-rc.1 addresses this.

github-actions[bot] avatar Aug 23 '23 09:08 github-actions[bot]

@AlexKamaev thank you very much for fixing this!

exommlr avatar Aug 23 '23 15:08 exommlr