Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix punycode module depreciation warning (node v22.7.0) #8337

Open
di5ko opened this issue Nov 6, 2024 · 2 comments
Open

Fix punycode module depreciation warning (node v22.7.0) #8337

di5ko opened this issue Nov 6, 2024 · 2 comments
Assignees
Labels
STATE: Issue accepted An issue has been reproduced. TYPE: bug The described behavior is considered as wrong (bug).

Comments

@di5ko
Copy link

di5ko commented Nov 6, 2024

What is your Scenario?

When running any test, I get a punycode depreciation warning from node.

What is the Current behavior?

Receiving a punycode depreciation warning from node.

What is the Expected behavior?

No deprecation warning.

What is the public URL of the test page? (attach your complete example)

http://devexpress.github.io/testcafe/example/

What is your TestCafe test code?

import { Selector } from 'testcafe';

fixture `My fixture`
    .page `http://devexpress.github.io/testcafe/example/`;

test('Assertion with Selector', async t => {
    const developerNameInput = Selector('#developer-name');

    // Populate the developer name field
    await t.typeText(developerNameInput, 'Peter');

    // The await keyword precedes the Selector declaration.
    // TestCafe executes the Selector immediately, and passes its return value ("Peter") to the variable.
    const developerName = await Selector('#developer-name').value;

    await t
            .expect(developerName).eql('Peter')
            .typeText(developerNameInput, 'Jack') // Update the content of the field
            .expect(developerName).eql('Jack'); // The "developerName" variable contains outdated data. The assertion fails.
});

Your complete configuration file

None.

Your complete test report

~/git/e2e-testing/testcafe-poc  $ npx testcafe chrome:headless test.js
(node:25603) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Running tests in:
- Chrome 130.0.0.0 / Sequoia 15

My fixture
✖ Assertion with Selector

   1) AssertionError: expected 'Peter' to deeply equal 'Jack'

      + expected - actual

      -Peter
      +Jack


      Browser: Chrome 130.0.0.0 / Sequoia 15

         14 |    const developerName = await Selector('#developer-name').value;
         15 |
         16 |    await t
         17 |            .expect(developerName).eql('Peter')
         18 |            .typeText(developerNameInput, 'Jack') // Update the content of the field
       > 19 |            .expect(developerName).eql('Jack'); // The "developerName" variable contains outdated data. The assertion fails.
         20 |});
         21 |
         22 |

         at <anonymous> (/Users/xxx/git/e2e-testing/testcafe-poc/test.js:19:36)
         at asyncGeneratorStep (/Users/xxx/git/e2e-testing/testcafe-poc/test.js:1:37)
         at _next (/Users/xxx/git/e2e-testing/testcafe-poc/test.js:1:37)



1/1 failed (4s)

Screenshots

No response

Steps to Reproduce

  1. Install Testcafe
  2. Install node (v22.7.0 (or above?))
  3. Run test

TestCafe version

3.7.0

Node.js version

22.7.0

Command-line arguments

npx testcafe chrome:headless test.js

Browser name(s) and version(s)

Chrome 130

Platform(s) and version(s)

MacOS 15.0

Other

No response

@di5ko di5ko added the TYPE: bug The described behavior is considered as wrong (bug). label Nov 6, 2024
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 6, 2024
@Bayheck Bayheck added STATE: Issue accepted An issue has been reproduced. and removed STATE: Need response An issue that requires a response or attention from the team. labels Nov 11, 2024
Copy link

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.

@Bayheck Bayheck self-assigned this Nov 11, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Nov 27, 2024

Hello, I reviewed the issue and here is what I found:

We have a prod dependency in testcafe-hammerhead "tough-cookie" that uses deprecated punycode.

"tough-cookie" maintainers fixed this issue in version 5.

However, tough-cookie v4 has a "secure" option in getCookieStringSync used in testcafe-hammerhead.

tough-cookie v5 introduced a breaking change for this feature that leads to our tests failures.

This is blocking us now from moving from v4 to v5.
Perhaps v6 will include support for localhost or maybe a v5 minor.

There is an issue on this matter:
salesforce/tough-cookie#382

Currently, the plan is to wait for the tough-cookie fix.

Thanks for your contribution.

@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 27, 2024
@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Issue accepted An issue has been reproduced. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants