testcafe
testcafe copied to clipboard
Firefox: browserClient.closeBrowserChildWindow is not a function
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
- Try the testcode
- 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
Hi @florachen-okta
Thank you for the shared information. I've reproduced the issue.
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.
Hi @gamlerhart,
Thank you for sharing the example. The issue is reproduced in any part of a test.
I'm running into the same issue as well. Turns out to be only happening on firefox, not chrome.
- 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)
@AlexKamaev is this something that has been introduced for #6037?
@exommlr Yes, I've checked it. We changed the priority of this issue, so we will discuss it in the near future.
Release v3.3.0-rc.1 addresses this.
@AlexKamaev thank you very much for fixing this!