Open Tonsil opened 2 weeks ago
Thank you for submitting a bug report. We would love to help you investigate the issue. Please share a simple code example that reliably reproduces the bug. For more information, read the following article: How To Create a Minimal Working Example When You Submit an Issue. We look forward to your response.
Here's as simple as I can make this. There are 2 files you need to witness the bug.
var shell = require("shelljs");
const shellCommand = npx testcafe "chrome --auto-open-devtools-for-tabs" ./src/test/javascript/example/ --fixture 'Example' --debug-on-fail -c 1 example --disable-native-automation --page-load-timeout 10 --disable-page-caching --color
;
console.debug("Command: ", shellCommand);
shell.exec(shellCommand);
process.exit(0);
2. test file
fixture('Example') .page('http://pupation.com/test_hammerhead.html'); test('My first test', async t => { // Test code goes here await t.debug(); });`
as written, the test file should be in an `example/` directory.
I'm hosting the html and javascript files to make things easier, but I will attach all 4 in case that helps.
[hammerhead_issue_3030.zip](https://github.com/user-attachments/files/17708123/hammerhead_issue_3030.zip)
To see the bug, when you run an `npx` command directly:
npx testcafe "chrome --auto-open-devtools-for-tabs" ./src/test/javascript/example/ --fixture 'Example' --debug-on-fail -c 1 example --disable-native-automation --page-load-timeout 10 --disable-page-caching --color
the test will show in the developer tools console "SUCCESS, #collect is a function".
When you use an npm runner script:
npm test --prefix=src/test/javascript -- --browser "chrome:headless" --debugOnFail=false --clientConfigEnv=dev --tagEnv=dev --txEnv=dev --concurrency=5 --retriesPerBrowser 1
the test will show in the developer tools console "FAIL, #collect is undefined".
What is your Scenario?
I'm working on a module for Prebid.js, and their library code contains the following function (see here)
What is the Current behavior?
I'm using TestCafe to run a suite of tests using
npm run
. I am seeing the error:TypeError: this.collect is not a function
. The code is transformed from this:into this:
The problem is that it's trying to call
this.collect
instead ofthis.#collect
.What is the Expected behavior?
The
static all
function should be callingthis.#collect
after transformation. Any other references in that file that start with#
should be unchanged.What is your public website URL? (or attach your complete example)
N/A
What is your TestCafe test code?
N/A
Your complete configuration file
No response
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
N/A
TestCafe version
3.6.2
Node.js version
21.7.3
Command-line arguments
N/A
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
This is very similar to https://github.com/DevExpress/testcafe-hammerhead/issues/3012 , but I don't know if it's the same issue. Please consolidate if they do have the same root cause.