Giter VIP home page Giter VIP logo

Comments (7)

MikeMcC399 avatar MikeMcC399 commented on June 18, 2024 1

@eabusharkh77

Which operating system are you using?
Which version of Node.js?
Which browser are you using?

Did you start the server with npm start?
Can you access http://localhost:8080 manually in a browser?
Did you start the test with npm run cy:open?

I checked it locally on Windows 11 with Node.js 18 and it worked for me.

from cypress-example-kitchensink.

MikeMcC399 avatar MikeMcC399 commented on June 18, 2024 1

@eabusharkh77

thank you that worked for me now.

It's good to hear that your issue is now solved.

I'm not sure why my modified cypress config file was causing the 404 issue though?

I don't say that your modified config file caused the issue. It was just a sign for me that you had modified the example repository. Perhaps you also installed other software which deleted the file app/todo.html?

do I have to run the above 2 commands each time I launch cypress or can I just type: npx cypress open?

npm install is necessary after the initial cloning and if you fetch an upstream update from this repository.

npx cypress open only starts cypress. It does not start the server. That is why there is a script defined which you can call through npm run local:open which starts the server and Cypress.

The README: Help and Testing says:

If you get stuck, here is more help:

You may also want to look at Cypress training courses to learn about more in-depth topics.

I suggest now to close this issue.

from cypress-example-kitchensink.

eabusharkh77 avatar eabusharkh77 commented on June 18, 2024 1

Thank you @MikeMcC399 for all your help. The todo.html file is intact inside the app folder, never touched. Will have to do more research as to why I was getting the 400 error.

from cypress-example-kitchensink.

eabusharkh77 avatar eabusharkh77 commented on June 18, 2024

@MikeMcC399

Which operating system are you using? Which version of Node.js? Which browser are you using?

Did you start the server with npm start? Can you access http://localhost:8080 manually in a browser? Did you start the test with npm run cy:open?

I checked it locally on Windows 11 with Node.js 18 and it worked for me.

I'm using windows 11.
node version is 19.8.1
I tried both electron and chrome and now getting a 404 instead.
when I go to http://localhost:8080 it takes me to the below page.
image

when I try to launch the todo.cy.js now I get a 404 error below.
image

I added cy.visit('http://localhost:8080/todo', {failOnStatusCode: false}) inside the todo.cy.js and now it runs but it doesn't seem to be able to GET the api end point, screenshot below.
image

Here's my cypress config file as well:
image

from cypress-example-kitchensink.

nagash77 avatar nagash77 commented on June 18, 2024

@eabusharkh77 Can you try running with node 18?

from cypress-example-kitchensink.

MikeMcC399 avatar MikeMcC399 commented on June 18, 2024

@eabusharkh77

It seems that you have modified the example and now it is not working. I suggest you make a fresh clone and then you only execute the commands:

npm install
npm run local:open

It should work then. Normally Node.js LTS (currently 18.15.0) is the better choice, but the example does also work with 19.8.1.

For comparison, the file you showed a screenshot of is looking like this in the repository:

module.exports = {
'projectId': '4b7344',
e2e: {},
}

from cypress-example-kitchensink.

eabusharkh77 avatar eabusharkh77 commented on June 18, 2024

@eabusharkh77

It seems that you have modified the example and now it is not working. I suggest you make a fresh clone and then you only execute the commands:

npm install
npm run local:open

It should work then. Normally Node.js LTS (currently 18.15.0) is the better choice, but the example does also work with 19.8.1.

For comparison, the file you showed a screenshot of is looking like this in the repository:

module.exports = {
'projectId': '4b7344',
e2e: {},
}

@MikeMcC399 thank you that worked for me now, I'm not sure why my modified cypress config file was causing the 404 issue though? do I have to run the above 2 commands each time I launch cypress or can I just type: npx cypress open?

from cypress-example-kitchensink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.