-
Notifications
You must be signed in to change notification settings - Fork 95
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
[Question] Does this work with webpack-dev-server ? #4
Comments
so it seems from what you have described is that
When you work locally, you can just reload the Cypress tests after the server bundles things, right? |
Thank you for this fast answer, Yes it's exactly that ! It seems to respond even before it has finished bundling modules, so my tests fail with this error : I tried to remove the watch in local and simply do something like :
But I still have the error, and I see cypress running before Webpack finishes bundling, and it displays a message in the console like : |
That’s really weird - someone how to investigate how to force webdev server to wait serving website until it bundles
…Sent from my iPhone
On Mar 16, 2018, at 12:14, Remy-Poirier ***@***.***> wrote:
Yes it's exactly that ! It seems to respond even before it has finished bundling modules, so my tests fail with this error : We attempted to make an http request to this URL but the request failed without a response
I tried to remove the watch in local and simply do something like :
"start-base": "webpack-dev-server",
"ci": "start-server-and-test start-base http://localhost:8080 cy:run",
But I still have the error, and I see cypress running before Webpack finishes bundling, and it displays a message in the console like : wait until bundle finished
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm experiencing a similar thing, at least it looks like this is related. I'm having an Angular CLI project and the way I have it setup is like this:
Notice that Here's the output I'm getting:
From this point on it just sits there, serves the app, cypress is never executed. I'm not 100% sure but it looks like, also in my case, judging by the output, that the server starts listening before it's done bundling the app. The fact that Angular CLI uses webpack behind the scenes kind of underlines that guess. |
I have created a test in https://github.com/bahmutov/ng-cli-test1 and it is not passing, opened bahmutov/ng-cli-test1#1 Hmm,
Yeah, because it uses function createHttp$(url, options) {
return Rx.Observable.catch(
head(url, parseHttpOptions(options)),
Rx.Observable.just([{statusCode: 999}])
)
.map(function (response) {
// Why is response in array here?
var statusCode = response[0].statusCode;
console.log('statusCode', statusCode)
solution use |
🎉 This issue has been resolved in version 1.1.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thank you so much for your quick support @bahmutov !! |
That's weird but it still displays 404 to me:
It's working with Update: looks like Angular CLI returns 404 for GET |
That is so weird, any reproducible steps?
…Sent from my iPhone
On Mar 31, 2018, at 18:59, Alexey Toksarov ***@***.***> wrote:
That's weird but it still displays 404 to me:
child next [ { 'http-get://localhost:4200': -404 } ]
It's working with http-get://localhost:4200/main.bundle.js URL though
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sure https://github.com/AlexeyToksarov/ng-wait-on-test Looks like this is because I use a slightly unusual setup with multiple apps in |
@AlexeyToksarov Where did you set the headers? |
@jspieker I didn't set different headers. I use |
@AlexeyToksarov Ah, seems like this workaround broke in Angular 6 then. I tried using |
@jspieker Sometimes, you can try to change localhost to 127.0.0.1 to fix the proxy issue. I has the similar issue with you and finally solved using 127.0.0.1. |
hello,
and it doesn't start the test after webpack is built. |
@andrei9669 I think you could try
Also, I'm not sure why the port is 3000 (it's 4200 by default) but if it's your actual port then it's fine |
@AlexeyToksarov nope, didn't work :/ |
|
I can confirm the GET approach works with the latest Create React App (CRA) Build using a Proxy when I run Cypress via cli:
|
Thank you for taking time to open a new issue. Please answer a few questions to help us fix it faster. You can delete text that is irrelevant to the issue.
Is this a bug report or a feature request?
It's a question
Description
Hi, I am trying to integrate your module, I find it in Cypress documentation.
I have a React Application build with Webpack, I use Webpack-dev-server, in my script I have :
"ci": "start-server-and-test start http://localhost:8080 cy:open",
Where start simply start my server by doing :
"start": "webpack-dev-server --watch",
And it seems to work fine, except that it doesn't wait the end of bundling before launching the test command, here is what happen in the console :
starting server using command "npm run start" and when url "http://localhost:8080" is responding running tests using command "cy:open"
webpack-dev-server --watch
http://localhost:8080/
webpack result is served from /
content is served from C:\Dev\workspace\setup\react
Here it should wait the bundle to be done, but instead of this, it launches the next command
cypress open
Do you have any idea of how I can accomplish what I want to do ?
Temporarily I set a sleep of 30s in my test runner but it's not maintainable.
The text was updated successfully, but these errors were encountered: