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

Testcafe promise bug #2255

Closed
Meemaw opened this issue Feb 23, 2020 · 8 comments · Fixed by #2261
Closed

Testcafe promise bug #2255

Meemaw opened this issue Feb 23, 2020 · 8 comments · Fixed by #2261

Comments

@Meemaw
Copy link

Meemaw commented Feb 23, 2020

What is your Test Scenario?

Test an application doing HTTP requests using ky-universal.

What is the Current behavior?

Testcafe crashes on what seems to be cloning of a promise.

What is the Expected behavior?

Testcafe should not crash.

Screenshot 2020-02-23 at 18 26 55

Steps to Reproduce:

➜ git clone https://github.com/Meemaw/testcafe-ky-bug.git
➜ cd testcafe-ky-bug
➜ yarn install
➜ yarn start # If you go to http://localhost:3000 you should see list of "comments" being rendered

In a new terminal:

➜ yarn testcafe chrome e2e/specs -f '<TestcafeBug />'

I'm fairly sure you can reproduce this in any setup.

Your Environment details:

  • testcafe version: 1.8.2
  • node.js version: v10.16.0
  • platform and version: macOS 10.14.6
@AlexSkorkin
Copy link
Contributor

I've tried to download your sample but my attempts were unsuccessful. How can we access it?

git clone --branch testcafe-bug [email protected]:Meemaw/Insight.git testcafe-ky-bug
Cloning into 'testcafe-ky-bug'...
The authenticity of host 'github.com (140.82.118.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,140.82.118.3' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

@Meemaw
Copy link
Author

Meemaw commented Feb 24, 2020

Can you try cloning using the HTTP(S), e.g.:

➜ git clone --branch testcafe-bug https://github.com/Meemaw/Insight.git testcafe-ky-bug

@alexey-lin
Copy link
Contributor

Hi @Meemaw,

I successfully cloned the repo and managed to start the application. Yet, now I get the following error when trying to launch tests:

ERROR Cannot load a client script from ../../node_nodules/@testing-library/dom/d
ist/@testing-library/dom.umd.js.

@Meemaw
Copy link
Author

Meemaw commented Feb 26, 2020

@alexey-lin, @AlexSkorkin I've created a new repo for this and updated the "Steps to reproduce" for a much easier setup.

@LavrovArtem
Copy link
Contributor

I've debugged this issue. It's caused by the fact that Hammerhead incorrectly processes the following piece of your code:

window["%hammerhead%"].processScript(
    'async function f() { result[type] = (await result).clone(); }')

// actual
// async function f() {  __set$(result,type,await (result).clone()); }
// expected
// async function f() {  __set$(result,type,(await result).clone()); }

@Meemaw
Copy link
Author

Meemaw commented Feb 27, 2020

Any estimates on time it will take to fix this? This seems like a quite problematic bug preventing one from using Testcafe at all.

@Dmitry-Ostashev
Copy link

Currently, we cannot provide any estimates, however, we would appreciate your PR.

@AndreyBelym AndreyBelym added this to the Sprint #52 milestone Mar 3, 2020
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Mar 4, 2020
@LavrovArtem LavrovArtem linked a pull request Mar 4, 2020 that will close this issue
@lock
Copy link

lock bot commented Mar 17, 2020

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Mar 17, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants